Skip to content

Commit 66feb32

Browse files
committed
Adopt 11ty idioms
1 parent 957b027 commit 66feb32

18 files changed

+23
-12
lines changed

.claude/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.0.1",
3+
"configurations": [
4+
{
5+
"name": "Eleventy Dev Server",
6+
"runtimeExecutable": "npm",
7+
"runtimeArgs": ["run", "dev"],
8+
"port": 8080
9+
}
10+
]
11+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<title>{{ title }} | {{ site.name }}</title>
1010
{% endif %}
1111
<meta name="viewport" content="width=device-width, initial-scale=1" />
12-
<meta name="description" content="{{ description | default: site.description }}" />
12+
<meta name="description" content="{{ description | default(site.description) }}" />
1313

1414
<link rel="stylesheet" href="/styles/basic.css" />
1515
<link rel="stylesheet" href="/styles/main.css" />
@@ -27,6 +27,6 @@
2727
<a href="{{ item.url }}">{{ item.title }}</a>
2828
{% endfor %}
2929
</nav>
30-
<main class="{{ class }} page">{{ content }}</main>
30+
<main class="{{ class }} page">{{ content | safe }}</main>
3131
</body>
3232
</html>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ <h1>{{ title }}</h1>
66

77
<div class="post-date">{{ page.date | dateFormat }}</div>
88

9-
<div class="post-content">{{ content }}</div>
9+
<div class="post-content">{{ content | safe }}</div>

_posts/_posts.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

eleventy.config.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = function (eleventyConfig) {
1414

1515
eleventyConfig.addCollection("posts", (api) =>
1616
api
17-
.getFilteredByGlob("_posts/**/*.md")
17+
.getFilteredByTag("posts")
1818
.filter((post) => post.data.published !== false)
1919
.reverse()
2020
);
@@ -28,7 +28,7 @@ module.exports = function (eleventyConfig) {
2828
if (data.published === false) {
2929
return false;
3030
}
31-
if (data.page.inputPath.startsWith("./_posts/")) {
31+
if (data.page.inputPath.startsWith("./posts/")) {
3232
const d = new Date(data.page.date);
3333
const year = d.getUTCFullYear();
3434
const month = String(d.getUTCMonth() + 1).padStart(2, "0");
@@ -43,12 +43,11 @@ module.exports = function (eleventyConfig) {
4343
dir: {
4444
input: ".",
4545
output: "_site",
46-
layouts: "_layouts",
4746
data: "_data",
4847
includes: "_includes",
4948
},
50-
templateFormats: ["md", "html", "liquid", "njk"],
51-
markdownTemplateEngine: "liquid",
52-
htmlTemplateEngine: "liquid",
49+
templateFormats: ["md", "html", "njk"],
50+
markdownTemplateEngine: "njk",
51+
htmlTemplateEngine: "njk",
5352
};
5453
};
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)