Skip to content

Build your personal knowledge base with Trilium Notes

Add new attributes in appropriate locations

Zack Rauend259931bd24f
diff --git a/bin/tpl/anonymize-database.sql b/bin/tpl/anonymize-database.sql
index 3e8279eeb6..231be94b1b 100644
--- a/bin/tpl/anonymize-database.sql
+++ b/bin/tpl/anonymize-database.sql
@@ -47,6 +47,7 @@ UPDATE attributes SET name = 'name', value = 'value'
'top',
'fullContentWidth',
'shareHiddenFromTree',
+ 'shareExternalLink',
'shareAlias',
'shareOmitDefaultCss',
'shareRoot',
@@ -67,6 +68,7 @@ UPDATE attributes SET name = 'name', value = 'value'
'renderNote',
'shareCss',
'shareJs',
+ 'shareTemplate',
'shareFavicon',
'executeButton',
'keepCurrentHoisting',
@@ -122,6 +124,7 @@ UPDATE attributes SET name = 'name'
'top',
'fullContentWidth',
'shareHiddenFromTree',
+ 'shareExternalLink',
'shareAlias',
'shareOmitDefaultCss',
'shareRoot',
@@ -142,6 +145,7 @@ UPDATE attributes SET name = 'name'
'renderNote',
'shareCss',
'shareJs',
+ 'shareTemplate',
'shareFavicon',
'executeButton',
'keepCurrentHoisting',
diff --git a/src/public/app/widgets/attribute_widgets/attribute_detail.js b/src/public/app/widgets/attribute_widgets/attribute_detail.js
index 715d3f093f..db209e168a 100644
--- a/src/public/app/widgets/attribute_widgets/attribute_detail.js
+++ b/src/public/app/widgets/attribute_widgets/attribute_detail.js
@@ -225,6 +225,7 @@ const ATTR_HELP = {
"sqlConsoleHome": "default location of SQL console notes",
"bookmarkFolder": "note with this label will appear in bookmarks as folder (allowing access to its children)",
"shareHiddenFromTree": "this note is hidden from left navigation tree, but still accessible with its URL",
+ "shareExternalLink": "note will act as a link to an external website in the share tree",
"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.",
@@ -271,6 +272,7 @@ const ATTR_HELP = {
"widget": "target of this relation will be executed and rendered as a widget in the sidebar",
"shareCss": "CSS note which will be injected into the share page. CSS note must be in the shared sub-tree as well. Consider using 'shareHiddenFromTree' and 'shareOmitDefaultCss' as well.",
"shareJs": "JavaScript note which will be injected into the share page. JS note must be in the shared sub-tree as well. Consider using 'shareHiddenFromTree'.",
+ "shareTemplate": "Embedded JavaScript note that will be used as the template for displaying the shared note. Falls back to the default template. Consider using 'shareHiddenFromTree'.",
"shareFavicon": "Favicon note to be set in the shared page. Typically you want to set it to share root and make it inheritable. Favicon note must be in the shared sub-tree as well. Consider using 'shareHiddenFromTree'.",
}
};
diff --git a/src/services/builtin_attributes.js b/src/services/builtin_attributes.js
index 5083f3dc76..0c2fa5f0ce 100644
--- a/src/services/builtin_attributes.js
+++ b/src/services/builtin_attributes.js
@@ -48,6 +48,7 @@ module.exports = [
{ type: 'label', name: 'bottom' },
{ type: 'label', name: 'fullContentWidth' },
{ type: 'label', name: 'shareHiddenFromTree' },
+ { type: 'label', name: 'shareExternalLink' },
{ type: 'label', name: 'shareAlias' },
{ type: 'label', name: 'shareOmitDefaultCss' },
{ type: 'label', name: 'shareRoot' },
@@ -89,5 +90,6 @@ module.exports = [
{ type: 'relation', name: 'renderNote', isDangerous: true },
{ type: 'relation', name: 'shareCss' },
{ type: 'relation', name: 'shareJs' },
+ { type: 'relation', name: 'shareTemplate' },
{ type: 'relation', name: 'shareFavicon' },
];