250 lines
11 KiB
Plaintext
250 lines
11 KiB
Plaintext
<!--
|
|
---------------------------------------------------------------
|
|
docmd : the zero-config documentation engine.
|
|
@website https://docmd.io
|
|
[docmd-source] - Please do not remove this header.
|
|
---------------------------------------------------------------
|
|
-->
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="<%= (locals.activeLocale && locals.activeLocale.id) ? locals.activeLocale.id : 'en' %>"<%= (locals.activeLocale && locals.activeLocale.dir && locals.activeLocale.dir !== 'ltr') ? ' dir="' + locals.activeLocale.dir + '"' : '' %>>
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="generator" content="docmd v<%= coreVersion %>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<%- '<script>' %>
|
|
var root = "<%= relativePathToRoot %>";
|
|
if (root && !root.endsWith('/')) root += '/';
|
|
if (root === '') root = './';
|
|
window.DOCMD_ROOT = root;
|
|
window.DOCMD_APPEARANCE = "<%= appearance %>";
|
|
window.DOCMD_LOCALE = "<%= (locals.activeLocale && locals.activeLocale.id) ? locals.activeLocale.id : '' %>";
|
|
<%- '</script>' %>
|
|
|
|
<% if (locals.allLocales && locals.allLocales.length > 1 && !locals.i18nStringMode) { %>
|
|
<%
|
|
var i18nData = {
|
|
default: locals.defaultLocale || "",
|
|
locales: (locals.allLocales || []).map(function(l) {
|
|
return { id: l.id, label: l.label || l.id, dir: l.dir || "ltr" };
|
|
}),
|
|
inPlace: locals.i18nInPlace || false
|
|
};
|
|
%>
|
|
<!-- i18n String Replacement Config -->
|
|
<%- '<script>window.DOCMD_I18N = ' + JSON.stringify(i18nData) + ';</script>' %>
|
|
<% } %>
|
|
|
|
<!-- 2. META & TITLE -->
|
|
<% if (frontmatter.components?.meta !==false) { %>
|
|
<%- metaTagsHtml || '' %>
|
|
<title>
|
|
<%= pageTitle %>
|
|
<% if (frontmatter.components?.siteTitle !==false && siteTitle && pageTitle !== siteTitle && !(frontmatter && frontmatter.titleAppend === false)) { %> : <%= siteTitle %>
|
|
<% } %>
|
|
</title>
|
|
<% if (description && !(metaTagsHtml && metaTagsHtml.includes('name="description"'))) { %>
|
|
<meta name="description" content="<%= description %>">
|
|
<% } %>
|
|
<% } %>
|
|
|
|
<!-- 3. FAVICON -->
|
|
<% if (frontmatter.components?.favicon !== false) { %>
|
|
<%- faviconLinkHtml || '' %>
|
|
<% } %>
|
|
|
|
<!-- 4. CORE CSS -->
|
|
<% if (frontmatter.components?.css !== false) { %>
|
|
<link rel="stylesheet" href="<%= relativePathToRoot %>assets/css/docmd-main.css?v=<%= buildHash %>">
|
|
|
|
<!-- 5. HIGHLIGHT CSS (Toggle Strategy) -->
|
|
<% if (frontmatter.components?.highlight !== false) {
|
|
const isDarkDefault = defaultMode === ' dark'; %>
|
|
<link rel="stylesheet"
|
|
href="<%= relativePathToRoot %>assets/css/docmd-highlight-light.css?v=<%= buildHash %>"
|
|
id="hljs-light" <%=isDarkDefault ? 'disabled' : '' %>>
|
|
|
|
<link rel="stylesheet"
|
|
href="<%= relativePathToRoot %>assets/css/docmd-highlight-dark.css?v=<%= buildHash %>"
|
|
id="hljs-dark" <%=isDarkDefault ? '' : 'disabled' %>>
|
|
<% } %>
|
|
<% } %>
|
|
|
|
<!-- 6. PLUGINS & THEMES (Overrides Core) -->
|
|
<% if (frontmatter.components?.pluginHeadScripts !==false) { %>
|
|
<%- pluginHeadScriptsHtml || '' %>
|
|
<% } %>
|
|
|
|
<!-- 7. THEME CSS (Legacy/Specific overrides) -->
|
|
<% if (frontmatter.components?.theme !==false) { %>
|
|
<%- themeCssLinkHtml || '' %>
|
|
<% } %>
|
|
|
|
<!-- 8. CUSTOM CSS (Overrides Everything) -->
|
|
<% if (frontmatter.components?.customCss !==false && customCssFiles && customCssFiles.length> 0) { %>
|
|
<% customCssFiles.forEach(cssFile=> { %>
|
|
<link rel="stylesheet"
|
|
href="<%= relativePathToRoot %><%= cssFile.startsWith('/') ? cssFile.substring(1) : cssFile %>?v=<%= buildHash %>">
|
|
<% }); %>
|
|
<% } %>
|
|
|
|
<!-- 9. PLUGIN STYLES (If separate) -->
|
|
<% if (frontmatter.components?.pluginStyles !==false) { %>
|
|
<%- pluginStylesHtml || '' %>
|
|
<% } %>
|
|
|
|
<!-- 10. THEME INIT (Must be last to apply correct mode immediately) -->
|
|
<% if (frontmatter.components?.themeMode !==false) { %>
|
|
<%- themeInitScript %>
|
|
<% } %>
|
|
|
|
<!-- 11. USER CUSTOM HEAD -->
|
|
<% if (frontmatter.customHead) { %>
|
|
<%- frontmatter.customHead %>
|
|
<% } %>
|
|
</head>
|
|
<body<% if (frontmatter.components?.theme !==false) { %> data-theme="<%= defaultMode %>"<% } %>
|
|
<% if (frontmatter.bodyClass) { %> class="<%= frontmatter.bodyClass %>"<% } %> data-copy-code-enabled="<%=
|
|
config.copyCode===true %>" data-spa-enabled="<%= frontmatter.components?.spa === true %>">
|
|
<% if (frontmatter.components?.menubar === true && (locals.menubarConfig && menubarConfig?.enabled !== false)) { %>
|
|
<%- await include('partials/menubar', { menubarConfig, relativePathToRoot, renderIcon, optionsMenu: locals.optionsMenu }) %>
|
|
<% } %>
|
|
|
|
<% if (frontmatter.components?.layout===true || frontmatter.components?.layout==='full' ) { %>
|
|
<div class="main-content-wrapper">
|
|
<% if (frontmatter.components?.header !==false) { %>
|
|
<header class="page-header">
|
|
<% if (frontmatter.components?.pageTitle !==false) { %>
|
|
<h1>
|
|
<%= pageTitle %>
|
|
</h1>
|
|
<% } %>
|
|
</header>
|
|
<% } %>
|
|
<main class="content-area">
|
|
<div class="content-layout">
|
|
<div class="main-content"><%- content %></div>
|
|
<% if (frontmatter.components?.toc !==false && headings && headings.length> 0) { %>
|
|
<div class="toc-sidebar">
|
|
<%- await include('toc', { content, headings, navigationHtml, isActivePage }) %>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</main>
|
|
<% if (frontmatter.components?.footer !==false) { %>
|
|
<footer class="page-footer">
|
|
<div class="footer-content">
|
|
<div class="user-footer"><%- footerHtml || '' %></div>
|
|
<% if (frontmatter.components?.branding !==false) { %>
|
|
<div class="branding-footer">
|
|
Build with <svg xmlns="http://www.w3.org/2000/svg"
|
|
width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
|
stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z">
|
|
</path>
|
|
<path d="M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66">
|
|
</path>
|
|
<path d="m18 15-2-2"></path>
|
|
<path d="m15 18-2-2"></path>
|
|
</svg> <a href="https://docmd.io" target="_blank" rel="noopener">docmd.</a>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</footer>
|
|
<% } %>
|
|
</div>
|
|
<% } else if (frontmatter.components?.sidebar===true) { %>
|
|
<aside class="sidebar">
|
|
<% if (frontmatter.components?.logo !==false && logo && logo.light && logo.dark) { %>
|
|
<div class="sidebar-header">
|
|
<a href="<%= logo.href || relativePathToRoot %>" class="logo-link">
|
|
<img src="<%= relativePathToRoot %><%= logo.light.startsWith('/') ? logo.light.substring(1) : logo.light %>"
|
|
alt="<%= logo.alt || siteTitle %>" class="logo-light" <% if (logo.height) { %>style="height: <%= logo.height %>;"<% } %>>
|
|
<img src="<%= relativePathToRoot %><%= logo.dark.startsWith('/') ? logo.dark.substring(1) : logo.dark %>"
|
|
alt="<%= logo.alt || siteTitle %>" class="logo-dark" <% if (logo.height) { %>style="height: <%= logo.height %>;"<% } %>>
|
|
</a>
|
|
</div>
|
|
<% } %>
|
|
<% if (frontmatter.components?.navigation !==false) { %>
|
|
<%- navigationHtml %>
|
|
<% } %>
|
|
<% if (frontmatter.components?.themeToggle !==false && theme && theme.enableModeToggle) { %>
|
|
<button id="theme-toggle-button" aria-label="<%= typeof t === 'function' ? t('toggleTheme') : 'Toggle theme' %>" class="theme-toggle-button">
|
|
<%- renderIcon('sun', { class: 'icon-sun' }) %> <%- renderIcon('moon', { class: 'icon-moon' }) %>
|
|
</button>
|
|
<% } %>
|
|
</aside>
|
|
<div class="main-content-wrapper">
|
|
<% if (frontmatter.components?.header !==false) { %>
|
|
<header class="page-header">
|
|
<% if (frontmatter.components?.pageTitle !==false) { %>
|
|
<h1>
|
|
<%= pageTitle %>
|
|
</h1>
|
|
<% } %>
|
|
</header>
|
|
<% } %>
|
|
<main class="content-area">
|
|
<div class="content-layout">
|
|
<div class="main-content"><%- content %></div>
|
|
<% if (frontmatter.components?.toc !==false && headings && headings.length> 0) { %>
|
|
<div class="toc-sidebar">
|
|
<%- await include('toc', { content, headings, navigationHtml, isActivePage }) %>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</main>
|
|
<% if (frontmatter.components?.footer !==false) { %>
|
|
<footer class="page-footer">
|
|
<div class="footer-content">
|
|
<div class="user-footer"><%- footerHtml || '' %></div>
|
|
<% if (frontmatter.components?.branding !==false) { %>
|
|
<div class="branding-footer">
|
|
Build with <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"></path>
|
|
<path d="M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66"></path>
|
|
<path d="m18 15-2-2"></path>
|
|
<path d="m15 18-2-2"></path>
|
|
</svg> <a href="https://docmd.io" target="_blank" rel="noopener">docmd.</a>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</footer>
|
|
<% } %>
|
|
</div>
|
|
<% } else { %>
|
|
<%- content %>
|
|
<% } %>
|
|
|
|
<% if (frontmatter.components?.scripts===true) { %>
|
|
<% if (frontmatter.components?.mainScripts===true) { %>
|
|
<%- '<script>window.DOCMD_ROOT = "' + relativePathToRoot + '";</script>' %>
|
|
<script src="<%= relativePathToRoot %>assets/js/docmd-main.js"></script>
|
|
<% } %>
|
|
|
|
<% if (frontmatter.components?.lightbox===true && frontmatter.components?.mainScripts===true) { %>
|
|
<script src="<%= relativePathToRoot %>assets/js/docmd-image-lightbox.js"></script>
|
|
<% } %>
|
|
|
|
<% if (frontmatter.components?.customJs===true && customJsFiles && customJsFiles.length> 0) { %>
|
|
<% customJsFiles.forEach(jsFile=> { %>
|
|
<script src="<%= relativePathToRoot %><%= jsFile.startsWith('/') ? jsFile.substring(1) : jsFile %>"></script>
|
|
<% }); %>
|
|
<% } %>
|
|
|
|
<% if (frontmatter.components?.scripts !==false) { %>
|
|
<%- pluginBodyScriptsHtml || '' %>
|
|
<% } %>
|
|
<% } %>
|
|
|
|
<% if (frontmatter.customScripts) { %>
|
|
<%- frontmatter.customScripts %>
|
|
<% } %>
|
|
|
|
<% if (locals.allLocales && locals.allLocales.length > 1 && !locals.i18nStringMode) { %>
|
|
<script src="<%= relativePathToRoot %>assets/js/docmd-i18n-strings.js?v=<%= buildHash %>"></script>
|
|
<% } %>
|
|
</body>
|
|
</html> |