Skip to content

Commit

Permalink
rename index -> toki and...
Browse files Browse the repository at this point in the history
remove "all" collection with eq/neq helpers
  • Loading branch information
alifeee committed Dec 29, 2023
1 parent 63f3b09 commit fc1290f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ module.exports = function (eleventyConfig) {
yaml.safeLoad(contents)
);

// render date as YYYY-MM-DD
eleventyConfig.addHandlebarsHelper(
"asDate",
(date) => new Date(date).toISOString().split("T")[0]
);
// equality checking (mainly for collections)
eleventyConfig.addHandlebarsHelper("eq", (a, b) => a === b);
eleventyConfig.addHandlebarsHelper("neq", (a, b) => a != b);
};
6 changes: 3 additions & 3 deletions toki/index.hbs → toki/toki.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
layout: page
title: "lipu tenpo - sona"
eleventyExcludeFromCollections: true
permalink: /toki/
---
<h2>toki</h2>
{{#each collections}}
{{#if this}}
{{#if (neq @key "all")}}
<h3>{{@key}}</h3>
<ul>
{{#each this}}
Expand All @@ -15,5 +16,4 @@ eleventyExcludeFromCollections: true
{{/each}}
</ul>
{{/if}}
{{/each}}
{{@key}}
{{/each}}

0 comments on commit fc1290f

Please sign in to comment.