Merge branch 'develop' of https://github.com/jshprentz/TriliumNextNotes into develop
@ -1,7 +1,2 @@
|
|||||||
_regroup
|
_regroup
|
||||||
_regroup_monorepo
|
_regroup_monorepo
|
||||||
|
|
||||||
# Asset copying respects .gitignore / .nxignore for some reason.
|
|
||||||
# See https://github.com/nrwl/nx/issues/20309
|
|
||||||
!dist
|
|
||||||
!node_modules
|
|
||||||
@ -1,204 +0,0 @@
|
|||||||
// Source: https://github.com/codemirror/codemirror5/pull/7080/files
|
|
||||||
|
|
||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
||||||
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
||||||
|
|
||||||
(function (mod) {
|
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
||||||
mod(require("../../lib/codemirror"));
|
|
||||||
else if (typeof define == "function" && define.amd) // AMD
|
|
||||||
define(["../../lib/codemirror"], mod);
|
|
||||||
else // Plain browser env
|
|
||||||
mod(CodeMirror);
|
|
||||||
})(function (CodeMirror) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
CodeMirror.defineMode("hcl", function (config) {
|
|
||||||
var indentUnit = config.indentUnit;
|
|
||||||
|
|
||||||
var keywords = {
|
|
||||||
"resource": true,
|
|
||||||
"variable": true,
|
|
||||||
"output": true,
|
|
||||||
"module": true,
|
|
||||||
"provider": true,
|
|
||||||
"data": true,
|
|
||||||
"locals": true,
|
|
||||||
"terraform": true,
|
|
||||||
"if": true,
|
|
||||||
"else": true,
|
|
||||||
"for": true,
|
|
||||||
"foreach": true,
|
|
||||||
"in": true,
|
|
||||||
"true": true,
|
|
||||||
"false": true,
|
|
||||||
"null": true,
|
|
||||||
};
|
|
||||||
|
|
||||||
var atoms = {
|
|
||||||
"true": true,
|
|
||||||
"false": true,
|
|
||||||
"null": true,
|
|
||||||
};
|
|
||||||
|
|
||||||
var isOperatorChar = /[+\-*&^%:=<>!|\/]/;
|
|
||||||
|
|
||||||
var curPunc;
|
|
||||||
|
|
||||||
function tokenBase(stream, state) {
|
|
||||||
var ch = stream.next();
|
|
||||||
if (ch == '"' || ch == "'" || ch == "`") {
|
|
||||||
state.tokenize = tokenString(ch);
|
|
||||||
return state.tokenize(stream, state);
|
|
||||||
}
|
|
||||||
if (/[\d\.]/.test(ch)) {
|
|
||||||
if (ch == ".") {
|
|
||||||
stream.match(/^[0-9_]+([eE][\-+]?[0-9_]+)?/);
|
|
||||||
} else {
|
|
||||||
stream.match(/^[0-9_]*\.?[0-9_]*([eE][\-+]?[0-9_]+)?/);
|
|
||||||
}
|
|
||||||
return "number";
|
|
||||||
}
|
|
||||||
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
|
||||||
curPunc = ch;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (ch == "/") {
|
|
||||||
if (stream.eat("*")) {
|
|
||||||
state.tokenize = tokenComment;
|
|
||||||
return tokenComment(stream, state);
|
|
||||||
}
|
|
||||||
if (stream.eat("/")) {
|
|
||||||
stream.skipToEnd();
|
|
||||||
return "comment";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isOperatorChar.test(ch)) {
|
|
||||||
stream.eatWhile(isOperatorChar);
|
|
||||||
return "operator";
|
|
||||||
}
|
|
||||||
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
|
||||||
var cur = stream.current();
|
|
||||||
if (keywords.propertyIsEnumerable(cur)) {
|
|
||||||
return "keyword";
|
|
||||||
}
|
|
||||||
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
|
||||||
return "variable";
|
|
||||||
}
|
|
||||||
|
|
||||||
function tokenString(quote) {
|
|
||||||
return function (stream, state) {
|
|
||||||
var escaped = false,
|
|
||||||
next,
|
|
||||||
end = false;
|
|
||||||
while ((next = stream.next()) != null) {
|
|
||||||
if (next == quote && !escaped) {
|
|
||||||
end = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
escaped = !escaped && quote != "`" && next == "\\";
|
|
||||||
}
|
|
||||||
if (end || !(escaped || quote == "`"))
|
|
||||||
state.tokenize = tokenBase;
|
|
||||||
return "string";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function tokenComment(stream, state) {
|
|
||||||
var maybeEnd = false,
|
|
||||||
ch;
|
|
||||||
while (ch = stream.next()) {
|
|
||||||
if (ch == "/" && maybeEnd) {
|
|
||||||
state.tokenize = tokenBase;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
maybeEnd = (ch == "*");
|
|
||||||
}
|
|
||||||
return "comment";
|
|
||||||
}
|
|
||||||
|
|
||||||
function Context(indented, column, type, align, prev) {
|
|
||||||
this.indented = indented;
|
|
||||||
this.column = column;
|
|
||||||
this.type = type;
|
|
||||||
this.align = align;
|
|
||||||
this.prev = prev;
|
|
||||||
}
|
|
||||||
function pushContext(state, col, type) {
|
|
||||||
return state.context = new Context(state.indented, col, type, null, state.context);
|
|
||||||
}
|
|
||||||
function popContext(state) {
|
|
||||||
if (!state.context.prev) return;
|
|
||||||
var t = state.context.type;
|
|
||||||
if (t == ")" || t == "]" || t == "}")
|
|
||||||
state.indented = state.context.indented;
|
|
||||||
return state.context = state.context.prev;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interface
|
|
||||||
|
|
||||||
return {
|
|
||||||
startState: function (basecolumn) {
|
|
||||||
return {
|
|
||||||
tokenize: null,
|
|
||||||
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
|
||||||
indented: 0,
|
|
||||||
startOfLine: true
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
token: function (stream, state) {
|
|
||||||
var ctx = state.context;
|
|
||||||
if (stream.sol()) {
|
|
||||||
if (ctx.align == null) ctx.align = false;
|
|
||||||
state.indented = stream.indentation();
|
|
||||||
state.startOfLine = true;
|
|
||||||
}
|
|
||||||
if (stream.eatSpace()) return null;
|
|
||||||
curPunc = null;
|
|
||||||
var style = (state.tokenize || tokenBase)(stream, state);
|
|
||||||
if (style == "comment") return style;
|
|
||||||
if (ctx.align == null) ctx.align = true;
|
|
||||||
|
|
||||||
if (curPunc == "{") pushContext(state, stream.column(), "}");
|
|
||||||
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
|
||||||
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
|
||||||
else if (curPunc == "}" && ctx.type == "}") popContext(state);
|
|
||||||
else if (curPunc == ctx.type) popContext(state);
|
|
||||||
state.startOfLine = false;
|
|
||||||
return style;
|
|
||||||
},
|
|
||||||
|
|
||||||
indent: function (state, textAfter) {
|
|
||||||
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
|
|
||||||
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
|
||||||
if (firstChar == "#" || firstChar == ";") return 0;
|
|
||||||
if (stream.sol()) {
|
|
||||||
if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) {
|
|
||||||
state.context.type = "}";
|
|
||||||
return ctx.indented;
|
|
||||||
}
|
|
||||||
var closing = firstChar == ctx.type;
|
|
||||||
if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
|
||||||
else return ctx.indented + (closing ? 0 : indentUnit);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
electricChars: "{}):",
|
|
||||||
closeBrackets: "()[]{}''\"\"``",
|
|
||||||
fold: "brace",
|
|
||||||
blockCommentStart: "/*",
|
|
||||||
blockCommentEnd: "*/",
|
|
||||||
lineComment: "//"
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
CodeMirror.defineMIME("text/x-hcl", "hcl");
|
|
||||||
CodeMirror.modeInfo.push({
|
|
||||||
ext: [ "hcl " ],
|
|
||||||
mime: "text/x-hcl",
|
|
||||||
mode: "hcl",
|
|
||||||
name: "Terraform (HCL)"
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
import { globSync } from "fs";
|
||||||
|
import { join } from "path";
|
||||||
|
import { it, describe, expect } from "vitest";
|
||||||
|
|
||||||
|
describe("Check artifacts are present", () => {
|
||||||
|
const distPath = join(__dirname, "../../dist");
|
||||||
|
|
||||||
|
it("has the necessary node modules", async () => {
|
||||||
|
const paths = [
|
||||||
|
"node_modules/better-sqlite3",
|
||||||
|
"node_modules/bindings",
|
||||||
|
"node_modules/file-uri-to-path"
|
||||||
|
];
|
||||||
|
|
||||||
|
ensurePathsExist(paths);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("includes the client", async () => {
|
||||||
|
const paths = [
|
||||||
|
"public/assets",
|
||||||
|
"public/fonts",
|
||||||
|
"public/node_modules",
|
||||||
|
"public/src",
|
||||||
|
"public/stylesheets",
|
||||||
|
"public/translations"
|
||||||
|
];
|
||||||
|
|
||||||
|
ensurePathsExist(paths);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("includes necessary assets", async () => {
|
||||||
|
const paths = [
|
||||||
|
"assets",
|
||||||
|
"share-theme"
|
||||||
|
];
|
||||||
|
|
||||||
|
ensurePathsExist(paths);
|
||||||
|
});
|
||||||
|
|
||||||
|
function ensurePathsExist(paths: string[]) {
|
||||||
|
for (const path of paths) {
|
||||||
|
const result = globSync(join(distPath, path, "**"));
|
||||||
|
expect(result, path).not.toHaveLength(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
520
apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Sharing.html
generated
vendored
@ -1,192 +1,346 @@
|
|||||||
<p>Trilium allows you to share selected notes as <strong>publicly accessible</strong> read-only
|
<p>Trilium allows you to share selected notes as <strong>publicly accessible</strong> read-only
|
||||||
documents. This feature is particularly useful for publishing content directly
|
documents. This feature is particularly useful for publishing content directly
|
||||||
from your Trilium notes, making it accessible to others online.</p>
|
from your Trilium notes, making it accessible to others online.</p>
|
||||||
<h2>Prerequisites</h2>
|
<figure
|
||||||
<p>To use the sharing feature, you must have a <a class="reference-link"
|
class="image">
|
||||||
href="#root/_help_WOcw2SLH6tbX">Server Installation</a> of Trilium.
|
<img style="aspect-ratio:1144/660;" src="Sharing_image.png" width="1144"
|
||||||
This is necessary because the notes will be hosted from the server.</p>
|
height="660">
|
||||||
<h2>How to Share a Note</h2>
|
</figure>
|
||||||
<ol>
|
<h2>Features, interaction and limitations</h2>
|
||||||
<li>
|
<ul>
|
||||||
<p><strong>Enable Sharing</strong>: To share a note, toggle the <code>Shared</code> switch
|
<li>Searching by note title.</li>
|
||||||
within the note's interface. Once sharing is enabled, an URL will appear,
|
<li>Automatic dark/light mode based on the user's browser settings.</li>
|
||||||
which you can click to access the shared note.</p>
|
<li>Mobile-friendly layout, with sidebar.</li>
|
||||||
<p>
|
<li>Collapsible tree with the same note icons as the application.</li>
|
||||||
<img src="Sharing_share-single-note.png" alt="Share Note">
|
<li>Customizable logo.</li>
|
||||||
</p>
|
<li>Toggle button for dark/light mode, which also stores the user preferences.</li>
|
||||||
</li>
|
<li>Quick navigation buttons (previous and next note).</li>
|
||||||
<li>
|
<li>Displaying the date of the last update of the note.</li>
|
||||||
<p><strong>Access the Shared Note</strong>: The link provided will open the
|
</ul>
|
||||||
|
<h3>By note type</h3>
|
||||||
|
<figure class="table" style="width:100%;">
|
||||||
|
<table class="ck-table-resized">
|
||||||
|
<colgroup>
|
||||||
|
<col style="width:19.92%;">
|
||||||
|
<col style="width:41.66%;">
|
||||||
|
<col style="width:38.42%;">
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th> </th>
|
||||||
|
<th>Supported features</th>
|
||||||
|
<th>Limitations</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iPIMuisry3hd">Text</a>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>Table of contents.</li>
|
||||||
|
<li>Syntax highlight of code blocks, provided a language is selected (does
|
||||||
|
not work if “Auto-detected” is enabled).</li>
|
||||||
|
<li>Rendering for math equations.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>Including notes is not supported.</li>
|
||||||
|
<li>Inline Mermaid diagrams are not rendered.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_6f9hih2hXXZk">Code</a>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>Basic support (displaying the contents of the note in a monospace font).</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>No syntax highlight.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_m523cpzocqaD">Saved Search</a>
|
||||||
|
</th>
|
||||||
|
<td colspan="2">Not supported.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_iRwzGnHPzonm">Relation Map</a>
|
||||||
|
</th>
|
||||||
|
<td colspan="2">Not supported.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_bdUJEHsAPYQR">Note Map</a>
|
||||||
|
</th>
|
||||||
|
<td colspan="2">Not supported.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_HcABDtFCkbFN">Render Note</a>
|
||||||
|
</th>
|
||||||
|
<td colspan="2">Not supported.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_GTwFsgaA0lCt">Book</a>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>The child notes are displayed in a fixed format. </li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>More advanced view types such as the calendar view are not supported.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_s1aBHPd79XYj">Mermaid Diagrams</a>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>The diagram is displayed as a vector image.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>No further interaction supported.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_grjYqerjn243">Canvas</a>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>The diagram is displayed as a vector image.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>No further interaction supported.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_1vHRoWCEjj0L">Web View</a>
|
||||||
|
</th>
|
||||||
|
<td colspan="2">Not supported.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_gBbsAeiuUxI5">Mind Map</a>
|
||||||
|
</th>
|
||||||
|
<td>The diagram is displayed as a vector image.</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>No further interaction supported.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_81SGnPGMk7Xc">Geo Map</a>
|
||||||
|
</th>
|
||||||
|
<td colspan="2">Not supported.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a class="reference-link" href="#root/pOsGYCXsbNQG/KSZ04uQ2D1St/_help_W8vYD3Q1zjCR">File</a>
|
||||||
|
</th>
|
||||||
|
<td>Basic interaction (downloading the file).</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<li>No further interaction supported.</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</figure>
|
||||||
|
<p>While the sharing feature is powerful, it has some limitations:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Code Notes</strong>: No syntax highlighting.</li>
|
||||||
|
<li><strong>Static Note Tree</strong>
|
||||||
|
</li>
|
||||||
|
<li><strong>Protected Notes</strong>: Cannot be shared.</li>
|
||||||
|
<li><strong>Include Notes</strong>: Not supported.</li>
|
||||||
|
</ul>
|
||||||
|
<p>Some of these limitations may be addressed in future updates.</p>
|
||||||
|
<h2>Prerequisites</h2>
|
||||||
|
<p>To use the sharing feature, you must have a <a class="reference-link"
|
||||||
|
href="#root/_help_WOcw2SLH6tbX">Server Installation</a> of Trilium.
|
||||||
|
This is necessary because the notes will be hosted from the server.</p>
|
||||||
|
<h2>How to Share a Note</h2>
|
||||||
|
<ol>
|
||||||
|
<li>
|
||||||
|
<p><strong>Enable Sharing</strong>: To share a note, toggle the <code>Shared</code> switch
|
||||||
|
within the note's interface. Once sharing is enabled, an URL will appear,
|
||||||
|
which you can click to access the shared note.</p>
|
||||||
|
<p>
|
||||||
|
<img src="Sharing_share-single-note.png" alt="Share Note">
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
<li><strong>Access the Shared Note</strong>: The link provided will open the
|
||||||
note in your browser. If your server is not configured with a public IP,
|
note in your browser. If your server is not configured with a public IP,
|
||||||
the URL will refer to <code>localhost (127.0.0.1)</code>.</p>
|
the URL will refer to <code>localhost (127.0.0.1)</code>.</li>
|
||||||
<p>
|
</ol>
|
||||||
<img src="Sharing_share-single-note-.png" alt="Shared Note Example">
|
<h2>Sharing a Note Subtree</h2>
|
||||||
</p>
|
<p>When you share a note, you actually share the entire subtree of notes
|
||||||
</li>
|
beneath it. If the note has child notes, they will also be included in
|
||||||
</ol>
|
the shared content. For example, sharing the "Formatting" subtree will
|
||||||
<h2>Sharing a Note Subtree</h2>
|
display a page with basic navigation for exploring all the notes within
|
||||||
<p>When you share a note, you actually share the entire subtree of notes
|
that subtree.</p>
|
||||||
beneath it. If the note has child notes, they will also be included in
|
<h2>Viewing All Shared Notes</h2>
|
||||||
the shared content. For example, sharing the "Formatting" subtree will
|
<p>You can view a list of all shared notes by clicking on "Show Shared Notes
|
||||||
display a page with basic navigation for exploring all the notes within
|
Subtree." This allows you to manage and navigate through all the notes
|
||||||
that subtree.</p>
|
you have made public.</p>
|
||||||
<p>
|
<h2>Security Considerations</h2>
|
||||||
<img src="Sharing_share-multiple-not.png" alt="Shared Subtree Example">
|
<p>Shared notes are published on the open internet and can be accessed by
|
||||||
</p>
|
anyone with the URL. The URL's randomness does not provide security, so
|
||||||
<h2>Viewing All Shared Notes</h2>
|
it is crucial not to share sensitive information through this feature.</p>
|
||||||
<p>You can view a list of all shared notes by clicking on "Show Shared Notes
|
<h3>Password Protection</h3>
|
||||||
Subtree." This allows you to manage and navigate through all the notes
|
<p>To protect shared notes with a username and password, you can use the <code>#shareCredentials</code> attribute.
|
||||||
you have made public.</p>
|
Add this label to the note with the format <code>#shareCredentials="username:password"</code>.
|
||||||
<h2>Security Considerations</h2>
|
To protect an entire subtree, make sure the label is <a href="#root/_help_bwZpz2ajCEwO">inheritable</a>.</p>
|
||||||
<p>Shared notes are published on the open internet and can be accessed by
|
<h2>Advanced Sharing Options</h2>
|
||||||
anyone with the URL. The URL's randomness does not provide security, so
|
<h3>Customizing the Appearance of Shared Notes</h3>
|
||||||
it is crucial not to share sensitive information through this feature.</p>
|
<p>The default design should be a good starting point, but you can customize
|
||||||
<h3>Password Protection</h3>
|
it using your own CSS:</p>
|
||||||
<p>To protect shared notes with a username and password, you can use the <code>#shareCredentials</code> attribute.
|
<ul>
|
||||||
Add this label to the note with the format <code>#shareCredentials="username:password"</code>.
|
<li><strong>Custom CSS</strong>: Link a CSS <a class="reference-link"
|
||||||
To protect an entire subtree, make sure the label is <a href="#root/_help_bwZpz2ajCEwO">inheritable</a>.</p>
|
href="#root/_help_6f9hih2hXXZk">Code</a> note to the shared page by
|
||||||
<h2>Advanced Sharing Options</h2>
|
adding a <code>~shareCss</code> relation to the note. If you want this style
|
||||||
<h3>Customizing the Appearance of Shared Notes</h3>
|
to apply to the entire subtree, make the label inheritable. You can hide
|
||||||
<p>The default shared page is basic in design, but you can customize it using
|
the CSS code note from the tree navigation by adding the <code>#shareHiddenFromTree</code> label.</li>
|
||||||
your own CSS:</p>
|
<li><strong>Omitting Default CSS</strong>: For extensive styling changes,
|
||||||
<ul>
|
use the <code>#shareOmitDefaultCss</code> label to avoid conflicts with Trilium's
|
||||||
<li><strong>Custom CSS</strong>: Link a CSS <a class="reference-link"
|
<a
|
||||||
href="#root/_help_6f9hih2hXXZk">Code</a> note to the shared page by
|
href="#root/_help_Wy267RK4M69c">default stylesheet</a>.</li>
|
||||||
adding a <code>~shareCss</code> relation to the note. If you want this style
|
</ul>
|
||||||
to apply to the entire subtree, make the label inheritable. You can hide
|
<h3>Adding JavaScript</h3>
|
||||||
the CSS code note from the tree navigation by adding the <code>#shareHiddenFromTree</code> label.</li>
|
<p>You can inject custom JavaScript into the shared note using the <code>~shareJs</code> relation.
|
||||||
<li><strong>Omitting Default CSS</strong>: For extensive styling changes,
|
This allows you to access note attributes or traverse the note tree using
|
||||||
use the <code>#shareOmitDefaultCss</code> label to avoid conflicts with Trilium's
|
the <code>fetchNote()</code> API, which retrieves note data based on its
|
||||||
<a
|
ID.</p>
|
||||||
href="#root/_help_Wy267RK4M69c">default stylesheet</a>.</li>
|
<p>Example:</p><pre><code class="language-application-javascript-env-backend">const currentNote = await fetchNote();
|
||||||
</ul>
|
|
||||||
<h3>Adding JavaScript</h3>
|
|
||||||
<p>You can inject custom JavaScript into the shared note using the <code>~shareJs</code> relation.
|
|
||||||
This allows you to access note attributes or traverse the note tree using
|
|
||||||
the <code>fetchNote()</code> API, which retrieves note data based on its
|
|
||||||
ID.</p>
|
|
||||||
<p>Example:</p><pre><code class="language-application-javascript-env-backend">const currentNote = await fetchNote();
|
|
||||||
const parentNote = await fetchNote(currentNote.parentNoteIds[0]);
|
const parentNote = await fetchNote(currentNote.parentNoteIds[0]);
|
||||||
|
|
||||||
for (const attr of parentNote.attributes) {
|
for (const attr of parentNote.attributes) {
|
||||||
console.log(attr.type, attr.name, attr.value);
|
console.log(attr.type, attr.name, attr.value);
|
||||||
}</code></pre>
|
}</code></pre>
|
||||||
<h3>Creating Human-Readable URL Aliases</h3>
|
<h3>Creating Human-Readable URL Aliases</h3>
|
||||||
<p>Shared notes typically have URLs like <code>http://domain.tld/share/knvU8aJy4dJ7</code>,
|
<p>Shared notes typically have URLs like <code>http://domain.tld/share/knvU8aJy4dJ7</code>,
|
||||||
where the last part is the note's ID. You can make these URLs more user-friendly
|
where the last part is the note's ID. You can make these URLs more user-friendly
|
||||||
by adding the <code>#shareAlias</code> label to individual notes (e.g., <code>#shareAlias=highlighting</code>).
|
by adding the <code>#shareAlias</code> label to individual notes (e.g., <code>#shareAlias=highlighting</code>).
|
||||||
This will change the URL to <code>http://domain.tld/share/highlighting</code>.</p>
|
This will change the URL to <code>http://domain.tld/share/highlighting</code>.</p>
|
||||||
<p><strong>Important</strong>:</p>
|
<p><strong>Important</strong>:</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Ensure that aliases are unique.</li>
|
<li>Ensure that aliases are unique.</li>
|
||||||
<li>Using slashes (<code>/</code>) within aliases to create subpaths is not
|
<li>Using slashes (<code>/</code>) within aliases to create subpaths is not
|
||||||
supported.</li>
|
supported.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<h3>Viewing and Managing Shared Notes</h3>
|
<h3>Viewing and Managing Shared Notes</h3>
|
||||||
<p>All shared notes are grouped under an automatically managed "Shared Notes"
|
<p>All shared notes are grouped under an automatically managed "Shared Notes"
|
||||||
section. From here, you can view, share, or unshare notes by moving or
|
section. From here, you can view, share, or unshare notes by moving or
|
||||||
cloning them within this section.</p>
|
cloning them within this section.</p>
|
||||||
<p>
|
<p>
|
||||||
<img src="Sharing_shared-list.png" alt="Shared Notes List">
|
<img src="Sharing_shared-list.png" alt="Shared Notes List">
|
||||||
</p>
|
</p>
|
||||||
<h3>Setting a Custom Favicon</h3>
|
<h3>Setting a Custom Favicon</h3>
|
||||||
<p>To customize the favicon for your shared pages, create a relation <code>~shareFavicon</code> pointing
|
<p>To customize the favicon for your shared pages, create a relation <code>~shareFavicon</code> pointing
|
||||||
to a file note containing the favicon (e.g., in <code>.ico</code> format).</p>
|
to a file note containing the favicon (e.g., in <code>.ico</code> format).</p>
|
||||||
<h3>Sharing a Note as the Root</h3>
|
<h3>Sharing a Note as the Root</h3>
|
||||||
<p>You can designate a specific note or folder as the root of your shared
|
<p>You can designate a specific note or folder as the root of your shared
|
||||||
content by adding the <code>#shareRoot</code> label. This note will be linked
|
content by adding the <code>#shareRoot</code> label. This note will be linked
|
||||||
when visiting <code>[http://domain.tld/share](http://domain/share)</code>,
|
when visiting <code>[http://domain.tld/share](http://domain/share)</code>,
|
||||||
making it easier to use Trilium as a fully-fledged website. Consider combining
|
making it easier to use Trilium as a fully-fledged website. Consider combining
|
||||||
this with the <code>#shareIndex</code> label, which will display a list of
|
this with the <code>#shareIndex</code> label, which will display a list of
|
||||||
all shared notes.</p>
|
all shared notes.</p>
|
||||||
<h2>Limitations</h2>
|
<h2>Attribute reference</h2>
|
||||||
<p>While the sharing feature is powerful, it has some limitations:</p>
|
<figure class="table">
|
||||||
<ul>
|
<table>
|
||||||
<li><strong>No Relation Map Support</strong>
|
<thead>
|
||||||
</li>
|
<tr>
|
||||||
<li><strong>Book Notes</strong>: Only show a list of child notes.</li>
|
<th>Attribute</th>
|
||||||
<li><strong>Code Notes</strong>: No syntax highlighting.</li>
|
<th>Description</th>
|
||||||
<li><strong>Static Note Tree</strong>
|
</tr>
|
||||||
</li>
|
</thead>
|
||||||
<li><strong>Protected Notes</strong>: Cannot be shared.</li>
|
<tbody>
|
||||||
<li><strong>Include Notes</strong>: Not supported.</li>
|
<tr>
|
||||||
</ul>
|
<td><code>shareHiddenFromTree</code>
|
||||||
<p>Some of these limitations may be addressed in future updates.</p>
|
</td>
|
||||||
<h2>Attribute reference</h2>
|
<td>this note is hidden from left navigation tree, but still accessible with
|
||||||
<figure class="table">
|
its URL</td>
|
||||||
<table>
|
</tr>
|
||||||
<thead>
|
<tr>
|
||||||
<tr>
|
<td><code>shareExternalLink</code>
|
||||||
<th>Attribute</th>
|
</td>
|
||||||
<th>Description</th>
|
<td>note will act as a link to an external website in the share tree</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
<tr>
|
||||||
<tbody>
|
<td><code>shareAlias</code>
|
||||||
<tr>
|
</td>
|
||||||
<td><code>shareHiddenFromTree</code>
|
<td>define an alias using which the note will be available under <code>https://your_trilium_host/share/[your_alias]</code>
|
||||||
</td>
|
</td>
|
||||||
<td>this note is hidden from left navigation tree, but still accessible with
|
</tr>
|
||||||
its URL</td>
|
<tr>
|
||||||
</tr>
|
<td><code>shareOmitDefaultCss</code>
|
||||||
<tr>
|
</td>
|
||||||
<td><code>shareExternalLink</code>
|
<td>default share page CSS will be omitted. Use when you make extensive styling
|
||||||
</td>
|
changes.</td>
|
||||||
<td>note will act as a link to an external website in the share tree</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<td><code>shareRoot</code>
|
||||||
<td><code>shareAlias</code>
|
</td>
|
||||||
</td>
|
<td>marks note which is served on /share root.</td>
|
||||||
<td>define an alias using which the note will be available under <code>https://your_trilium_host/share/[your_alias]</code>
|
</tr>
|
||||||
</td>
|
<tr>
|
||||||
</tr>
|
<td><code>shareDescription</code>
|
||||||
<tr>
|
</td>
|
||||||
<td><code>shareOmitDefaultCss</code>
|
<td>define text to be added to the HTML meta tag for description</td>
|
||||||
</td>
|
</tr>
|
||||||
<td>default share page CSS will be omitted. Use when you make extensive styling
|
<tr>
|
||||||
changes.</td>
|
<td><code>shareRaw</code>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
<td>Note will be served in its raw format, without HTML wrapper. See also
|
||||||
<td><code>shareRoot</code>
|
<a
|
||||||
</td>
|
class="reference-link" href="#root/_help_Qjt68inQ2bRj">Serving directly the content of a note</a> for an alternative method
|
||||||
<td>marks note which is served on /share root.</td>
|
without setting an attribute.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>shareDescription</code>
|
<td><code>shareDisallowRobotIndexing</code>
|
||||||
</td>
|
</td>
|
||||||
<td>define text to be added to the HTML meta tag for description</td>
|
<td>
|
||||||
</tr>
|
<p>Indicates to web crawlers that the page should not be indexed of this
|
||||||
<tr>
|
note by:</p>
|
||||||
<td><code>shareRaw</code>
|
<ul>
|
||||||
</td>
|
<li>Setting the <code>X-Robots-Tag: noindex</code> HTTP header.</li>
|
||||||
<td>Note will be served in its raw format, without HTML wrapper. See also
|
<li>Setting the <code>noindex, follow</code> meta tag.</li>
|
||||||
<a
|
</ul>
|
||||||
class="reference-link" href="#root/_help_Qjt68inQ2bRj">Serving directly the content of a note</a> for an alternative method
|
</td>
|
||||||
without setting an attribute.</td>
|
</tr>
|
||||||
</tr>
|
<tr>
|
||||||
<tr>
|
<td><code>shareCredentials</code>
|
||||||
<td><code>shareDisallowRobotIndexing</code>
|
</td>
|
||||||
</td>
|
<td>require credentials to access this shared note. Value is expected to be
|
||||||
<td>
|
in format <code>username:password</code>. Don't forget to make this inheritable
|
||||||
<p>Indicates to web crawlers that the page should not be indexed of this
|
to apply to child-notes/images.</td>
|
||||||
note by:</p>
|
</tr>
|
||||||
<ul>
|
<tr>
|
||||||
<li>Setting the <code>X-Robots-Tag: noindex</code> HTTP header.</li>
|
<td><code>shareIndex</code>
|
||||||
<li>Setting the <code>noindex, follow</code> meta tag.</li>
|
</td>
|
||||||
</ul>
|
<td>Note with this label will list all roots of shared notes.</td>
|
||||||
</td>
|
</tr>
|
||||||
</tr>
|
</tbody>
|
||||||
<tr>
|
</table>
|
||||||
<td><code>shareCredentials</code>
|
</figure>
|
||||||
</td>
|
<h2>Credits</h2>
|
||||||
<td>require credentials to access this shared note. Value is expected to be
|
<p>Since v0.95.0, a new theme was introduced (and enabled by default) which
|
||||||
in format <code>username:password</code>. Don't forget to make this inheritable
|
greatly improves the visual aspect of the Share feature, as well as its
|
||||||
to apply to child-notes/images.</td>
|
functionality (such as mobile support, dark/light mode, collapsible tree,
|
||||||
</tr>
|
etc.). This theme is an adaptation of the <a href="https://github.com/zerebos/trilium.rocks">Trilium Rocks!</a> by
|
||||||
<tr>
|
<a
|
||||||
<td><code>shareIndex</code>
|
href="https://github.com/zerebos">zerebos</a>.</p>
|
||||||
</td>
|
|
||||||
<td>Note with this label will list all roots of shared notes.</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</figure>
|
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
BIN
apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Sharing_image.png
generated
vendored
|
After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 68 KiB |
@ -0,0 +1,18 @@
|
|||||||
|
/// <reference types='vitest' />
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
|
export default defineConfig(() => ({
|
||||||
|
root: __dirname,
|
||||||
|
cacheDir: '../../node_modules/.vite/apps/server',
|
||||||
|
plugins: [],
|
||||||
|
test: {
|
||||||
|
watch: false,
|
||||||
|
globals: true,
|
||||||
|
setupFiles: ["./spec/setup.ts"],
|
||||||
|
environment: "node",
|
||||||
|
include: ['spec/build-checks/**'],
|
||||||
|
reporters: [
|
||||||
|
"verbose"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
}));
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
node_modules
|
||||||
|
|
||||||
|
# Output
|
||||||
|
.output
|
||||||
|
.vercel
|
||||||
|
.netlify
|
||||||
|
.wrangler
|
||||||
|
/.svelte-kit
|
||||||
|
/build
|
||||||
|
|
||||||
|
# OS
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Env
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
!.env.test
|
||||||
|
|
||||||
|
# Vite
|
||||||
|
vite.config.js.timestamp-*
|
||||||
|
vite.config.ts.timestamp-*
|
||||||
|
|
||||||
|
# Paraglide
|
||||||
|
src/lib/paraglide
|
||||||
|
|
||||||
|
project.inlang/cache
|
||||||
@ -0,0 +1 @@
|
|||||||
|
engine-strict=true
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
# sv
|
||||||
|
|
||||||
|
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
||||||
|
|
||||||
|
## Creating a project
|
||||||
|
|
||||||
|
If you're seeing this, you've probably already done this step. Congrats!
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# create a new project in the current directory
|
||||||
|
npx sv create
|
||||||
|
|
||||||
|
# create a new project in my-app
|
||||||
|
npx sv create my-app
|
||||||
|
```
|
||||||
|
|
||||||
|
## Developing
|
||||||
|
|
||||||
|
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
|
||||||
|
# or start the server and open the app in a new browser tab
|
||||||
|
npm run dev -- --open
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
To create a production version of your app:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
You can preview the production build with `npm run preview`.
|
||||||
|
|
||||||
|
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
import js from '@eslint/js';
|
||||||
|
import { includeIgnoreFile } from '@eslint/compat';
|
||||||
|
import svelte from 'eslint-plugin-svelte';
|
||||||
|
import globals from 'globals';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import ts from 'typescript-eslint';
|
||||||
|
import svelteConfig from './svelte.config.js';
|
||||||
|
|
||||||
|
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
|
||||||
|
|
||||||
|
export default ts.config(
|
||||||
|
includeIgnoreFile(gitignorePath),
|
||||||
|
js.configs.recommended,
|
||||||
|
...ts.configs.recommended,
|
||||||
|
...svelte.configs.recommended,
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: { ...globals.browser, ...globals.node }
|
||||||
|
},
|
||||||
|
rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
|
||||||
|
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
|
||||||
|
"no-undef": 'off' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: [
|
||||||
|
'**/*.svelte',
|
||||||
|
'**/*.svelte.ts',
|
||||||
|
'**/*.svelte.js'
|
||||||
|
],
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
projectService: true,
|
||||||
|
extraFileExtensions: ['.svelte'],
|
||||||
|
parser: ts.parser,
|
||||||
|
svelteConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://inlang.com/schema/inlang-message-format",
|
||||||
|
"hello_world": "Hello, {name} from en!"
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"name": "website",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.1",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite dev",
|
||||||
|
"build": "vite build",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"prepare": "svelte-kit sync || echo ''",
|
||||||
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
|
"lint": "eslint ."
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint/compat": "^1.2.5",
|
||||||
|
"@eslint/js": "^9.18.0",
|
||||||
|
"@sveltejs/adapter-auto": "^6.0.0",
|
||||||
|
"@sveltejs/kit": "^2.16.0",
|
||||||
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||||
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
|
"@tailwindcss/vite": "^4.0.0",
|
||||||
|
"eslint": "^9.18.0",
|
||||||
|
"eslint-plugin-svelte": "^3.0.0",
|
||||||
|
"globals": "^16.0.0",
|
||||||
|
"mdsvex": "^0.12.3",
|
||||||
|
"svelte": "^5.0.0",
|
||||||
|
"svelte-check": "^4.0.0",
|
||||||
|
"tailwindcss": "^4.0.0",
|
||||||
|
"typescript": "^5.0.0",
|
||||||
|
"typescript-eslint": "^8.20.0",
|
||||||
|
"vite": "^6.2.6"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@inlang/paraglide-js": "^2.0.0"
|
||||||
|
},
|
||||||
|
"nx": {
|
||||||
|
"typecheck": {
|
||||||
|
"dependsOn": [
|
||||||
|
"build"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
dv1iXGpHP2mMvuQQo4
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://inlang.com/schema/project-settings",
|
||||||
|
"modules": [
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@4/dist/index.js",
|
||||||
|
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@2/dist/index.js"
|
||||||
|
],
|
||||||
|
"plugin.inlang.messageFormat": {
|
||||||
|
"pathPattern": "./messages/{locale}.json"
|
||||||
|
},
|
||||||
|
"baseLocale": "en",
|
||||||
|
"locales": [
|
||||||
|
"en"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
@import 'tailwindcss';
|
||||||
|
@plugin '@tailwindcss/typography';
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
// See https://svelte.dev/docs/kit/types#app.d.ts
|
||||||
|
// for information about these interfaces
|
||||||
|
declare global {
|
||||||
|
namespace App {
|
||||||
|
// interface Error {}
|
||||||
|
// interface Locals {}
|
||||||
|
// interface PageData {}
|
||||||
|
// interface PageState {}
|
||||||
|
// interface Platform {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {};
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="%paraglide.lang%">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
%sveltekit.head%
|
||||||
|
</head>
|
||||||
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
import type { Handle } from '@sveltejs/kit';
|
||||||
|
import { paraglideMiddleware } from '$lib/paraglide/server';
|
||||||
|
|
||||||
|
const handleParaglide: Handle = ({ event, resolve }) => paraglideMiddleware(event.request, ({ request, locale }) => {
|
||||||
|
event.request = request;
|
||||||
|
|
||||||
|
return resolve(event, {
|
||||||
|
transformPageChunk: ({ html }) => html.replace('%paraglide.lang%', locale)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
export const handle: Handle = handleParaglide;
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import { deLocalizeUrl } from '$lib/paraglide/runtime';
|
||||||
|
|
||||||
|
export const reroute = (request: {
|
||||||
|
url: URL;
|
||||||
|
fetch: typeof fetch;
|
||||||
|
}) => deLocalizeUrl(request.url).pathname;
|
||||||
@ -0,0 +1,174 @@
|
|||||||
|
import rootPackageJson from '../../../../package.json';
|
||||||
|
|
||||||
|
export type App = "desktop" | "server";
|
||||||
|
|
||||||
|
export type Architecture = 'x64' | 'arm64';
|
||||||
|
|
||||||
|
export type Platform = "macos" | "windows" | "linux" | "pikapod";
|
||||||
|
|
||||||
|
const version = rootPackageJson.version;
|
||||||
|
|
||||||
|
export interface DownloadInfo {
|
||||||
|
recommended?: boolean;
|
||||||
|
name: string;
|
||||||
|
url?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DownloadMatrixEntry {
|
||||||
|
title: Record<Architecture, string> | string;
|
||||||
|
description: Record<Architecture, string> | string;
|
||||||
|
downloads: Record<string, DownloadInfo>;
|
||||||
|
}
|
||||||
|
|
||||||
|
type DownloadMatrix = Record<App, { [ P in Platform ]?: DownloadMatrixEntry }>;
|
||||||
|
|
||||||
|
// Keep compatibility info inline with https://github.com/electron/electron/blob/main/README.md#platform-support.
|
||||||
|
export const downloadMatrix: DownloadMatrix = {
|
||||||
|
desktop: {
|
||||||
|
windows: {
|
||||||
|
title: {
|
||||||
|
x64: "Windows 64-bit",
|
||||||
|
arm64: "Windows on ARM"
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
x64: "Compatible with Intel or AMD devices running Windows 10 and 11.",
|
||||||
|
arm64: "Compatible with ARM devices (e.g. with Qualcomm Snapdragon).",
|
||||||
|
},
|
||||||
|
downloads: {
|
||||||
|
exe: {
|
||||||
|
recommended: true,
|
||||||
|
name: "Download Installer (.exe)"
|
||||||
|
},
|
||||||
|
zip: {
|
||||||
|
name: "Portable (.zip)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
linux: {
|
||||||
|
title: {
|
||||||
|
x64: "Linux 64-bit",
|
||||||
|
arm64: "Linux on ARM"
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
x64: "For most Linux distributions, compatible with x86_64 architecture.",
|
||||||
|
arm64: "For ARM-based Linux distributions, compatible with aarch64 architecture.",
|
||||||
|
},
|
||||||
|
downloads: {
|
||||||
|
deb: {
|
||||||
|
recommended: true,
|
||||||
|
name: "Download .deb"
|
||||||
|
},
|
||||||
|
rpm: {
|
||||||
|
name: ".rpm"
|
||||||
|
},
|
||||||
|
flatpak: {
|
||||||
|
name: ".flatpak"
|
||||||
|
},
|
||||||
|
zip: {
|
||||||
|
name: "Portable (.zip)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
macos: {
|
||||||
|
title: {
|
||||||
|
x64: "macOS for Intel",
|
||||||
|
arm64: "macOS for Apple Silicon"
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
x64: "For Intel-based Macs running macOS Big Sur or later.",
|
||||||
|
arm64: "For Apple Silicon Macs such as those with M1 and M2 chips.",
|
||||||
|
},
|
||||||
|
downloads: {
|
||||||
|
dmg: {
|
||||||
|
recommended: true,
|
||||||
|
name: "Download Installer (.dmg)"
|
||||||
|
},
|
||||||
|
zip: {
|
||||||
|
name: "Portable (.zip)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
linux: {
|
||||||
|
title: "Self-hosted (Linux)",
|
||||||
|
description: "Deploy Trilium Notes on your own server or VPS, compatible with most Linux distributions.",
|
||||||
|
downloads: {
|
||||||
|
docker: {
|
||||||
|
recommended: true,
|
||||||
|
name: "View on Docker Hub",
|
||||||
|
url: "https://hub.docker.com/r/triliumnext/notes"
|
||||||
|
},
|
||||||
|
tarX64: {
|
||||||
|
name: "x86 (.tar.xz)",
|
||||||
|
url: `https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNextNotes-Server-v${version}-linux-x64.tar.xz`
|
||||||
|
},
|
||||||
|
tarArm64: {
|
||||||
|
name: "ARM (.tar.xz)",
|
||||||
|
url: `https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNextNotes-Server-v${version}-linux-arm64.tar.xz`
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pikapod: {
|
||||||
|
title: "Paid hosting",
|
||||||
|
description: "Trilium Notes hosted on PikaPods, a paid service for easy access and management.",
|
||||||
|
downloads: {
|
||||||
|
pikapod: {
|
||||||
|
recommended: true,
|
||||||
|
name: "Set up on PikaPods",
|
||||||
|
url: "https://www.pikapods.com/pods?run=trilium-next"
|
||||||
|
},
|
||||||
|
triliumcc: {
|
||||||
|
name: "Alternatively see trilium.cc",
|
||||||
|
url: "https://trilium.cc/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export function buildDownloadUrl(app: App, platform: Platform, format: string, architecture: Architecture): string {
|
||||||
|
if (app === "desktop") {
|
||||||
|
return `https://github.com/TriliumNext/Notes/releases/download/v${version}/TriliumNextNotes-v${version}-${platform}-${architecture}.${format}`;
|
||||||
|
} else if (app === "server") {
|
||||||
|
return downloadMatrix.server[platform]?.downloads[format].url ?? "#";
|
||||||
|
} else {
|
||||||
|
return "#";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getArchitecture(): Architecture {
|
||||||
|
const userAgent = navigator.userAgent.toLowerCase();
|
||||||
|
if (userAgent.includes('arm64') || userAgent.includes('aarch64')) {
|
||||||
|
return 'arm64';
|
||||||
|
}
|
||||||
|
|
||||||
|
return "x64";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPlatform(): Platform {
|
||||||
|
const userAgent = navigator.userAgent.toLowerCase();
|
||||||
|
if (userAgent.includes('macintosh') || userAgent.includes('mac os x')) {
|
||||||
|
return "macos";
|
||||||
|
} else if (userAgent.includes('windows') || userAgent.includes('win32')) {
|
||||||
|
return "windows";
|
||||||
|
} else {
|
||||||
|
return "linux";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRecommendedDownload() {
|
||||||
|
const architecture = getArchitecture();
|
||||||
|
const platform = getPlatform();
|
||||||
|
|
||||||
|
const downloadInfo = downloadMatrix.desktop[platform]?.downloads;
|
||||||
|
const recommendedDownload = Object.entries(downloadInfo || {}).find(d => d[1].recommended);
|
||||||
|
const format = recommendedDownload?.[0];
|
||||||
|
const url = buildDownloadUrl("desktop", platform, format || 'zip', architecture);
|
||||||
|
|
||||||
|
return {
|
||||||
|
architecture,
|
||||||
|
platform,
|
||||||
|
url
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
// place files you want to import through the `$lib` alias in this folder.
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import '../app.css';
|
||||||
|
import Header from './header.svelte';
|
||||||
|
|
||||||
|
let { children } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Header />
|
||||||
|
|
||||||
|
{@render children()}
|
||||||
|
|
||||||
|
<footer class="container mx-auto bg-white mt-2 py-6 text-sm text-center text-gray-500">
|
||||||
|
© 2024-2025 <a href="https://github.com/eliandoran" class="text-blue-500 hover:underline">Elian Doran</a> and the <a href="https://github.com/TriliumNext/Notes/graphs/contributors" class="text-blue-500 hover:underline">team</a>. <br/> © 2017-2024 <a href="https://github.com/zadam" class="text-blue-500 hover:underline">Adam Zivner</a>.
|
||||||
|
</footer>
|
||||||
@ -0,0 +1,145 @@
|
|||||||
|
<script>
|
||||||
|
import DownloadNow from "./download-now.svelte";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<section class="relative overflow-hidden bg-gradient-to-br from-white to-violet-50">
|
||||||
|
<!-- Bokeh background circles -->
|
||||||
|
<div class="absolute inset-0 pointer-events-none z-0">
|
||||||
|
<div class="absolute w-72 h-72 bg-violet-300 opacity-30 rounded-full blur-3xl top-[-50px] left-[-80px]"></div>
|
||||||
|
<div class="absolute w-96 h-96 bg-pink-200 opacity-20 rounded-full blur-3xl bottom-[-100px] right-[-60px]"></div>
|
||||||
|
<div class="absolute w-64 h-64 bg-indigo-200 opacity-20 rounded-full blur-2xl top-[200px] left-[50%] transform -translate-x-1/2"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="relative z-10 container mx-auto pt-24 pb-24 px-4">
|
||||||
|
<div class="flex flex-col md:flex-row items-center md:justify-between gap-12">
|
||||||
|
|
||||||
|
<!-- Left: Text Content -->
|
||||||
|
<div class="md:w-1/3">
|
||||||
|
<h2 class="text-4xl font-bold mb-4 text-gray-900">Organize Your Thoughts.<br/> Build Your Knowledge.</h2>
|
||||||
|
<p class="text-lg mb-6 text-gray-700">
|
||||||
|
Trilium Notes helps you build and organize complex personal knowledge bases effortlessly.
|
||||||
|
Its unique tree structure, rich editing tools, and powerful search features make managing your information intuitive and flexible.
|
||||||
|
</p>
|
||||||
|
<div class="flex items-center gap-6">
|
||||||
|
<DownloadNow big />
|
||||||
|
<a href="/download" class="font-medium text-violet-700 hover:underline">
|
||||||
|
More platforms
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Right: Screenshot -->
|
||||||
|
<div class="md:w-2/3">
|
||||||
|
<img src="screenshots/desktop-win.png" alt="Screenshot of the app on desktop Windows" class="w-full rounded-xl shadow-lg">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="mt-20 max-w-6xl mx-auto px-4">
|
||||||
|
<h2 class="text-3xl font-bold text-center mb-12">Beyond Text: Smarter Note Types</h2>
|
||||||
|
|
||||||
|
<div class="grid md:grid-cols-2 gap-10">
|
||||||
|
<!-- Canvas Notes -->
|
||||||
|
<div class="bg-white rounded-xl shadow overflow-hidden">
|
||||||
|
<img src="/note-types/canvas.png" alt="Canvas Note Screenshot" class="w-full h-56 object-cover object-top">
|
||||||
|
<div class="p-6">
|
||||||
|
<h3 class="text-xl font-semibold mb-2">Canvas Notes</h3>
|
||||||
|
<p class="text-gray-600">Draw and arrange elements freely using an Excalidraw-powered canvas — ideal for diagrams, sketches, and visual planning.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Mermaid Diagrams -->
|
||||||
|
<div class="bg-white rounded-xl shadow overflow-hidden">
|
||||||
|
<img src="/note-types/mermaid.png" alt="Mermaid Diagram Screenshot" class="w-full h-56 object-cover object-top">
|
||||||
|
<div class="p-6">
|
||||||
|
<h3 class="text-xl font-semibold mb-2">Mermaid Diagrams</h3>
|
||||||
|
<p class="text-gray-600">Render flowcharts, Gantt charts, and sequence diagrams with Mermaid markdown syntax directly in your notes.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Geo Maps -->
|
||||||
|
<div class="bg-white rounded-xl shadow overflow-hidden">
|
||||||
|
<img src="/note-types/geo-map.png" alt="Geo Map Screenshot" class="w-full h-56 object-cover">
|
||||||
|
<div class="p-6">
|
||||||
|
<h3 class="text-xl font-semibold mb-2">Geo Maps</h3>
|
||||||
|
<p class="text-gray-600">Plot locations and GPX tracks to visualize geography-linked notes and movement patterns on interactive maps.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Mind Maps -->
|
||||||
|
<div class="bg-white rounded-xl shadow overflow-hidden">
|
||||||
|
<img src="/note-types/mind-map.png" alt="Mind Map Screenshot" class="w-full h-56 object-cover">
|
||||||
|
<div class="p-6">
|
||||||
|
<h3 class="text-xl font-semibold mb-2">Mind Maps</h3>
|
||||||
|
<p class="text-gray-600">Organize ideas visually using a drag-and-drop mind map editor powered by Mind Elixir.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="mt-20 max-w-6xl mx-auto px-4">
|
||||||
|
<h2 class="text-3xl font-bold text-center mb-12">Feature Highlights</h2>
|
||||||
|
|
||||||
|
<div class="grid gap-12 md:grid-cols-2 max-w-4xl mx-auto text-gray-700">
|
||||||
|
<!-- Organization & Navigation -->
|
||||||
|
<div>
|
||||||
|
<h3 class="flex items-center text-xl font-semibold mb-6 text-violet-700">Organization & Navigation</h3>
|
||||||
|
<ul class="list-disc list-inside space-y-3">
|
||||||
|
<li>Arbitrarily deep note tree with cloning support.</li>
|
||||||
|
<li>Fast navigation, full-text search, and note hoisting.</li>
|
||||||
|
<li>Note attributes for organization, querying, and scripting.</li>
|
||||||
|
<li>Seamless note versioning.</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Editing & Content -->
|
||||||
|
<div>
|
||||||
|
<h3 class="flex items-center text-xl font-semibold mb-6 text-violet-700">Editing & Content</h3>
|
||||||
|
<ul class="list-disc list-inside space-y-3">
|
||||||
|
<li>Rich WYSIWYG editor with tables, images, math, and markdown autoformat.</li>
|
||||||
|
<li>Source code editing with syntax highlighting.</li>
|
||||||
|
<li>Evernote and Markdown import/export.</li>
|
||||||
|
<li>Web Clipper for easy saving of web content.</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Security & Sync -->
|
||||||
|
<div>
|
||||||
|
<h3 class="flex items-center text-xl font-semibold mb-6 text-violet-700">Security & Sync</h3>
|
||||||
|
<ul class="list-disc list-inside space-y-3">
|
||||||
|
<li>Direct OpenID and TOTP integration for secure login.</li>
|
||||||
|
<li>Synchronization with self-hosted and third-party servers.</li>
|
||||||
|
<li>Strong note encryption with per-note granularity.</li>
|
||||||
|
<li>Sharing notes publicly on the internet.</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Advanced & Customization -->
|
||||||
|
<div>
|
||||||
|
<h3 class="flex items-center text-xl font-semibold mb-6 text-violet-700">Advanced & Customization</h3>
|
||||||
|
<ul class="list-disc list-inside space-y-3">
|
||||||
|
<li>Relation maps and link maps to visualize notes.</li>
|
||||||
|
<li>Scripting support and REST API for automation.</li>
|
||||||
|
<li>Touch-optimized mobile frontend and dark/user themes.</li>
|
||||||
|
<li>Customizable UI with sidebar buttons and user widgets.</li>
|
||||||
|
<li>Metrics with Grafana dashboard integration.</li>
|
||||||
|
<li>Scales efficiently beyond 100,000 notes.</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<section class="bg-violet-50 py-16 mt-24">
|
||||||
|
<div class="container mx-auto text-center px-4">
|
||||||
|
<h2 class="text-3xl font-bold mb-4">Ready to get started with Trilium Notes?</h2>
|
||||||
|
<p class="text-lg text-gray-700 mb-8">Build your personal knowledge base with powerful features and full privacy.</p>
|
||||||
|
|
||||||
|
<div class="flex justify-center gap-6">
|
||||||
|
<a href="#" class="py-3 px-6 bg-violet-600 text-white font-semibold rounded-full shadow hover:bg-violet-700 focus:outline-none focus:ring focus:ring-violet-400 focus:ring-opacity-75">
|
||||||
|
Download Now
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<a href="/demo/paraglide">paraglide</a>
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { setLocale } from '$lib/paraglide/runtime';
|
||||||
|
import { page } from '$app/state';
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
|
import { m } from '$lib/paraglide/messages.js';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h1>{m.hello_world({ name: 'SvelteKit User' })}</h1>
|
||||||
|
<div>
|
||||||
|
<button onclick={() => setLocale('en')}>en</button>
|
||||||
|
</div><p>
|
||||||
|
If you use VSCode, install the <a href="https://marketplace.visualstudio.com/items?itemName=inlang.vs-code-extension" target="_blank">Sherlock i18n extension</a> for a better i18n experience.
|
||||||
|
</p>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
<script>
|
||||||
|
import { getRecommendedDownload } from "$lib/download-helper";
|
||||||
|
|
||||||
|
export let big = false;
|
||||||
|
const { url, platform, architecture } = getRecommendedDownload();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if url}
|
||||||
|
<a href="{url}"
|
||||||
|
class:text-xl={big}
|
||||||
|
class:py-4={big}
|
||||||
|
class="py-2 px-5 bg-violet-600 text-white font-semibold rounded-xl shadow-md hover:bg-violet-700 focus:outline-none focus:ring focus:ring-violet-400 focus:ring-opacity-75">
|
||||||
|
Download now
|
||||||
|
<span class="text-sm text-gray-300">
|
||||||
|
({platform} {architecture})
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { Platform } from "$lib/download-helper";
|
||||||
|
import { downloadMatrix, getArchitecture } from "$lib/download-helper";
|
||||||
|
import DownloadCard from "./download-card.svelte";
|
||||||
|
|
||||||
|
let architectures = ["x64", "arm64"] as const;
|
||||||
|
let architecture = getArchitecture();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="bg-gray-50 py-20">
|
||||||
|
<section class="max-w-6xl mx-auto px-4">
|
||||||
|
<h2 class="text-4xl font-bold text-center text-gray-900 mb-12">Download the desktop application</h2>
|
||||||
|
|
||||||
|
<!-- Architecture pill selector -->
|
||||||
|
<div class="col-span-3 flex justify-center items-center gap-3 mb-6">
|
||||||
|
<span class="text-gray-600 font-medium mr-2">Architecture:</span>
|
||||||
|
<div class="inline-flex bg-violet-100 rounded-full shadow p-1">
|
||||||
|
{#each architectures as arch}
|
||||||
|
<button class="py-2 px-6 rounded-full font-semibold focus:outline-none transition
|
||||||
|
text-violet-700 border-violet-700
|
||||||
|
aria-pressed:bg-violet-700 aria-pressed:text-violet-100
|
||||||
|
" aria-pressed={architecture === arch} on:click={() => architecture = arch}>
|
||||||
|
{arch}
|
||||||
|
</button>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid md:grid-cols-3 gap-10">
|
||||||
|
{#each Object.entries(downloadMatrix.desktop) as [platformId, platform]}
|
||||||
|
{@const textColor = (platformId === "windows" ? "text-blue-600" : platformId === "linux" ? "text-violet-600" : "text-gray-800")}
|
||||||
|
{@const bgColor = (platformId === "windows" ? "bg-blue-600" : platformId === "linux" ? "bg-violet-600" : "bg-gray-800")}
|
||||||
|
{@const hoverColor = (platformId === "windows" ? "hover:bg-blue-700" : platformId === "linux" ? "hover:bg-violet-700" : "hover:bg-gray-900")}
|
||||||
|
<DownloadCard app="desktop"
|
||||||
|
{textColor} {bgColor} {hoverColor}
|
||||||
|
{platform} {architecture} platformId={platformId as Platform} />
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="max-w-4xl mx-auto px-4 mt-10">
|
||||||
|
<h2 class="text-3xl font-bold text-center text-gray-900 mb-8">Set up a server for access on multiple devices</h2>
|
||||||
|
|
||||||
|
<div class="grid md:grid-cols-2 gap-10">
|
||||||
|
{#each Object.entries(downloadMatrix.server) as [platformId, platform]}
|
||||||
|
{@const textColor = (platformId === "linux" ? "text-violet-600" : "text-gray-800")}
|
||||||
|
{@const bgColor = (platformId === "linux" ? "bg-violet-600" : "bg-gray-800")}
|
||||||
|
{@const hoverColor = (platformId === "linux" ? "hover:bg-violet-700" : "hover:bg-gray-900")}
|
||||||
|
<DownloadCard app="server"
|
||||||
|
{textColor} {bgColor} {hoverColor}
|
||||||
|
{platform} {architecture} platformId={platformId as Platform} />
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { buildDownloadUrl, type Architecture, type DownloadMatrixEntry, type Platform, type App } from "$lib/download-helper";
|
||||||
|
|
||||||
|
export let app: App = "desktop";
|
||||||
|
export let platformId: Platform;
|
||||||
|
export let platform: DownloadMatrixEntry;
|
||||||
|
export let textColor: string;
|
||||||
|
export let bgColor: string;
|
||||||
|
export let hoverColor: string;
|
||||||
|
export let architecture: Architecture | null = null;
|
||||||
|
const recommended = Object.entries(platform.downloads).find((e) => e[1].recommended);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="bg-white border border-gray-200 rounded-2xl shadow-lg p-8 flex flex-col items-start">
|
||||||
|
<h3 class="text-2xl font-semibold {textColor} mb-2">{typeof platform.title === "object" ? platform.title[architecture] : platform.title}</h3>
|
||||||
|
<p class="text-gray-700 mb-12">{typeof platform.title === "object" ? platform.description[architecture] : platform.description}</p>
|
||||||
|
<div class="space-y-2 mt-auto w-full">
|
||||||
|
{#if recommended}
|
||||||
|
<a href={buildDownloadUrl(app, platformId as Platform, recommended[0], architecture)} class="mt-auto block text-center {bgColor} {hoverColor} text-white font-medium py-2 px-5 rounded-full shadow transition">
|
||||||
|
{recommended[1].name}
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
|
<div class="flex justify-center gap-4 text-sm {textColor} mt-2">
|
||||||
|
{#each Object.entries(platform.downloads).filter((e) => !e[1].recommended) as [format, download]}
|
||||||
|
<a href={buildDownloadUrl(app, platformId as Platform, format, architecture)} class="hover:underline block">
|
||||||
|
{download.name}
|
||||||
|
</a>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<script>
|
||||||
|
import DownloadNow from "./download-now.svelte";
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<header class="header bg-white sticky top-0 z-50 shadow">
|
||||||
|
<div class="container mx-auto flex items-center py-4">
|
||||||
|
<a href="/" class="flex items-center gap-x-2 w-100">
|
||||||
|
<img src="icon-color.svg" alt="Trilium Notes Logo" class="w-12 h-12">
|
||||||
|
<span class="text-2xl">Trilium Notes</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="group w-full">
|
||||||
|
<nav class="header-nav">
|
||||||
|
<ul class="flex items-center justify-end gap-4">
|
||||||
|
<li><a href="/">User Guide</a></li>
|
||||||
|
<li><a href="/">Technical Guide</a></li>
|
||||||
|
<li><a href="/" class="text-violet-500">Support us</a></li>
|
||||||
|
<li><DownloadNow /></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg enable-background="new 0 0 256 256" version="1.1" viewBox="0 0 256 256" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<title>TriliumNext Notes</title>
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{fill:#95C980;}
|
||||||
|
.st1{fill:#72B755;}
|
||||||
|
.st2{fill:#4FA52B;}
|
||||||
|
.st3{fill:#EE8C89;}
|
||||||
|
.st4{fill:#E96562;}
|
||||||
|
.st5{fill:#E33F3B;}
|
||||||
|
.st6{fill:#EFB075;}
|
||||||
|
.st7{fill:#E99547;}
|
||||||
|
.st8{fill:#E47B19;}
|
||||||
|
</style>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="m202.9 112.7c-22.5 16.1-54.5 12.8-74.9 6.3l14.8-11.8 14.1-11.3 49.1-39.3-51.2 35.9-14.3 10-14.9 10.5c0.7-21.2 7-49.9 28.6-65.4 1.8-1.3 3.9-2.6 6.1-3.8 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.4 2.8-4.9 5.4-7.4 7.8-3.4 3.5-6.8 6.4-10.1 8.8z"/>
|
||||||
|
<path class="st1" d="m213.1 104c-22.2 12.6-51.4 9.3-70.3 3.2l14.1-11.3 49.1-39.3-51.2 35.9-14.3 10c0.5-18.1 4.9-42.1 19.7-58.6 2.7-1.5 5.7-2.9 8.8-4.1 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.9 65.9-2.3 2.8-4.8 5.4-7.2 7.8z"/>
|
||||||
|
<path class="st2" d="m220.5 96.2c-21.1 8.6-46.6 5.3-63.7-0.2l49.2-39.4-51.2 35.9c0.3-15.8 3.5-36.6 14.3-52.8 27.1-11.1 68.5-15.3 85.2-9.5 0.1 16.2-15.9 45.4-33.8 66z"/>
|
||||||
|
|
||||||
|
<path class="st3" d="m106.7 179c-5.8-21 5.2-43.8 15.5-57.2l4.8 14.2 4.5 13.4 15.9 47-12.8-47.6-3.6-13.2-3.7-13.9c15.5 6.2 35.1 18.6 40.7 38.8 0.5 1.7 0.9 3.6 1.2 5.5 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.1-3.8-7.6-1.6-3.5-2.9-6.8-3.8-10z"/>
|
||||||
|
<path class="st4" d="m110.4 188.9c-3.4-19.8 6.9-40.5 16.6-52.9l4.5 13.4 15.9 47-12.8-47.6-3.6-13.2c13.3 5.2 29.9 15 38.1 30.4 0.4 2.4 0.6 5 0.7 7.7 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8-1.4-2.6-2.7-5.2-3.8-7.7z"/>
|
||||||
|
<path class="st5" d="m114.2 196.5c-0.7-18 8.6-35.9 17.3-47.1l15.9 47-12.8-47.6c11.6 4.4 26.1 12.4 35.2 24.8 0.9 23.1-7.1 54.9-15.9 65.7-12-4.3-29.3-24-39.7-42.8z"/>
|
||||||
|
|
||||||
|
<path class="st6" d="m86.3 59.1c21.7 10.9 32.4 36.6 35.8 54.9l-15.2-6.6-14.5-6.3-50.6-22 48.8 24.9 13.6 6.9 14.3 7.3c-16.6 7.9-41.3 14.5-62.1 4.1-1.8-0.9-3.6-1.9-5.4-3.2-2.3-1.5-4.5-3.2-6.8-5.1-19.9-16.4-40.3-46.4-42.7-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.2 0.8 6.2 1.6 9.1 2.5 4 1.3 7.6 2.8 10.9 4.4z"/>
|
||||||
|
<path class="st7" d="m75.4 54.8c18.9 12 28.4 35.6 31.6 52.6l-14.5-6.3-50.6-22 48.7 24.9 13.6 6.9c-14.1 6.8-34.5 13-53.3 8.2-2.3-1.5-4.5-3.2-6.8-5.1-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3 3.1 0.8 6.2 1.6 9.1 2.6z"/>
|
||||||
|
<path class="st8" d="m66.3 52.2c15.3 12.8 23.3 33.6 26.1 48.9l-50.6-22 48.8 24.9c-12.2 6-29.6 11.8-46.5 10-19.8-16.4-40.2-46.4-42.6-61.5 12.4-6.5 41.5-5.8 64.8-0.3z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 253 KiB |
|
After Width: | Height: | Size: 229 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 128 KiB |
@ -0,0 +1,11 @@
|
|||||||
|
import { mdsvex } from 'mdsvex';
|
||||||
|
import adapter from '@sveltejs/adapter-auto';
|
||||||
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
preprocess: [vitePreprocess(), mdsvex()],
|
||||||
|
kit: { adapter: adapter() },
|
||||||
|
extensions: ['.svelte', '.svx']
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"extends": "./.svelte-kit/tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"checkJs": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true,
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"composite": true
|
||||||
|
}
|
||||||
|
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
||||||
|
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
||||||
|
//
|
||||||
|
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
||||||
|
// from the referenced tsconfig.json - TypeScript does not merge them in
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
|
import { paraglideVitePlugin } from '@inlang/paraglide-js';
|
||||||
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
// See https://github.com/nrwl/nx/issues/28978.
|
||||||
|
const cwd = process.cwd();
|
||||||
|
process.chdir(__dirname); // Temporarily change the working directory
|
||||||
|
|
||||||
|
const config = defineConfig({
|
||||||
|
plugins: [
|
||||||
|
tailwindcss(),
|
||||||
|
sveltekit(),
|
||||||
|
paraglideVitePlugin({
|
||||||
|
project: './project.inlang',
|
||||||
|
outdir: './src/lib/paraglide'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
process.chdir(cwd); // Restore the original working directory
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 68 KiB |
@ -0,0 +1,17 @@
|
|||||||
|
diff --git a/src/utils/assets/copy-assets-handler.js b/src/utils/assets/copy-assets-handler.js
|
||||||
|
index 6b68205d833ce9e8277283ac31230c020d2921ec..2f0a7f018b03eae3b8f3ce1a4cf4790aaafed677 100644
|
||||||
|
--- a/src/utils/assets/copy-assets-handler.js
|
||||||
|
+++ b/src/utils/assets/copy-assets-handler.js
|
||||||
|
@@ -39,12 +39,6 @@ class CopyAssetsHandler {
|
||||||
|
this.callback = opts.callback ?? exports.defaultFileEventHandler;
|
||||||
|
// TODO(jack): Should handle nested .gitignore files
|
||||||
|
this.ignore = (0, ignore_1.default)();
|
||||||
|
- const gitignore = pathPosix.join(opts.rootDir, '.gitignore');
|
||||||
|
- const nxignore = pathPosix.join(opts.rootDir, '.nxignore');
|
||||||
|
- if ((0, node_fs_1.existsSync)(gitignore))
|
||||||
|
- this.ignore.add((0, node_fs_1.readFileSync)(gitignore).toString());
|
||||||
|
- if ((0, node_fs_1.existsSync)(nxignore))
|
||||||
|
- this.ignore.add((0, node_fs_1.readFileSync)(nxignore).toString());
|
||||||
|
this.assetGlobs = opts.assets.map((f) => {
|
||||||
|
let isGlob = false;
|
||||||
|
let pattern;
|
||||||