Added 11ty-navigation plugin
This commit is contained in:
parent
6b8dfa650c
commit
41b0ae5504
|
@ -1,6 +1,9 @@
|
|||
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
|
||||
const { DateTime } = require("luxon");
|
||||
|
||||
module.exports = function (eleventyConfig) {
|
||||
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
||||
|
||||
eleventyConfig.addFilter("postDate", (dateObj) => {
|
||||
return DateTime.fromJSDate(dateObj).toFormat("y'-'LL'-'dd' at 'T");
|
||||
});
|
||||
|
|
14
package-lock.json
generated
14
package-lock.json
generated
|
@ -10,6 +10,7 @@
|
|||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^2.0.1",
|
||||
"@11ty/eleventy-navigation": "^0.3.5",
|
||||
"luxon": "^3.4.3"
|
||||
}
|
||||
},
|
||||
|
@ -104,6 +105,19 @@
|
|||
"url": "https://opencollective.com/11ty"
|
||||
}
|
||||
},
|
||||
"node_modules/@11ty/eleventy-navigation": {
|
||||
"version": "0.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@11ty/eleventy-navigation/-/eleventy-navigation-0.3.5.tgz",
|
||||
"integrity": "sha512-4aKW5aIQDFed8xs1G1pWcEiFPcDSwZtA4IH1eERtoJ+Xy+/fsoe0pzbDmw84bHZ9ACny5jblENhfZhcCxklqQw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"dependency-graph": "^0.11.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/11ty"
|
||||
}
|
||||
},
|
||||
"node_modules/@11ty/eleventy-utils": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@11ty/eleventy-utils/-/eleventy-utils-1.0.2.tgz",
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^2.0.1",
|
||||
"@11ty/eleventy-navigation": "^0.3.5",
|
||||
"luxon": "^3.4.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="generator" content="{{ eleventy.generator }}">
|
||||
<title>{% if title %}{{ title }} | {% endif %}{{ meta.siteName }}</title>
|
||||
<link rel="stylesheet" href="/css/global.css" />
|
||||
</head>
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<header>
|
||||
<h1>{{ title or meta.siteName }}</h1>
|
||||
<hr>
|
||||
<h2>Navigation</h2>
|
||||
{{ collections.all | eleventyNavigation | eleventyNavigationToHtml | safe }}
|
||||
<hr>
|
||||
</header>
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: Cebuano
|
||||
layout: page.njk
|
||||
eleventyNavigation:
|
||||
key: Cebuano
|
||||
---
|
||||
|
||||
[← Home](/)
|
||||
|
|
15
src/index.md
15
src/index.md
|
@ -1,19 +1,12 @@
|
|||
---
|
||||
layout: page.njk
|
||||
date: Last Modified
|
||||
eleventyNavigation:
|
||||
key: Home
|
||||
order: -1
|
||||
---
|
||||
|
||||
hello! my name is gil and this is my site. pronouns are he/they. i write and tinker with software/hardware. i don't have much to put here except links (for now).
|
||||
|
||||
---
|
||||
|
||||
## Here
|
||||
|
||||
[Cebuano](/ceb/)
|
||||
[Now](/now/)
|
||||
[Poetry](/poetry/)
|
||||
|
||||
---
|
||||
Hello! my name is gil and this is my site. pronouns are he/they. i write and tinker with software/hardware. i don't have much to put here except links (for now).
|
||||
|
||||
## Links
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
title: Now
|
||||
layout: page.njk
|
||||
eleventyNavigation:
|
||||
key: Now
|
||||
---
|
||||
|
||||
Hello!
|
||||
|
||||
[← Home](/)
|
|
@ -3,6 +3,8 @@ title: Poetry
|
|||
layout: page.njk
|
||||
permalink: /poetry/index.html
|
||||
override:tags: []
|
||||
eleventyNavigation:
|
||||
key: Poetry
|
||||
---
|
||||
|
||||
<ul>
|
||||
|
@ -10,5 +12,3 @@ override:tags: []
|
|||
<li><a href="{{ poem.url }}">{{ poem.data.title }}</a></li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
|
||||
[← Home](/)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"layout": "page.njk",
|
||||
"permalink": "/poem/{{ page.fileSlug }}/",
|
||||
"permalink": "/poem/{{ title | slug }}/",
|
||||
"tags": "poems"
|
||||
}
|
Loading…
Reference in a new issue