mirror of
https://github.com/zadam/trilium.git
synced 2025-12-18 05:14:24 +01:00
fix(share): 404 not rendering in dev mode
This commit is contained in:
parent
496091677b
commit
4f103375b5
@ -205,7 +205,7 @@ function renderNoteContentInternal(note: SNote | BNote, renderArgs: RenderArgs)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDefaultTemplatePath(template: string) {
|
export function getDefaultTemplatePath(template: string) {
|
||||||
// Path is relative to apps/server/dist/assets/views
|
// Path is relative to apps/server/dist/assets/views
|
||||||
return process.env.NODE_ENV === "development"
|
return process.env.NODE_ENV === "development"
|
||||||
? join(__dirname, `../../../../packages/share-theme/src/templates/${template}.ejs`)
|
? join(__dirname, `../../../../packages/share-theme/src/templates/${template}.ejs`)
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import searchService from "../services/search/services/search.js";
|
|||||||
import SearchContext from "../services/search/search_context.js";
|
import SearchContext from "../services/search/search_context.js";
|
||||||
import type SNote from "./shaca/entities/snote.js";
|
import type SNote from "./shaca/entities/snote.js";
|
||||||
import type SAttachment from "./shaca/entities/sattachment.js";
|
import type SAttachment from "./shaca/entities/sattachment.js";
|
||||||
import { renderNoteContent } from "./content_renderer.js";
|
import { getDefaultTemplatePath, renderNoteContent } from "./content_renderer.js";
|
||||||
import utils from "../services/utils.js";
|
import utils from "../services/utils.js";
|
||||||
|
|
||||||
function addNoIndexHeader(note: SNote, res: Response) {
|
function addNoIndexHeader(note: SNote, res: Response) {
|
||||||
@ -110,7 +110,7 @@ function renderImageAttachment(image: SNote, res: Response, attachmentName: stri
|
|||||||
|
|
||||||
function render404(res: Response) {
|
function render404(res: Response) {
|
||||||
res.status(404);
|
res.status(404);
|
||||||
const shareThemePath = `../../share-theme/templates/404.ejs`;
|
const shareThemePath = getDefaultTemplatePath("404");
|
||||||
res.render(shareThemePath);
|
res.render(shareThemePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user