# Trilium Share – Coffee Blog System [![License](https://img.shields.io/badge/License-GPL--3.0-fb4934)](LICENSE) [![Live demo](https://img.shields.io/badge/Live%20demo-richard.familie--zink.org-8ec07c)](https://richard.familie-zink.org) [![TriliumNext](https://img.shields.io/badge/TriliumNext-Public%20Share-83a598)](https://github.com/TriliumNext/Trilium) [![Theme](https://img.shields.io/badge/Theme-Coffee-e0a15c)](https://github.com/megabyte0x/omarchy-coffee-theme) [![Built with](https://img.shields.io/badge/Built%20with-Opencode-fe8019)](https://opencode.ai) [![Model](https://img.shields.io/badge/Model-Deepseek%20V4%20Flash-d3869b)](https://www.deepseek.com/) > **Note:** This theme and blog system was created with the help of > [**Opencode**](https://opencode.ai) and **Deepseek V4 Flash**. A complete **public-share blog system + Coffee theme** for [TriliumNext](https://github.com/TriliumNext/Trilium). It turns a normal Trilium note tree into a themed, searchable blog with categories, an RSS feed, a sitemap, a digital garden (growth states) and client-side rendering of Mermaid, Excalidraw and mind-map notes. Everything is driven by Trilium's built-in **Public Share** feature plus a few frontend/backend scripts – no external dependencies (except `highlight.js`, vendored in `lib/`). ## Themes The share ships with **three themes**, each with a dark and a light variant (toggled via the header switch / `html.theme-light` + `html.theme-dark`). They live in `theme/` and are set on the blog by pointing the `shareCss` relation at the matching note – see [`docs/switch-blog-theme.md`](docs/switch-blog-theme.md) for the step-by-step guide. | Theme | File | Palette (dark / light) | Source | |---|---|---|---| | **Coffee** (active by default) | `theme/blog_share_theme_coffee.css` | espresso `#1d150f` / latte-cream `#f0e2d0`, caramel `#e0a15c` · cream `#E8E3C3` / ink `#2D1A1D`, berry `#8e2d53` | [megabyte0x/omarchy-coffee-theme](https://github.com/megabyte0x/omarchy-coffee-theme) (MIT) | | **Harbor** | `theme/blog_share_theme_harbor.css` | near-black `#1b1b1b` / cream `#efebdc`, coral `#e75a50` · paper `#dfe4c4` / ink `#1c2d28`, nord-blue `#5e81ac` | [HANCORE-linux/omarchy-harbor-theme](https://github.com/HANCORE-linux/omarchy-harbor-theme) (MIT) | | **Gruvbox** | `theme/blog_share_theme_gruvbox.css` | bg `#282828` / fg `#ebdbb2`, accents red/green/yellow/blue | [morhetz/gruvbox](https://github.com/morhetz/gruvbox) (MIT) | ![Coffee palette](assets/palette-coffee.png) ![Harbor palette](assets/palette-harbor.png) ![Gruvbox palette](assets/palette-gruvbox.png) ## Features - Coffee dark / Coffee Latte light theme for the share, with a theme toggle in the header (Gruvbox and Harbor are available as well – see the [Themes](#themes) section). - Blog index, category pages, sub-categories, tags and tag overview. - **Menu sorting**: articles in the left menu are sorted by publication date (newest first) and labelled `Fri 2026-08-28 ` automatically. All date displays (post cards, garden table, menu) include the weekday (`dateText` from the generator). - **Article thumbnails**: each post card shows the first image of the article on the left (bounded by the teaser height), summary on the right, lazy-loaded. If an article has a child note named `thumb.` **or** `*_thumb.` (e.g. `thumb.png`, `ngc281_thumb.jpg`), that image is used instead – ideal for serving small pre-made thumbnails. Thumb child notes are auto-hidden from the blog menu (`shareHiddenFromTree`). - **Pagination**: 10 posts per page on the index and category pages, with prev/next navigation between the pages; article prev/next links stay within the article's category. - Article metadata: date, category, summary, tags, prev/next navigation, reading time. - **Digital Garden**: `state` labels (Seed → Evergreen, Draft, Review) rendered as badges and colour-coded growth tables. - **Search** (client-side over a generated index), **RSS feed** and **sitemap.xml**. - **SEO**: per-page canonical + Open Graph (`og:url`, `og:image`, article/website type), Twitter cards, JSON-LD structured data (WebSite / BlogPosting / CollectionPage), `robots.txt` and `index,follow` meta. Provided by a custom share template (`templates/share/page.ejs`). - **Widget rendering** for Mermaid, Excalidraw (canvas) and MindElixir (mind map) notes, with a collapsible, highlighted "Source" block and copy button. - **3D models**: `.step` / `.stp` / `.stl` files (as file notes, as inline attachments, or linked from text notes) render in an interactive three.js viewer (STEP via **occt-wasm**, OpenCASCADE V8, parsed in a non-blocking **module worker**). The viewer is **full-bleed** (~`100vw`) with a viewport-based height, drag to rotate / scroll to zoom, rounded 8px box, a loading progress bar and a caption showing `name · size · triangle count`. Large meshes are split into `Uint16` chunks so mobile GPUs render them too (≈480k triangles for the demo battery module). See [docs/embed-3d-model.md](docs/embed-3d-model.md). - **3D viewer inside Trilium (app widget)**: the same viewer runs in the Trilium app itself (independent of the blog) via a `note-detail-pane` widget – see `app/`. - Code highlighting (highlight.js + line numbers) and copy buttons on all code boxes. - Optional "Buy me a coffee" button with locally-hosted Cookie font. - `blog_generator` (backend) builds index/feed/sitemap/search-data; `blog_publish_manager` moves notes between an `Unpublished` staging area and the live blog. ## Repository layout | Path | Content | Trilium note type / mime | |---|---|---| | `blog_generator.js` | backend script that generates index, feed, sitemap, search data, category & tag pages | code, `application/javascript;env=backend` | | `blog_publish_manager.js` | backend script that mirrors notes between `Unpublished` and the blog | code, `application/javascript;env=backend` | | `theme/blog_share_theme_coffee.css` | Coffee / Coffee Latte share theme (active by default) | code, `text/css` | | `theme/blog_share_theme_harbor.css` | Harbor / Harbordark share theme | code, `text/css` | | `theme/blog_share_theme_gruvbox.css` | Gruvbox light/dark share theme | code, `text/css` | | `theme/favicon.svg` | default site favicon | code (SVG) | | `theme/cookie.woff2` | "Cookie" font for the Buy me a coffee button | file, `font/woff2` | | `lib/highlight.js` | vendored highlight.js | code, `application/javascript` | | `lib/3d/*` | three.js + OrbitControls + STLLoader + occt-wasm (OCCT V8 bundle + WASM) for the 3D viewer | code / file | | `lib/hljs_line_numbers.js` | highlight.js line-numbers plugin | code | | `scripts/*.js` | frontend share snippets (content is pasted **verbatim** into a code note, including the `