diff options
author | Starfall <us@starfall.systems> | 2023-05-17 20:26:42 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2023-05-17 20:43:15 -0500 |
commit | ab48bfa194a3d24679062217dbe55e7eead51bee (patch) | |
tree | 3f64d35c076af8682a2c60c08626e5f722c7c607 | |
parent | 1cc3d1798ec2b7d0cc2fde3f97aea346a22176bf (diff) |
switch to toml frontmatter
-rw-r--r-- | _includes/base.njk | 3 | ||||
-rw-r--r-- | eleventy.config.js | 9 | ||||
-rw-r--r-- | package-lock.json | 40 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/blog.njk | 12 | ||||
-rw-r--r-- | src/blog/foobar.md | 6 | ||||
-rw-r--r-- | src/blog/hello-world.md | 7 | ||||
-rw-r--r-- | src/index.html | 4 |
8 files changed, 46 insertions, 37 deletions
diff --git a/_includes/base.njk b/_includes/base.njk index 44b3b1f..c3602c7 100644 --- a/_includes/base.njk +++ b/_includes/base.njk @@ -1,7 +1,6 @@ --- -title: Starfall +title = "Starfall" --- - <!doctype html> <html lang=en._US dir=ltr> <title>{{ title }}</title> diff --git a/eleventy.config.js b/eleventy.config.js index 79bd47a..2d222ae 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -11,12 +11,21 @@ filter_rfc3339_datetime = function(date) { return date.toISOString().replace('T', ' '); } +const toml = require('@iarna/toml') + module.exports = function(eleventyConfig) { eleventyConfig.addPassthroughCopy('./css/') eleventyConfig.addFilter('local_date', filter_local_date) eleventyConfig.addFilter('rfc3339_datetime', filter_rfc3339_datetime) + eleventyConfig.setFrontMatterParsingOptions({ + engines: { + toml: toml.parse.bind(toml) + }, + language: 'toml' + }) + return { dir: { input: 'src', diff --git a/package-lock.json b/package-lock.json index aa34b97..6b22009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "license": "UNLICENSED", "devDependencies": { "@11ty/eleventy": "^2.0.1", - "@ltd/j-toml": "^1.38.0" + "@iarna/toml": "^3.0.0" } }, "node_modules/@11ty/dependency-tree": { @@ -119,6 +119,12 @@ "url": "https://opencollective.com/11ty" } }, + "node_modules/@11ty/eleventy/node_modules/@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true + }, "node_modules/@11ty/lodash-custom": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/@11ty/lodash-custom/-/lodash-custom-4.17.21.tgz", @@ -177,15 +183,9 @@ } }, "node_modules/@iarna/toml": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", - "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", - "dev": true - }, - "node_modules/@ltd/j-toml": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/@ltd/j-toml/-/j-toml-1.38.0.tgz", - "integrity": "sha512-lYtBcmvHustHQtg4X7TXUu1Xa/tbLC3p2wLvgQI+fWVySguVZJF60Snxijw5EiohumxZbR10kWYFFebh1zotiw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-td6ZUkz2oS3VeleBcN+m//Q6HlCFCPrnI0FZhrt/h4XqLEdOyYp2u21nd8MdsR+WJy5r9PTDaHTDDfhf4H4l6Q==", "dev": true }, "node_modules/@nodelib/fs.scandir": { @@ -2401,6 +2401,14 @@ "recursive-copy": "^2.0.14", "semver": "^7.3.8", "slugify": "^1.6.6" + }, + "dependencies": { + "@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true + } } }, "@11ty/eleventy-dev-server": { @@ -2467,15 +2475,9 @@ } }, "@iarna/toml": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", - "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", - "dev": true - }, - "@ltd/j-toml": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/@ltd/j-toml/-/j-toml-1.38.0.tgz", - "integrity": "sha512-lYtBcmvHustHQtg4X7TXUu1Xa/tbLC3p2wLvgQI+fWVySguVZJF60Snxijw5EiohumxZbR10kWYFFebh1zotiw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-td6ZUkz2oS3VeleBcN+m//Q6HlCFCPrnI0FZhrt/h4XqLEdOyYp2u21nd8MdsR+WJy5r9PTDaHTDDfhf4H4l6Q==", "dev": true }, "@nodelib/fs.scandir": { diff --git a/package.json b/package.json index 367e416..d147021 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,6 @@ }, "devDependencies": { "@11ty/eleventy": "^2.0.1", - "@ltd/j-toml": "^1.38.0" + "@iarna/toml": "^3.0.0" } } diff --git a/src/blog.njk b/src/blog.njk index 29709f7..dd04288 100644 --- a/src/blog.njk +++ b/src/blog.njk @@ -1,10 +1,10 @@ --- -layout: base.njk -pagination: - data: collections.post - size: 20 - reverse: true - alias: posts +layout = "base.njk" +[pagination] +data = "collections.post" +alias = "posts" +size = 20 +reverse = true --- {% for post in posts %} <article> diff --git a/src/blog/foobar.md b/src/blog/foobar.md index 081799b..9c3c805 100644 --- a/src/blog/foobar.md +++ b/src/blog/foobar.md @@ -1,6 +1,6 @@ --- -layout: base.njk -tags: ["post"] -title: Some second post +layout = "base.njk" +tags = [ "post" ] +title = "Second post" --- Second post, hooray! diff --git a/src/blog/hello-world.md b/src/blog/hello-world.md index 0feadd7..d75c546 100644 --- a/src/blog/hello-world.md +++ b/src/blog/hello-world.md @@ -1,7 +1,6 @@ --- -layout: base.njk -title: Hello, World! -tags: - - post +layout = "base.njk" +title = "Hello, World!" +tags = [ "post" ] --- Hello, World! diff --git a/src/index.html b/src/index.html index e4aa82e..1af2fb6 100644 --- a/src/index.html +++ b/src/index.html @@ -1,6 +1,6 @@ --- -layout: base.njk -title: starfall.systems +title = "starfall.systems" +layout = "base.njk" --- Hello, World! |