Files
Trilium/packages/share-theme
Elian DoranandClaude Opus 5.5 fae38aec40 fix(share): close the mobile drawer when the current note is selected in place
Clicking the current note, or another clone of it, in the tree keeps
the page and moves the selection, so no new page loads to dismiss the
narrow-screen drawer: it stayed open over the page with scrolling
locked. The click handler now removes `menu-open` after selecting the
entry. It does so inline, since `layout.ts` imports its stylesheet and
`tree_state.ts` is bundled into the import-free `tree.js`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-09 22:14:28 +03:00
..

Share theme

The default theme for shared notes and for the static HTML export. It started as the theme of trilium.rocks by Zerebos.

  • src/templates/ — the EJS templates. packages/trilium-core/src/share/content_renderer.ts renders them on the server; a note can replace page.ejs with its own through ~shareTemplate.
  • src/page/ — the parts of the page around the note (layout, header, navigation tree, search, table of contents, footer), and src/content/ — the styles and enhancements for the note's own content (math, Mermaid, link embeds, adaptive colors). A script imports its own stylesheet, which shares its name and folder: toc.ts imports ./toc.css.
  • src/index.ts — the entry point. It sets every script up and imports the stylesheets that have no script; the order of its imports is the cascade order.

pnpm --filter share-theme build bundles them into dist/scripts.js and dist/scripts.css, which the server, desktop, standalone and static-export builds copy. pnpm install runs it, but no *:start script does, so rebuild after changing a script or style (or run pnpm --filter share-theme dev to watch).