From a7d6b76eb318335263f8491dd27cac8a1dc99bfd Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Sun, 21 Jan 2024 11:07:03 +0000 Subject: [PATCH] Replies --- package.json | 2 +- src/_data/notes.js | 2 +- src/_includes/components/reply.njk | 6 ++++-- src/_includes/note.njk | 5 ++++- src/note.md | 2 +- src/styles/main.css | 8 +++++++- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ea44edb..93f9355 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "serve": "npx @11ty/eleventy --serve" }, "author": "", "license": "ISC", diff --git a/src/_data/notes.js b/src/_data/notes.js index d00675e..61a7153 100644 --- a/src/_data/notes.js +++ b/src/_data/notes.js @@ -3,7 +3,7 @@ const fs = require('node:fs'); const formatMentions = text => { const matcher = /@(\w+)@([a-zA-Z\-_0-9\.]+)/gm; return text.replace(matcher, (match, username, domain) => { - return `[${match}](https://${domain}/@${username})`; + return `${match}`; }); } diff --git a/src/_includes/components/reply.njk b/src/_includes/components/reply.njk index c9928c6..8b7c736 100644 --- a/src/_includes/components/reply.njk +++ b/src/_includes/components/reply.njk @@ -1,13 +1,15 @@ {% macro reply(note) %} -
+
+ {{ note.text | md | safe }} {% if note.replies.length %} -
    +
      {% for r in note.replies %}
    • {{ reply(r) }}
    • {% endfor %}
    {% endif %} + permalink
{% endmacro %} \ No newline at end of file diff --git a/src/_includes/note.njk b/src/_includes/note.njk index 94418b9..96bd071 100644 --- a/src/_includes/note.njk +++ b/src/_includes/note.njk @@ -13,6 +13,8 @@ layout: "base.njk"
{{ content | safe }} + {% if note.files | length %} +
Media
+ {% endif %} -