{{ title }}
+ + {% if updatedAt %} +Updated:
+ {% endif %} +
+ {{ content | safe }}
+
+
+ {% set postTags = page.inputPath | extractTagsFromFile %}
+
+ {% if postTags.length > 0 %}
+
+ {% endif %}
+diff --git a/_includes/base.njk b/_includes/base.njk new file mode 100644 index 0000000..a1186f7 --- /dev/null +++ b/_includes/base.njk @@ -0,0 +1,25 @@ + + +
+ + +Updated:
+ {% endif %} +Hi
diff --git a/index.njk b/index.njk new file mode 100644 index 0000000..f6700fd --- /dev/null +++ b/index.njk @@ -0,0 +1,24 @@ +--- +layout: base.njk +title: Blog +--- + +{{ post.data.description }}
+ {% endif %} + +No blog posts yet.
+{% endif %} \ No newline at end of file diff --git a/package.json b/package.json index e192b23..37f0bbf 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,17 @@ "main": "index.js", "scripts": { "build": "pnpm exec eleventy", - "develop": "pnpm exec eleventy --serve" + "dev": "pnpm exec eleventy --serve" }, "keywords": [], "author": "", "license": "GPL-3.0-only", "packageManager": "pnpm@10.28.0", "dependencies": { - "@11ty/eleventy": "^3.1.2" + "@11ty/eleventy": "^3.1.2", + "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.2", + "markdown-it": "^14.1.0", + "markdown-it-container": "^4.0.0", + "markdown-it-footnote": "^4.0.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1f8c810..8fb9505 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,18 @@ importers: '@11ty/eleventy': specifier: ^3.1.2 version: 3.1.2 + '@11ty/eleventy-plugin-syntaxhighlight': + specifier: ^5.0.2 + version: 5.0.2 + markdown-it: + specifier: ^14.1.0 + version: 14.1.0 + markdown-it-container: + specifier: ^4.0.0 + version: 4.0.0 + markdown-it-footnote: + specifier: ^4.0.0 + version: 4.0.0 packages: @@ -29,6 +41,9 @@ packages: resolution: {integrity: sha512-QK1tRFBhQdZASnYU8GMzpTdsMMFLVAkuU0gVVILqNyp09xJJZb81kAS3AFrNrwBCsgLxTdWHJ8N64+OTTsoKkA==} engines: {node: '>=18'} + '@11ty/eleventy-plugin-syntaxhighlight@5.0.2': + resolution: {integrity: sha512-T6xVVRDJuHlrFMHbUiZkHjj5o1IlLzZW+1IL9eUsyXFU7rY2ztcYhZew/64vmceFFpQwzuSfxQOXxTJYmKkQ+A==} + '@11ty/eleventy-utils@2.0.7': resolution: {integrity: sha512-6QE+duqSQ0GY9rENXYb4iPR4AYGdrFpqnmi59tFp9VrleOl0QSh8VlBr2yd6dlhkdtj7904poZW5PvGr9cMiJQ==} engines: {node: '>=18'} @@ -351,6 +366,12 @@ packages: resolution: {integrity: sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==} engines: {node: '>=12'} + markdown-it-container@4.0.0: + resolution: {integrity: sha512-HaNccxUH0l7BNGYbFbjmGpf5aLHAMTinqRZQAEQbMr2cdD3z91Q6kIo1oUn1CQndkT03jat6ckrdRYuwwqLlQw==} + + markdown-it-footnote@4.0.0: + resolution: {integrity: sha512-WYJ7urf+khJYl3DqofQpYfEYkZKbmXmwxQV8c8mO/hGIhgZ1wOe7R4HLFNwqx7TjILbnC98fuyeSsin19JdFcQ==} + markdown-it@14.1.0: resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} hasBin: true @@ -454,6 +475,10 @@ packages: resolution: {integrity: sha512-7Hc+IvlQ7hlaIfQFZnxlRl0jnpWq2qwibORBhQYIb0QbNtuicc5ZxvKkVT71HJ4Py1wSZ/3VR1r8LfkCtoCzhw==} engines: {node: '>=12.0.0'} + prismjs@1.30.0: + resolution: {integrity: sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==} + engines: {node: '>=6'} + prr@1.0.1: resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} @@ -586,6 +611,10 @@ snapshots: - posthtml - supports-color + '@11ty/eleventy-plugin-syntaxhighlight@5.0.2': + dependencies: + prismjs: 1.30.0 + '@11ty/eleventy-utils@2.0.7': {} '@11ty/eleventy@3.1.2': @@ -903,6 +932,10 @@ snapshots: luxon@3.7.2: {} + markdown-it-container@4.0.0: {} + + markdown-it-footnote@4.0.0: {} + markdown-it@14.1.0: dependencies: argparse: 2.0.1 @@ -994,6 +1027,8 @@ snapshots: posthtml-parser: 0.11.0 posthtml-render: 3.0.0 + prismjs@1.30.0: {} + prr@1.0.1: {} punycode.js@2.3.1: {} diff --git a/post-redirects.njk b/post-redirects.njk new file mode 100644 index 0000000..5a2f960 --- /dev/null +++ b/post-redirects.njk @@ -0,0 +1,36 @@ +--- +pagination: + data: collections.postsBySlug + size: 1 + alias: slugData + resolve: keys +permalink: /post/{{ slugData }}/ +layout: base.njk +--- + +{% set posts = collections.postsBySlug[slugData] %} + +{% if posts.length == 1 %} +{# Single post - redirect to the dated version #} + + +Redirecting to {{ posts[0].data.title }}...
+{% else %} +{# Multiple posts with same title - show disambiguation page #} +There are multiple posts with this title. Please select the one you're looking for:
+ +{{ post.data.description }}
+ {% endif %} + +{{ post.data.description }}
+ {% endif %} + +