mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
refactor(share): integrate with client
This commit is contained in:
parent
3def1a1e57
commit
8bdf3626f0
@ -25,6 +25,7 @@
|
||||
"@triliumnext/codemirror": "workspace:*",
|
||||
"@triliumnext/commons": "workspace:*",
|
||||
"@triliumnext/highlightjs": "workspace:*",
|
||||
"@triliumnext/share-theme": "workspace:*",
|
||||
"autocomplete.js": "0.38.1",
|
||||
"bootstrap": "5.3.6",
|
||||
"boxicons": "2.1.4",
|
||||
|
@ -1,5 +1,6 @@
|
||||
import "normalize.css";
|
||||
import "@triliumnext/ckeditor5/content.css";
|
||||
import "@triliumnext/share-theme/styles/index.css";
|
||||
|
||||
/**
|
||||
* Fetch note with given ID from backend
|
||||
|
@ -34,14 +34,17 @@
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/share-theme"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/highlightjs/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/codemirror/tsconfig.lib.json"
|
||||
"path": "../../packages/commons/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/commons/tsconfig.lib.json"
|
||||
"path": "../../packages/codemirror/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/ckeditor5/tsconfig.lib.json"
|
||||
|
@ -252,11 +252,6 @@
|
||||
"glob": "**/*",
|
||||
"input": "packages/share-theme/src/templates",
|
||||
"output": "share-theme/templates"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "packages/share-theme/dist",
|
||||
"output": "share-theme/public"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -12,7 +12,11 @@
|
||||
<% } else { %>
|
||||
<link rel="shortcut icon" href="../favicon.ico">
|
||||
<% } %>
|
||||
<link href="assets/styles.css" rel="stylesheet">
|
||||
<script src="<%= appPath %>/share.js" type="module"></script>
|
||||
<link href="<%= assetPath %>/src/share.css" rel="stylesheet">
|
||||
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||
<link href="<%= assetPath %>/stylesheets/share.css" rel="stylesheet">
|
||||
<% } %>
|
||||
<% for (const cssRelation of note.getRelations("shareCss")) { %>
|
||||
<link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet">
|
||||
<% } %>
|
||||
|
@ -48,7 +48,6 @@ async function register(app: express.Application) {
|
||||
app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, "public/stylesheets")));
|
||||
app.use(`/${assetUrlFragment}/libraries`, persistentCacheStatic(path.join(srcRoot, "public/libraries")));
|
||||
app.use(`/assets/vX/libraries`, express.static(path.join(srcRoot, "..", "libraries")));
|
||||
app.use(`/share/assets`, express.static(path.join(resourceDir, "share-theme", "public")));
|
||||
}
|
||||
|
||||
export default {
|
||||
|
@ -12,6 +12,7 @@
|
||||
},
|
||||
"exports": {
|
||||
"./templates/*": "./src/templates/*",
|
||||
"./styles/*": "./src/styles/*",
|
||||
"./*": "./dist/*"
|
||||
},
|
||||
"author": "",
|
||||
|
@ -11,6 +11,9 @@
|
||||
<link rel="shortcut icon" href="<% if (note.hasRelation("shareFavicon")) { %>api/notes/<%= note.getRelation("shareFavicon").value %>/download<% } else { %>../favicon.ico<% } %>">
|
||||
<script src="<%= appPath %>/share.js" type="module"></script>
|
||||
<link href="../<%= assetPath %>/libraries/normalize.min.css" rel="stylesheet">
|
||||
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||
<link href="<%= assetPath %>/stylesheets/share.css" rel="stylesheet">
|
||||
<% } %>
|
||||
|
||||
<% if (note.hasLabel("shareSwagger")) { %>
|
||||
<!-- TODO: make these note IDs customizable -->
|
||||
@ -51,15 +54,9 @@ const customServerYml = `- url: "{protocol}://{domain}:{port}/etapi"
|
||||
<% if (note.type === "text" || note.type === "book") { %>
|
||||
<link href="../<%= assetPath %>/libraries/ckeditor/ckeditor-content.css" rel="stylesheet">
|
||||
<% } %>
|
||||
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||
<link href="assets/styles.css" rel="stylesheet">
|
||||
<% } %>
|
||||
<% for (const cssRelation of note.getRelations("shareCss")) { %>
|
||||
<link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet">
|
||||
<% } %>
|
||||
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||
<script type="module" src="assets/scripts.js"></script>
|
||||
<% } %>
|
||||
<% for (const jsRelation of note.getRelations("shareJs")) { %>
|
||||
<script type="module" src="api/notes/<%= jsRelation.value %>/download"></script>
|
||||
<% } %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user