mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
fix(server): missing boxicons in desktop/mobile
This commit is contained in:
parent
4216a71a85
commit
8e73c5906d
@ -1,14 +1,9 @@
|
||||
import "normalize.css";
|
||||
import "boxicons/css/boxicons.min.css";
|
||||
import "@triliumnext/ckeditor5/content.css";
|
||||
import "@triliumnext/share-theme/styles/index.css";
|
||||
import "@triliumnext/share-theme/scripts/index.js";
|
||||
|
||||
async function loadIcons() {
|
||||
if (document.getElementById("menu")) {
|
||||
await import("boxicons/css/boxicons.min.css");
|
||||
}
|
||||
}
|
||||
|
||||
async function ensureJQuery() {
|
||||
const $ = (await import("jquery")).default;
|
||||
(window as any).$ = $;
|
||||
@ -53,7 +48,6 @@ document.addEventListener(
|
||||
"DOMContentLoaded",
|
||||
() => {
|
||||
formatCodeBlocks();
|
||||
loadIcons();
|
||||
applyMath();
|
||||
|
||||
const toggleMenuButton = document.getElementById("toggleMenuButton");
|
||||
|
@ -50,6 +50,7 @@
|
||||
<% } %>
|
||||
|
||||
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
|
||||
|
||||
<script src="<%= appPath %>/runtime.js" crossorigin type="module"></script>
|
||||
|
@ -128,6 +128,7 @@
|
||||
<% } %>
|
||||
|
||||
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
|
||||
|
||||
</body>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<% const hasTree = subRoot.note.hasVisibleChildren(); %>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
@ -8,6 +9,7 @@
|
||||
<script src="<%= appPath %>/share.js" type="module"></script>
|
||||
<% if (!isDev && !note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||
<link href="<%= assetPath %>/src/share.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||
<% } %>
|
||||
|
||||
<% for (const cssRelation of note.getRelations("shareCss")) { %>
|
||||
@ -64,7 +66,6 @@ const themeClass = currentTheme === "light" ? " theme-light" : " theme-dark";
|
||||
const headingRe = /(<h[1-6]>)(.+?)(<\/h[1-6]>)/g;
|
||||
const headingMatches = [...content.matchAll(headingRe)];
|
||||
const slugify = (text) => text.toLowerCase().replace(/[^\w]/g, "-");
|
||||
const hasTree = subRoot.note.hasVisibleChildren();
|
||||
content = content.replaceAll(headingRe, (...match) => {
|
||||
match[0] = match[0].replace(match[3], `<a id="${slugify(match[2])}" class="toc-anchor" name="${slugify(match[2])}" href="#${slugify(match[2])}">#</a>${match[3]}`);
|
||||
return match[0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user