diff --git a/.eleventy.js b/.eleventy.js index 2a97611..0f96849 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -180,7 +180,8 @@ module.exports = function (eleventyConfig) { b += str.charCodeAt(i) * (i + 1); } function cap(x) { - return 100 + (x % 156); + // make sure all RGB values are below 156 to keep colours dark + return x % 156; } return `rgb(${cap(r)}, ${cap(g)}, ${cap(b)})`; }); @@ -189,6 +190,24 @@ module.exports = function (eleventyConfig) { // use like {{ eleventyImage "images/blah.jpg" "classes" "alt" 300 }} eleventyConfig.addShortcode("eleventyImage", imageShortcode); + eleventyConfig.addShortcode("nav", function (url, label) { + let isActive = false; + if (url == "/") { + isActive = this.page.url == "/" || this.page.url.startsWith("/lipu/"); + } else { + isActive = this.page.url.startsWith(url); + } + const content = label + .split(" ") + .map((word) => { + return `${word}`; + }) + .join(" "); + return `
  • ${content}
  • `; + }); + return { markdownTemplateEngine: "hbs", }; diff --git a/_includes/page.hbs b/_includes/page.hbs index 81a1d43..d54c007 100644 --- a/_includes/page.hbs +++ b/_includes/page.hbs @@ -40,22 +40,6 @@ scripts: [] {{/each}} - - - @@ -67,34 +51,21 @@ scripts: [] -
    -
    -

    - lipu tenpo li lon ma Patreon! - o lukin! -

    - -
    -
    - - - lipu tenpo logo -

    lipu tenpo

    -
    +
    + + + +
    +

    lipu tenpo

    + +
    +