Add Gruvbox share theme + blog system for Trilium (anonymized)
Blog generator, publish manager, share scripts, theme CSS, highlight.js bundles, font, favicon, templates and generated-reference outputs, plus an English installation guide.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<script>
|
||||
(function () {
|
||||
var content = document.getElementById("content");
|
||||
if (!content) return;
|
||||
if (!document.body.classList.contains("type-text")) return;
|
||||
if (content.querySelector(".blog-post") || content.querySelector(".blog-garden-table") || content.querySelector(".blog-subcategories") || content.querySelector(".blog-search")) return;
|
||||
var clone = content.cloneNode(true);
|
||||
clone.querySelectorAll("script, style, pre, code, nav, a, .blog-prevnext").forEach(function (el) { el.remove(); });
|
||||
var words = (clone.textContent || "").trim().split(/\s+/).filter(Boolean).length;
|
||||
var mins = Math.max(1, Math.round(words / 200));
|
||||
var title = document.getElementById("title");
|
||||
if (!title) return;
|
||||
var p = document.createElement("div");
|
||||
p.className = "reading-time";
|
||||
p.textContent = mins + " min read";
|
||||
title.parentNode.insertBefore(p, title.nextSibling);
|
||||
})();
|
||||
</script>
|
||||
Reference in New Issue
Block a user