Skip to content

Build your personal knowledge base with Trilium Notes

chore(export/share): disable non-functional search

Elian Doran54200fa0cb6d
diff --git a/apps/server/src/share/content_renderer.ts b/apps/server/src/share/content_renderer.ts
index f7ed4ba043..fd45d27da3 100644
--- a/apps/server/src/share/content_renderer.ts
+++ b/apps/server/src/share/content_renderer.ts
@@ -81,7 +81,8 @@ export function renderNoteForExport(note: BNote, parentBranch: BBranch, basePath
`${basePath}assets/scripts.js`
],
logoUrl: `${basePath}icon-color.svg`,
- ancestors
+ ancestors,
+ isStatic: true
});
}
@@ -126,7 +127,8 @@ export function renderNoteContent(note: SNote) {
cssToLoad,
jsToLoad,
logoUrl,
- ancestors
+ ancestors,
+ isStatic: false
});
}
@@ -137,6 +139,7 @@ interface RenderArgs {
jsToLoad: string[];
logoUrl: string;
ancestors: string[];
+ isStatic: boolean;
}
function renderNoteContentInternal(note: SNote | BNote, renderArgs: RenderArgs) {
@@ -153,7 +156,7 @@ function renderNoteContentInternal(note: SNote | BNote, renderArgs: RenderArgs)
t,
isDev,
utils,
- ...renderArgs
+ ...renderArgs,
};
// Check if the user has their own template.
diff --git a/packages/share-theme/src/templates/page.ejs b/packages/share-theme/src/templates/page.ejs
index 0196bfddce..ccf2bceb16 100644
--- a/packages/share-theme/src/templates/page.ejs
+++ b/packages/share-theme/src/templates/page.ejs
@@ -114,7 +114,7 @@ content = content.replaceAll(headingRe, (...match) => {
<svg class="light-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M6.993 12c0 2.761 2.246 5.007 5.007 5.007s5.007-2.246 5.007-5.007S14.761 6.993 12 6.993 6.993 9.239 6.993 12zM12 8.993c1.658 0 3.007 1.349 3.007 3.007S13.658 15.007 12 15.007 8.993 13.658 8.993 12 10.342 8.993 12 8.993zM10.998 19h2v3h-2zm0-17h2v3h-2zm-9 9h3v2h-3zm17 0h3v2h-3zM4.219 18.363l2.12-2.122 1.415 1.414-2.12 2.122zM16.24 6.344l2.122-2.122 1.414 1.414-2.122 2.122zM6.342 7.759 4.22 5.637l1.415-1.414 2.12 2.122zm13.434 10.605-1.414 1.414-2.122-2.122 1.414-1.414z"></path></svg>
</label>
</div>
- <% if (hasTree) { %>
+ <% if (hasTree && !isStatic) { %>
<div class="search-item">
<svg class="search-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"></path></svg>
<input type="text" class="search-input" placeholder="<%= t("share_theme.search_placeholder") %>">