From ad646e4dfaac7ef16fe578416b031bd25d9ec395 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Sat, 8 Aug 2026 20:04:52 -0400 Subject: [PATCH] Add the backlink and the note layout --- _config.yml | 6 ++++++ _layouts/note.html | 18 ++++++++++++++++++ _notes/test-2.md | 5 +++++ _notes/test.md | 1 - 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 _layouts/note.html create mode 100644 _notes/test-2.md diff --git a/_config.yml b/_config.yml index 3e19981..655501c 100644 --- a/_config.yml +++ b/_config.yml @@ -12,3 +12,9 @@ collections: notes: output: true permalink: /:slug/ + +defaults: + - scope: + path: "_notes/**/*.md" + values: + layout: "note" diff --git a/_layouts/note.html b/_layouts/note.html new file mode 100644 index 0000000..5b1d317 --- /dev/null +++ b/_layouts/note.html @@ -0,0 +1,18 @@ +--- +layout: default +--- + +{{ content }} + +
+ {% if page.backlinks.size > 0 %} +

Notes mentioning this note

+
+ {% for backlink in page.backlinks %} + + {% endfor %} +
+ {% endif %} +
diff --git a/_notes/test-2.md b/_notes/test-2.md new file mode 100644 index 0000000..a422a48 --- /dev/null +++ b/_notes/test-2.md @@ -0,0 +1,5 @@ +--- +title: "Another note" +--- + +[[test]] \ No newline at end of file diff --git a/_notes/test.md b/_notes/test.md index d1e1dd7..d3081cd 100644 --- a/_notes/test.md +++ b/_notes/test.md @@ -1,6 +1,5 @@ --- title: "Hello World" -layout: default --- Hello World