chore(share): bring back CSS

This commit is contained in:
Elian Doran 2025-06-09 13:33:25 +03:00
parent 098cd19b18
commit 7451c2701e
No known key found for this signature in database
4 changed files with 10 additions and 4 deletions

View File

@ -252,6 +252,11 @@
"glob": "**/*", "glob": "**/*",
"input": "packages/share-theme/src/templates", "input": "packages/share-theme/src/templates",
"output": "share-theme/templates" "output": "share-theme/templates"
},
{
"glob": "**/*",
"input": "packages/share-theme/dist",
"output": "share-theme/public"
} }
] ]
} }

View File

@ -13,10 +13,7 @@
<link rel="shortcut icon" href="../favicon.ico"> <link rel="shortcut icon" href="../favicon.ico">
<% } %> <% } %>
<script src="<%= appPath %>/share.js" type="module"></script> <script src="<%= appPath %>/share.js" type="module"></script>
<link href="<%= assetPath %>/src/share.css" rel="stylesheet"> <link href="assets/styles.css" rel="stylesheet">
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
<link href="<%= assetPath %>/stylesheets/share.css" rel="stylesheet">
<% } %>
<% for (const cssRelation of note.getRelations("shareCss")) { %> <% for (const cssRelation of note.getRelations("shareCss")) { %>
<link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet"> <link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet">
<% } %> <% } %>

View File

@ -48,6 +48,7 @@ async function register(app: express.Application) {
app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, "public/stylesheets"))); app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, "public/stylesheets")));
app.use(`/${assetUrlFragment}/libraries`, persistentCacheStatic(path.join(srcRoot, "public/libraries"))); app.use(`/${assetUrlFragment}/libraries`, persistentCacheStatic(path.join(srcRoot, "public/libraries")));
app.use(`/assets/vX/libraries`, express.static(path.join(srcRoot, "..", "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 { export default {

View File

@ -51,6 +51,9 @@ const customServerYml = `- url: "{protocol}://{domain}:{port}/etapi"
<% if (note.type === "text" || note.type === "book") { %> <% if (note.type === "text" || note.type === "book") { %>
<link href="../<%= assetPath %>/libraries/ckeditor/ckeditor-content.css" rel="stylesheet"> <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")) { %> <% for (const cssRelation of note.getRelations("shareCss")) { %>
<link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet"> <link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet">
<% } %> <% } %>