Skip to content

Build your personal knowledge base with Trilium Notes

7.9 KB
Raw Blame
<!DOCTYPE html>
<html lang="<%= language.page.lang %>" dir="<%= language.page.dir %>">
<head>
    <%- snippets["head:start"] %>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="shortcut icon" href="<%= faviconUrl %>">
    <% for (const font of fontPreloads) { %>
        <link rel="preload" href="<%= font.href %>" as="font" type="<%= font.type %>" crossorigin>
    <% } %>
    <% for (const url of cssToLoad) { %>
        <link href="<%= url %>" rel="stylesheet">
    <% } %>
    <% for (const [ index, url ] of jsToLoad.entries()) { %>
        <script type="module" src="<%= url %>"<% if (index === 0) { %> blocking="render"<% } %>></script>
    <% } %>
    <% if (head.noIndex) { %>
        <meta name="robots" content="noindex,follow" />
    <% } %>
    <title><%= head.title %></title>
    <%- include("boot_script") %>
    <% for (const meta of head.metaTags) { %>
        <meta <%= meta.attribute %>="<%= meta.key %>" content="<%= meta.content %>">
    <% } %>
    <style id="trilium-icon-packs">
      <%- utils.escapeInlineStylesheet(iconPackCss) %>
    </style>
    <%- snippets["head:end"] %>
</head>
<body data-note-id="<%= note.noteId %>" class="type-<%= note.type %>" data-ancestor-note-id="<%= subRoot.note.noteId %>">
<%- snippets["body:start"] %>
<div id="header">
    <button aria-label="<%= t("share_theme.toggle-navigation") %>" id="left-pane-toggle-button" class="header-button"><span class="tn-icon bx bx-menu" aria-hidden="true"></span></button>
    <%- include("site_logo", { id: "header-logo" }) %>
</div>
<div id="split-pane">
    <div id="left-pane">
        <div id="navigation">
            <div id="site-header">
                <div id="site-title-row">
                    <%- include("site_logo", { id: "site-logo" }) %>
                    <div class="theme-selection" role="group" aria-labelledby="theme-selection-label">
                        <span id="theme-selection-label" class="visually-hidden"><%= t("share_theme.appearance") %></span>
                        <div class="theme-options">
                            <button type="button" class="theme-option" data-theme="light" aria-label="<%= t("share_theme.theme-light") %>" title="<%= t("share_theme.theme-light") %>"><span class="tn-icon bx bx-sun" aria-hidden="true"></span></button>
                            <button type="button" class="theme-option" data-theme="dark" aria-label="<%= t("share_theme.theme-dark") %>" title="<%= t("share_theme.theme-dark") %>"><span class="tn-icon bx bx-moon" aria-hidden="true"></span></button>
                            <button type="button" class="theme-option" data-theme="system" aria-label="<%= t("share_theme.theme-system") %>" title="<%= t("share_theme.theme-system") %>"><span class="tn-icon bx bx-desktop" aria-hidden="true"></span></button>
                        </div>
                    </div>
                </div>
                <% if (navigation.length) { %>
                    <div class="search-item">
                        <input type="text" class="search-input" placeholder="<%= t("share_theme.search_placeholder") %>" aria-label="<%= t("share_theme.search_placeholder") %>">
                        <span class="search-icon tn-icon bx bx-search" aria-hidden="true"></span>
                    </div>
                <% } %>
            </div>
        <% if (headings.length > 1 && !isPageInNavigation) { %>
            <nav class="tree-toc" aria-labelledby="tree-toc-title">
                <h3 id="tree-toc-title"><%= t("share_theme.on-this-page") %></h3>
                <%- include("tree_toc", { entries: toc }) %>
            </nav>
        <% } %>
        <% if (navigation.length) { %>
            <nav id="menu">
                <%- include("tree_item", { items: navigation }) %>
            </nav>
        <% } %>   
        </div>
    </div>
    <div id="right-pane">
        <div id="main">
            <div id="content" class="<%= contentClasses %>"<% if (language.content) { %> lang="<%= language.content.lang %>" dir="<%= language.content.dir %>"<% } %> data-tab-title-placeholder="<%= t("share_theme.tab-title") %>" data-tab-previous-label="<%= t("share_theme.previous-tabs") %>" data-tab-next-label="<%= t("share_theme.next-tabs") %>" data-copy-code-label="<%= t("share_theme.copy-code") %>">
                <%- snippets["content:start"] %>
                <% if (showTitle && titleIcon) { %>
                    <div id="title-row">
                        <span class="tn-icon <%= titleIcon %>" aria-hidden="true"></span>
                        <h1 id="title"><%= note.title %></h1>
                    </div>
                <% } else if (showTitle) { %>
                    <h1 id="title"><%= note.title %></h1>
                <% } %>
                <% if (isEmpty && !childLinks.length && note.type !== "book") { %>
                    <p><%= t("share_page.no-content") %></p>
                <% } else { %>
                    <%- content %>
                <% } %>
                <%- snippets["content:end"] %>
            </div>

            <% if (childLinks.length) { %>
                <nav id="childLinks" class="<%= childLinksLayout %>">
                    <% if (!isEmpty) { %>
                        <span><%= t("share_theme.subpages") %></span>
                    <% } %>

                    <ul>
                        <% for (const child of childLinks) { %>
                            <li>
                                <span class="tn-icon <%= child.icon %>" aria-hidden="true"></span>
                                <a class="child-link-title type-<%= child.type %> no-arrow" href="<%= child.href %>"<% if (child.isExternal) { %> target="_blank" rel="noopener noreferrer"<% } %>><%= child.title %></a>
                                <% if (child.excerpt) { %>
                                    <p class="child-link-excerpt"><%= child.excerpt %></p>
                                <% } %>
                                <% if (child.children.length) { %>
                                    <div class="child-link-children ck-content">
                                        <% for (const grandchild of child.children) { %>
                                            <a class="reference-link" href="<%= grandchild.href %>"<% if (grandchild.isExternal) { %> target="_blank" rel="noopener noreferrer"<% } %>><span class="tn-icon <%= grandchild.icon %>" aria-hidden="true"></span><%= grandchild.title %></a>
                                        <% } %>
                                    </div>
                                <% } %>
                            </li>
                        <% } %>
                    </ul>
                </nav>
            <% } %>

            <footer id="content-footer">
                <% if (!isEmpty && !isStatic && lastUpdated) { %>
                    <div class="updated">
                        <%- t("share_theme.last-updated", { date: `<time datetime="${lastUpdated.iso}">${lastUpdated.text}</time>` }) %>
                    </div>
                <% } %>

                <% if (navigation.length && (prevNext.previous || prevNext.next)) { %>
                    <%- include("prev_next") %>
                <% } %>

                <% if (showLoginInShareTheme && !isStatic) { %>
                    <div class="login">
                        <a href="../login" class="login-link"><%= t("share_theme.login") %></a>
                    </div>
                <% } %>
            </footer>
        </div>
        <% if (headings.length > 1) { %>
            <div id="toc-pane">
                <h3><%= t("share_theme.on-this-page") %></h3>
                <ul id="toc">
                    <% for (const entry of toc) { %>
                        <%- include("toc_item", {entry}) %>
                    <% } %>
                </ul>
            </div>
        <% } else { %>
            <div id="toc-pane"></div>
        <% } %>
    </div>
</div>
<div id="mobile-backdrop"></div>
<%- snippets["body:end"] %>
</body>
</html>