mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 00:05:50 +01:00
added #shareRaw label
This commit is contained in:
@@ -215,6 +215,7 @@ const ATTR_HELP = {
|
||||
"shareAlias": "define an alias using which the note will be available under https://your_trilium_host/share/[your_alias]",
|
||||
"shareOmitDefaultCss": "default share page CSS will be omitted. Use when you make extensive styling changes.",
|
||||
"shareRoot": "marks note which is served on /share root.",
|
||||
"shareRaw": "note will be served in its raw format, without HTML wrapper",
|
||||
"displayRelations": "comma delimited names of relations which should be displayed. All other ones will be hidden.",
|
||||
"hideRelations": "comma delimited names of relations which should be hidden. All other ones will be displayed.",
|
||||
},
|
||||
|
||||
@@ -46,6 +46,7 @@ module.exports = [
|
||||
{ type: 'label', name: 'shareAlias' },
|
||||
{ type: 'label', name: 'shareOmitDefaultCss' },
|
||||
{ type: 'label', name: 'shareRoot' },
|
||||
{ type: 'label', name: 'shareRaw' },
|
||||
{ type: 'label', name: 'displayRelations' },
|
||||
{ type: 'label', name: 'hideRelations' },
|
||||
|
||||
|
||||
@@ -23,6 +23,13 @@ function getSharedSubTreeRoot(note) {
|
||||
function register(router) {
|
||||
function renderNote(note, res) {
|
||||
if (note) {
|
||||
if (note.hasLabel('shareRaw')) {
|
||||
res.setHeader('Content-Type', note.mime);
|
||||
|
||||
res.send(note.getContent());
|
||||
return;
|
||||
}
|
||||
|
||||
const {header, content, isEmpty} = contentRenderer.getContent(note);
|
||||
|
||||
const subRoot = getSharedSubTreeRoot(note);
|
||||
|
||||
Reference in New Issue
Block a user