Skip to content

Commit

Permalink
on lipu page, put toki type on toki list
Browse files Browse the repository at this point in the history
  • Loading branch information
alifeee committed Jan 15, 2024
1 parent 694919f commit 86f1fe4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,24 @@ module.exports = function (eleventyConfig) {

// helpers for tag management
eleventyConfig.addFilter("getIssueTag", (tags) => {
// get "nanpa X" from tag list
const nanpa_tags = tags.filter((tag) => tag.startsWith("nanpa"));
if (nanpa_tags.length != 1) {
throw Error("oh no");
}
return nanpa_tags.at(0);
});
eleventyConfig.addFilter("getTokiTypeTag", (tags) => {
// get the tag(s) that isn't "nanpa X" or "toki"
console.log(tags);
const nanpa_tags = tags.filter(
(tag) => !tag.startsWith("nanpa") && tag != "toki"
);
if (nanpa_tags.length != 1) {
throw Error("oh no");
}
return nanpa_tags.at(0);
});

// helpers for use in markdown (toki)
// pu - link to nimi pi pu ala
Expand Down
4 changes: 2 additions & 2 deletions lipu/lipu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ css:
{{asReadableDate data.date}}
</span>
<span class="lipu">
<span class="sitelen-pona">lipu</span>
{{getIssueTag data.tags}}
<span class="sitelen-pona">{{getTokiTypeTag data.tags}}</span>
{{getTokiTypeTag data.tags}}
</span>
</div>
</a>
Expand Down

0 comments on commit 86f1fe4

Please sign in to comment.