the home site for me: also iteration 3 or 4 of my site
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add rotating greeting to title

+13 -3
+1
config.toml
··· 31 31 internal_level = "warn" 32 32 33 33 [extra] 34 + greetings = ["erlo", "hello", "hi", "hej", "oi", "tja", "howdy", "hey", "heya", "g'day", "salut"] 34 35 author = "Kieran Klukas" 35 36 display_author = true 36 37
+9
scripts/build.ts
··· 14 14 } 15 15 16 16 await Bun.$`cp config.toml .zola-build/`.quiet(); 17 + 18 + const config = await Bun.file("config.toml").text(); 19 + const greetings = config.match(/greetings = \[([^\]]+)\]/)?.[1] 20 + .match(/"([^"]+)"/g)?.map((s) => s.replace(/"/g, "")) ?? ["hello"]; 21 + const greeting = greetings[Math.floor(Math.random() * greetings.length)]; 22 + await Bun.write(".zola-build/config.toml", 23 + (await Bun.file(".zola-build/config.toml").text()) + `\ngreeting = "${greeting}"\n` 24 + ); 25 + 17 26 await Bun.$`bun run scripts/preprocess.ts .zola-build/content`.quiet(); 18 27 await Bun.$`cd .zola-build && zola build --force --output-dir ../public`; 19 28 await Bun.$`rm -rf .zola-build`.quiet();
+3 -3
templates/head.html
··· 5 5 <meta name="robots" content="index, follow" /> 6 6 <link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml" /> 7 7 {% if page.title %} {% set title = page.title %} {% elif section.title %} {% set 8 - title = section.title %} {% elif term %} {% set title = "|" ~ term.name ~ "|" %} 9 - {% elif current_path and "tags" in current_path %} {% set title = "Root Index" 10 - %} {% elif config.title %} {% set title = config.title %} {% endif %} {% if 8 + title = section.title %} {% elif term %} {% set title = term.name %} 9 + {% elif current_path and "tags" in current_path %} {% set title = "index of /tags" 10 + %} {% elif config.extra.greeting %} {% set title = config.extra.greeting ~ " :: zera" %} {% endif %} {% if 11 11 page.extra.author %} {% set author = page.extra.author %} {% elif 12 12 section.extra.author %} {% set author = section.extra.author %} {% elif 13 13 config.extra.author %} {% set author = config.extra.author %} {% endif %} {% if