Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Slightly adjust page template
Zack Rauena7edc5e03ef9
diff --git a/scripts/build.ts b/scripts/build.tsindex d8fea2d7ac..a4f3c39b03 100644--- a/scripts/build.ts+++ b/scripts/build.ts@@ -33,7 +33,7 @@ async function sendTemplates() {}if (process.argv.includes("--only-templates")) {- sendTemplates().catch(console.error);+ await sendTemplates();process.exit(0);}diff --git a/src/templates/page.ejs b/src/templates/page.ejsindex 5abba1535e..fcf6190442 100644--- a/src/templates/page.ejs+++ b/src/templates/page.ejs@@ -24,7 +24,7 @@document.addEventListener("DOMContentLoaded", function() {SwaggerUIBundle({url: `<%= note.getLabelValue("shareSwagger") %>`,- domNode: "#content"+ dom_id: "#content"});});</script>@@ -43,6 +43,23 @@<% } %><%- header %><title><%= note.title %><% if (note.noteId !== subRoot.noteId) { %> - <%= subRoot.title %><% } %></title>+ <!-- HTML Meta Tags -->+ <meta name="description" content="A website for guides, reference, showcase, inspiration, and more, all for Trilium Notes! Not convinced? Come see for yourself just what Trilium can do."+ ><!-- Facebook Meta Tags -->+ <meta property="og:url" content="https://trilium.rocks/">+ <meta property="og:type" content="website">+ <meta property="og:title" content="<%= note.title %><% if (note.noteId !== subRoot.noteId) { %> - <%= subRoot.title %><% } %>">+ <meta property="og:description" content="<%= note.getLabelValue("shareDescription") %>">+ <meta property="og:image" content="https://github.com/zadam/trilium/wiki/images/screenshot.png">+ <!-- Twitter Meta Tags -->+ <meta name="twitter:card" content="summary_large_image">+ <meta property="twitter:domain" content="trilium.rocks">+ <meta property="twitter:url" content="https://trilium.rocks/">+ <meta name="twitter:title" content="<%= note.title %><% if (note.noteId !== subRoot.noteId) { %> - <%= subRoot.title %><% } %>">+ <meta name="twitter:description" content="<%= note.getLabelValue("shareDescription") %>">+ <meta name="twitter:image" content="https://github.com/zadam/trilium/wiki/images/screenshot.png">+ <!-- Meta Tags Generated via https://opengraph.dev -->+ <meta name="theme-color" content="#4FA52B"></head><%const currentTheme = note.getLabel("shareTheme") === "light" ? "light" : "dark";@@ -97,12 +114,15 @@ const themeClass = currentTheme === "light" ? " theme-light" : " theme-dark";<div id="noteClippedFrom">This note was originally clipped from <a href="<%= note.getLabelValue("pageUrl") %>"><%= note.getLabelValue("pageUrl") %></a></div><% } %>- <% if (!isEmpty) { %>- <div id="content" class="type-<%= note.type %><% if (note.type === 'text') { %> ck-content<% } %>">- <h1 id="title"><%= note.title %></h1>++ <div id="content" class="type-<%= note.type %><% if (note.type === 'text') { %> ck-content<% } %><% if (isEmpty) { %> no-content<% } %>">+ <h1 id="title"><%= note.title %></h1>+ <% if (isEmpty && !note.hasVisibleChildren()) { %>+ <p>This note has no content.</p>+ <% } else { %><%- content %>- </div>- <% } %>+ <% } %>+ </div><% if (note.hasVisibleChildren()) { %><nav id="childLinks" class="<% if (isEmpty) { %>grid<% } else { %>list<% } %>">@@ -119,12 +139,7 @@ const themeClass = currentTheme === "light" ? " theme-light" : " theme-dark";<% } %></ul></nav>- <% } else if (isEmpty) { %>- <div id="content" class="type-<%= note.type %><% if (note.type === 'text') { %> ck-content<% } %>">- <h1 id="title"><%= note.title %></h1>- <p>This note has no content.</p>- </div>- <% } %>+ <% } else %></div></div></div>diff --git a/tsconfig.json b/tsconfig.jsonindex ef08e0c075..ac91e669c5 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -7,7 +7,7 @@"resolveJsonModule": true,"strictNullChecks": true,"moduleResolution": "Node16",- "target": "ES2021",+ "target": "ES2022","rootDir": "src","outDir": "lib/cjs","module": "Node16"