mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +08:00
fix(share): script not loadable due to relative path
This commit is contained in:
parent
470ac18cba
commit
786233ab06
@ -12,12 +12,12 @@
|
|||||||
<% } else { %>
|
<% } else { %>
|
||||||
<link rel="shortcut icon" href="../favicon.ico">
|
<link rel="shortcut icon" href="../favicon.ico">
|
||||||
<% } %>
|
<% } %>
|
||||||
<script src="../<%= appPath %>/share.js"></script>
|
<script src="<%= appPath %>/share.js"></script>
|
||||||
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||||
<link href="../<%= assetPath %>/stylesheets/share.css" rel="stylesheet">
|
<link href="<%= assetPath %>/stylesheets/share.css" rel="stylesheet">
|
||||||
<% } %>
|
<% } %>
|
||||||
<% 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">
|
||||||
<% } %>
|
<% } %>
|
||||||
<% 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">
|
||||||
|
@ -14,7 +14,7 @@ import log from "../services/log.js";
|
|||||||
import type SNote from "./shaca/entities/snote.js";
|
import type SNote from "./shaca/entities/snote.js";
|
||||||
import type SBranch from "./shaca/entities/sbranch.js";
|
import type SBranch from "./shaca/entities/sbranch.js";
|
||||||
import type SAttachment from "./shaca/entities/sattachment.js";
|
import type SAttachment from "./shaca/entities/sattachment.js";
|
||||||
import utils, { safeExtractMessageAndStackFromError } from "../services/utils.js";
|
import utils, { isDev, safeExtractMessageAndStackFromError } from "../services/utils.js";
|
||||||
import options from "../services/options.js";
|
import options from "../services/options.js";
|
||||||
|
|
||||||
function getSharedSubTreeRoot(note: SNote): { note?: SNote; branch?: SBranch } {
|
function getSharedSubTreeRoot(note: SNote): { note?: SNote; branch?: SBranch } {
|
||||||
@ -159,7 +159,16 @@ function register(router: Router) {
|
|||||||
const { header, content, isEmpty } = contentRenderer.getContent(note);
|
const { header, content, isEmpty } = contentRenderer.getContent(note);
|
||||||
const subRoot = getSharedSubTreeRoot(note);
|
const subRoot = getSharedSubTreeRoot(note);
|
||||||
const showLoginInShareTheme = options.getOption("showLoginInShareTheme");
|
const showLoginInShareTheme = options.getOption("showLoginInShareTheme");
|
||||||
const opts = { note, header, content, isEmpty, subRoot, assetPath, appPath, showLoginInShareTheme };
|
const opts = {
|
||||||
|
note,
|
||||||
|
header,
|
||||||
|
content,
|
||||||
|
isEmpty,
|
||||||
|
subRoot,
|
||||||
|
assetPath: isDev ? assetPath : `../${assetPath}`,
|
||||||
|
appPath: isDev ? appPath : `../${appPath}`,
|
||||||
|
showLoginInShareTheme
|
||||||
|
};
|
||||||
let useDefaultView = true;
|
let useDefaultView = true;
|
||||||
|
|
||||||
// Check if the user has their own template
|
// Check if the user has their own template
|
||||||
|
Loading…
x
Reference in New Issue
Block a user