diff options
| author | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
|---|---|---|
| committer | Shipwreckt <me@shipwreckt.co.uk> | 2025-10-31 20:02:14 +0000 |
| commit | 7a52ddeba2a68388b544f529d2d92104420f77b0 (patch) | |
| tree | 15ddd47457a2cb4a96060747437d36474e4f6b4e /src/_includes/post.njk | |
| parent | 53d6ae2b5568437afa5e4995580a3fb679b7b91b (diff) | |
Changed from static to 11ty!
Diffstat (limited to 'src/_includes/post.njk')
| -rw-r--r-- | src/_includes/post.njk | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/_includes/post.njk b/src/_includes/post.njk new file mode 100644 index 0000000..2b868ae --- /dev/null +++ b/src/_includes/post.njk @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" href="/assets/css/main.css"> + <title>{{ title }}</title> + </head> + <body> + <article> + <header> + <h1>{{ title }}</h1> + <p class="post-date">{{ date | dateFormat("MMMM dd, yyyy") }}</p> + </header> + <div class="post-content"> + <hr> + {{ content | safe }} + </div> + </article> + + {% set postTags = (page and page.data and page.data.tags) or tags or [] %} + {% set displayTags = postTags | reject("equalto", "post") | list %} + + <footer class="post-footer"> + <!-- 🌟 Back button --> + <a href="/" class="back-button">⬅ Back to Home</a> + + {% if displayTags | length %} + <p class="post-tags"> + {% for tag in displayTags %} + <a href="/tags/{{ tag | lower | replace(' ', '-') }}/" + aria-label="View posts tagged {{ tag }}"> + {{ tag }} + </a> + {% endfor %} + </p> + {% endif %} + </footer> + + </body> +</html> + |
