Add the backlink and the note layout

This commit is contained in:
2026-08-08 20:04:52 -04:00
parent 98ec1e8b47
commit ad646e4dfa
4 changed files with 29 additions and 1 deletions

View File

@@ -12,3 +12,9 @@ collections:
notes: notes:
output: true output: true
permalink: /:slug/ permalink: /:slug/
defaults:
- scope:
path: "_notes/**/*.md"
values:
layout: "note"

18
_layouts/note.html Normal file
View File

@@ -0,0 +1,18 @@
---
layout: default
---
{{ content }}
<div>
{% if page.backlinks.size > 0 %}
<h3>Notes mentioning this note</h3>
<div>
{% for backlink in page.backlinks %}
<div class="backlink-box">
<a class="internal-link" href="{{ site.baseurl }}{{ backlink.url }}{%- if site.use_html_extension -%}.html{%- endif -%}">{{ backlink.title }}</a><br>
</div>
{% endfor %}
</div>
{% endif %}
</div>

5
_notes/test-2.md Normal file
View File

@@ -0,0 +1,5 @@
---
title: "Another note"
---
[[test]]

View File

@@ -1,6 +1,5 @@
--- ---
title: "Hello World" title: "Hello World"
layout: default
--- ---
Hello World Hello World