Adjust intendation in Nunjucks templates

This commit is contained in:
Leilukin 2025-04-10 22:40:57 +08:00 committed by Helen Chong
parent ae6ad1d66f
commit 4e745d3b97
17 changed files with 192 additions and 192 deletions

View File

@ -1,6 +1,6 @@
{% extends "global/footer.njk" %}
{% block footerContent %}
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} • Shrine Launched: 16 February 2023</p>
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} • Shrine Launched: 16 February 2023</p>
{% endblock %}

View File

@ -1,46 +1,46 @@
{% extends "global/hero.njk" %}
{% block heroImg %}
<picture>
<source srcset="/assets/shrines/asummersend/images/asummersend-header-320.avif" media="(orientation: landscape)" />
<img src="/assets/shrines/asummersend/images/asummersend-header.avif" alt="Banner of A Summers End — Hong Kong 1986 Shrine" />
</picture>
<picture>
<source srcset="/assets/shrines/asummersend/images/asummersend-header-320.avif" media="(orientation: landscape)" />
<img src="/assets/shrines/asummersend/images/asummersend-header.avif" alt="Banner of A Summers End — Hong Kong 1986 Shrine" />
</picture>
{% endblock %}
{% block eventScript %}
const todayEvent = getTodayEvent();
const todayEvent = getTodayEvent();
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
const aseReleaseDate = new Date("2020-04-23").getFullYear();
const aseAnniversary = year - aseReleaseDate;
const aseReleaseDate = new Date("2020-04-23").getFullYear();
const aseAnniversary = year - aseReleaseDate;
if (month === 2 && day === 16)
return `
Today is Michelle Cheung's birthday. Happy Birthday Michelle!
`;
else if (month === 4 && day === 23)
return `
Today is the ${aseAnniversary}-year anniversary of the release of {% cite "A Summers End — Hong Kong 1986" %}!
`;
else if (month === 8 && day === 9)
return `
Today is Cecelia Cortes' birthday. Happy Birthday Cecelia!
`;
else if (month === 12 && day === 28)
return `
Today is Sam Wong's birthday. Happy Birthday Sam!
`;
else
return null;
}
{% endblock %}
if (month === 2 && day === 16)
return `
Today is Michelle Cheung's birthday. Happy Birthday Michelle!
`;
else if (month === 4 && day === 23)
return `
Today is the ${aseAnniversary}-year anniversary of the release of {% cite "A Summers End — Hong Kong 1986" %}!
`;
else if (month === 8 && day === 9)
return `
Today is Cecelia Cortes' birthday. Happy Birthday Cecelia!
`;
else if (month === 12 && day === 28)
return `
Today is Sam Wong's birthday. Happy Birthday Sam!
`;
else
return null;
}
{% endblock %}

View File

@ -1,12 +1,12 @@
{% extends "global/shrineinfo.njk" %}
{% block shrineAbout %}
<p>Welcome to {{ sitemeta.siteAuthor.name }}'s shrine for {% cite "A Summers End — Hong Kong 1986" %}, an indie visual novel developed by Oracle and Bone. Set in 1980s Hong Kong, it tells of a love story between two women.</p>
<p>Welcome to {{ sitemeta.siteAuthor.name }}'s shrine for {% cite "A Summers End — Hong Kong 1986" %}, an indie visual novel developed by Oracle and Bone. Set in 1980s Hong Kong, it tells of a love story between two women.</p>
{% endblock %}
{% block shrineLinks %}
<li><a href="https://www.asummersend.com/">Official Website</a>
</li>
<li><a href="https://store.steampowered.com/app/1111370/A_Summers_End__Hong_Kong_1986/">Steam</a></li>
<li><a href="https://oracleandbone.itch.io/a-summers-end">itch.io</a></li>
<li><a href="https://www.asummersend.com/">Official Website</a>
</li>
<li><a href="https://store.steampowered.com/app/1111370/A_Summers_End__Hong_Kong_1986/">Steam</a></li>
<li><a href="https://oracleandbone.itch.io/a-summers-end">itch.io</a></li>
{% endblock %}

View File

@ -1,6 +1,6 @@
{% extends "global/footer.njk" %}
{% block footerContent %}
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} • Shrine Launched: 3 August 2023</p>
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} • Shrine Launched: 3 August 2023</p>
{% endblock %}

View File

@ -1,40 +1,40 @@
{% extends "global/hero.njk" %}
{% block heroImg %}
<picture>
<source srcset="/assets/shrines/cassettebeasts/images/cassettebeasts-header-320.avif" media="(orientation: landscape)" />
<img src="/assets/shrines/cassettebeasts/images/cassettebeasts-header-640.avif" alt="Banner of Cassette Beasts Shrine" />
</picture>
<picture>
<source srcset="/assets/shrines/cassettebeasts/images/cassettebeasts-header-320.avif" media="(orientation: landscape)" />
<img src="/assets/shrines/cassettebeasts/images/cassettebeasts-header-640.avif" alt="Banner of Cassette Beasts Shrine" />
</picture>
{% endblock %}
{% block eventScript %}
const todayEvent = getTodayEvent();
const todayEvent = getTodayEvent();
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
const cbReleaseDate = new Date("2023-04-26").getFullYear();
const pierReleaseDate = new Date("2023-10-04").getFullYear();
const cbAnniversary = year - cbReleaseDate;
const pierAnniversary = year - pierReleaseDate;
const cbReleaseDate = new Date("2023-04-26").getFullYear();
const pierReleaseDate = new Date("2023-10-04").getFullYear();
const cbAnniversary = year - cbReleaseDate;
const pierAnniversary = year - pierReleaseDate;
if (month === 4 && day === 26)
return `
Today is the ${cbAnniversary}-year anniversary of the release of {% cite "Cassette Beasts" %}!
`;
else if (month === 10 && day === 4)
return `
Today is the ${pierAnniversary}-year anniversary of the release of <cite>Pier of the Unknown</cite>, the first DLC expansion of {% cite "Cassette Beasts" %}!
`;
else
return null;
}
{% endblock %}
if (month === 4 && day === 26)
return `
Today is the ${cbAnniversary}-year anniversary of the release of {% cite "Cassette Beasts" %}!
`;
else if (month === 10 && day === 4)
return `
Today is the ${pierAnniversary}-year anniversary of the release of <cite>Pier of the Unknown</cite>, the first DLC expansion of {% cite "Cassette Beasts" %}!
`;
else
return null;
}
{% endblock %}

View File

@ -1,14 +1,14 @@
{% extends "global/shrineinfo.njk" %}
{% block shrineAbout %}
<p>Welcome to {{ sitemeta.siteAuthor.name }}'s shrine for {% cite "Cassette Beasts" %}, an indie monster collecting turn-based open-world role-playing video game developed by Bytten Studio and published by Raw Fury.</p>
<p>Welcome to {{ sitemeta.siteAuthor.name }}'s shrine for {% cite "Cassette Beasts" %}, an indie monster collecting turn-based open-world role-playing video game developed by Bytten Studio and published by Raw Fury.</p>
{% endblock %}
{% block shrineLinks %}
<li><a href="https://www.cassettebeasts.com/">Official Website</a>
</li>
<li><a href="https://wiki.cassettebeasts.com/">Official Wiki</a></li>
<li><a href="https://store.steampowered.com/app/1321440/Cassette_Beasts/">Steam</a></li>
<li><a href="https://bytten-studio.com/">Bytten Studio</a></li>
<li><a href="https://fan.leilukin.com/cassettebeasts/">Cassette Beasts fanlisting</a></li>
<li><a href="https://www.cassettebeasts.com/">Official Website</a>
</li>
<li><a href="https://wiki.cassettebeasts.com/">Official Wiki</a></li>
<li><a href="https://store.steampowered.com/app/1321440/Cassette_Beasts/">Steam</a></li>
<li><a href="https://bytten-studio.com/">Bytten Studio</a></li>
<li><a href="https://fan.leilukin.com/cassettebeasts/">Cassette Beasts fanlisting</a></li>
{% endblock %}

View File

@ -2,7 +2,7 @@
<div class="hero__top-bar hidden"></div>
<div class="hero__img">
{% block heroImg %}
{{ heroImg }}
{{ heroImg }}
{% endblock %}
</div>
</header>

View File

@ -2,12 +2,12 @@
<div class="shrine__info sidebar--sticky">
<h2>About</h2>
{% block shrineAbout %}
{{ shrineAbout }}
{{ shrineAbout }}
{% endblock %}
<h3>Links</h3>
<ul>
{% block shrineLinks %}
{{ shrineLinks }}
{{ shrineLinks }}
{% endblock %}
</ul>
</div>

View File

@ -1,29 +1,29 @@
{% extends "global/footer.njk" %}
{% block footerContent %}
<h2 class="visually-hidden">Footer Navigation:</h2>
{% set currentUrl %}{{ page.url }}{% endset %}
<ul class="inline-nav footer__links">
<li>
<a href="{{ sitemeta.feedPath }}"><svg class="inline-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32c229.8 0 416 186.2 416 416c0 17.7-14.3 32-32 32s-32-14.3-32-32C384 253.6 226.4 96 32 96C14.3 96 0 81.7 0 64zM0 416a64 64 0 1 1 128 0A64 64 0 1 1 0 416zM32 160c159.1 0 288 128.9 288 288c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-123.7-100.3-224-224-224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"/></svg>RSS Feed</a>
</li>
<li><a
{% if currentUrl === "/sitemap/" %}aria-current="page"{% endif %}
href="/sitemap/
">Site Map</a></li>
{%- for link in collections["footer links"] -%}
<li><a
{% if link.url == page.url %}aria-current="page"{% endif %}
href="{{ link.url }}"
>{{ link.data.title }}</a></li>
{%- endfor -%}
{%- for statement in collections.statements -%}
<li><a
{% if statement.url == page.url %}aria-current="page"{% endif %}
href="{{ statement.url }}"
>{{ statement.data.title }}</a></li>
{%- endfor -%}
</ul>
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} since 11 September 2022</p>
<h2 class="visually-hidden">Footer Navigation:</h2>
{% set currentUrl %}{{ page.url }}{% endset %}
<ul class="inline-nav footer__links">
<li>
<a href="{{ sitemeta.feedPath }}"><svg class="inline-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32c229.8 0 416 186.2 416 416c0 17.7-14.3 32-32 32s-32-14.3-32-32C384 253.6 226.4 96 32 96C14.3 96 0 81.7 0 64zM0 416a64 64 0 1 1 128 0A64 64 0 1 1 0 416zM32 160c159.1 0 288 128.9 288 288c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-123.7-100.3-224-224-224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"/></svg>RSS Feed</a>
</li>
<li><a
{% if currentUrl === "/sitemap/" %}aria-current="page"{% endif %}
href="/sitemap/
">Site Map</a></li>
{%- for link in collections["footer links"] -%}
<li><a
{% if link.url == page.url %}aria-current="page"{% endif %}
href="{{ link.url }}"
>{{ link.data.title }}</a></li>
{%- endfor -%}
{%- for statement in collections.statements -%}
<li><a
{% if statement.url == page.url %}aria-current="page"{% endif %}
href="{{ statement.url }}"
>{{ statement.data.title }}</a></li>
{%- endfor -%}
</ul>
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} since 11 September 2022</p>
{% endblock %}

View File

@ -1,7 +1,7 @@
{% extends "global/hero.njk" %}
{% block heroImg %}
<img fetchpriority="high" src="/assets/leilukin/Leilukins-Hub-website-banner.avif" alt="Banner of Leilukin's Hub" width="900" height="300">
<img fetchpriority="high" src="/assets/leilukin/Leilukins-Hub-website-banner.avif" alt="Banner of Leilukin's Hub" width="900" height="300">
{% endblock %}
{% set heroDropShadow %}

View File

@ -13,27 +13,27 @@
{%- css %}#statuscafe-content { margin-bottom: 0.5em; }{% endcss %}
{%- js %}
const statusCafeContent = document.getElementById("statuscafe-content");
statusCafeContent.innerHTML = `
<p>Fetching data from status.cafe...</p>
`;
const statusCafeContent = document.getElementById("statuscafe-content");
statusCafeContent.innerHTML = `
<p>Fetching data from status.cafe...</p>
`;
const fetchStatusCafe = async () => {
try {
const res = await fetch('https://status.cafe/users/leilukin/status.json');
const data = await res.json();
const fetchStatusCafe = async () => {
try {
const res = await fetch('https://status.cafe/users/leilukin/status.json');
const data = await res.json();
if (!data.content.length) {
document.getElementById("statuscafe-content").innerHTML = "No status yet."
return;
}
document.getElementById("statuscafe-userinfo").innerHTML = data.face + ' ' + data.timeAgo;
statusCafeContent.innerHTML = data.content;
} catch (error) {
console.error(error);
document.getElementById("statuscafe-content").textContent = `[ERROR] ${error}`;
if (!data.content.length) {
document.getElementById("statuscafe-content").innerHTML = "No status yet."
return;
}
};
fetchStatusCafe();
{% endjs %}
document.getElementById("statuscafe-userinfo").innerHTML = data.face + ' ' + data.timeAgo;
statusCafeContent.innerHTML = data.content;
} catch (error) {
console.error(error);
document.getElementById("statuscafe-content").textContent = `[ERROR] ${error}`;
}
};
fetchStatusCafe();
{% endjs %}

View File

@ -1,6 +1,6 @@
{% extends "global/footer.njk" %}
{% block footerContent %}
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} • Shrine Launched: 21 November 2024</p>
<p>Made with ♥ by {{ sitemeta.siteAuthor.name }} • Shrine Launched: 21 November 2024</p>
{% endblock %}

View File

@ -1,34 +1,34 @@
{% extends "global/hero.njk" %}
{% block heroImg %}
<picture>
<source srcset="/assets/shrines/pokemonoras/images/pokemonoras-header-320.avif" media="(orientation: landscape)" />
<img src="/assets/shrines/pokemonoras/images/pokemonoras-header-640.avif" alt="Banner of Pokémon Omega Ruby and Alpha Sapphire Shrine" />
</picture>
<picture>
<source srcset="/assets/shrines/pokemonoras/images/pokemonoras-header-320.avif" media="(orientation: landscape)" />
<img src="/assets/shrines/pokemonoras/images/pokemonoras-header-640.avif" alt="Banner of Pokémon Omega Ruby and Alpha Sapphire Shrine" />
</picture>
{% endblock %}
{% block eventScript %}
const todayEvent = getTodayEvent();
const todayEvent = getTodayEvent();
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
const orasReleaseDate = new Date("2014-11-21").getFullYear();
const orasAnniversary = year - orasReleaseDate;
const orasReleaseDate = new Date("2014-11-21").getFullYear();
const orasAnniversary = year - orasReleaseDate;
if (month === 11 && day === 21)
return `
Today is the ${orasAnniversary}-year anniversary of the release of <cite>Pokémon Omega Ruby"</cite> and <cite>Alpha Sapphire</cite>!
`;
else
return null;
}
{% endblock %}
if (month === 11 && day === 21)
return `
Today is the ${orasAnniversary}-year anniversary of the release of <cite>Pokémon Omega Ruby"</cite> and <cite>Alpha Sapphire</cite>!
`;
else
return null;
}
{% endblock %}

View File

@ -1,10 +1,10 @@
{% extends "global/shrineinfo.njk" %}
{% block shrineAbout %}
<p>Welcome to {{ sitemeta.siteAuthor.name }}'s shrine for {% cite "Pokémon Omega Ruby and Alpha Sapphire" %}, remakes of the 2002 Game Boy Advance role-playing video games {% cite "Pokémon Ruby" %} and {% cite "Pokémon Sapphire" %}. The games are part of the sixth generation of the {% cite "Pokémon" %} main series of video games, developed by Game Freak and published by The Pokémon Company and Nintendo for the Nintendo 3DS.</p>
<p>Welcome to {{ sitemeta.siteAuthor.name }}'s shrine for {% cite "Pokémon Omega Ruby and Alpha Sapphire" %}, remakes of the 2002 Game Boy Advance role-playing video games {% cite "Pokémon Ruby" %} and {% cite "Pokémon Sapphire" %}. The games are part of the sixth generation of the {% cite "Pokémon" %} main series of video games, developed by Game Freak and published by The Pokémon Company and Nintendo for the Nintendo 3DS.</p>
{% endblock %}
{% block shrineLinks %}
<li><a href="https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_Omega_Ruby_and_Alpha_Sapphire">Bulbapedia</a></li>
<li><a href="https://pkmn.redcrown.net/hoenn/"><cite>Pokémon Ruby</cite>, <cite>Sapphire</cite>, <cite>Omega Ruby</cite> and <cite>Alpha Sapphire</cite> fanlisting</a></li>
<li><a href="https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_Omega_Ruby_and_Alpha_Sapphire">Bulbapedia</a></li>
<li><a href="https://pkmn.redcrown.net/hoenn/"><cite>Pokémon Ruby</cite>, <cite>Sapphire</cite>, <cite>Omega Ruby</cite> and <cite>Alpha Sapphire</cite> fanlisting</a></li>
{% endblock %}

View File

@ -1,6 +1,6 @@
{% extends "global/footer.njk" %}
{% block footerContent %}
<p>Made with ♥ and the Force by {{ sitemeta.siteAuthor.name }} • Shrine Launched: 17 February 2023</p>
<p>Made with ♥ and the Force by {{ sitemeta.siteAuthor.name }} • Shrine Launched: 17 February 2023</p>
{% endblock %}

View File

@ -1,40 +1,40 @@
{% extends "global/hero.njk" %}
{% block heroImg %}
<picture>
<source srcset="/assets/shrines/starwarskotor/images/swkotor-header-320.avif" media="(orientation: landscape)" />
<img src="/assets/shrines/starwarskotor/images/swkotor-header.avif" alt="anner of Star Wars: Knights of the Old Republic Shrine" />
</picture>
<picture>
<source srcset="/assets/shrines/starwarskotor/images/swkotor-header-320.avif" media="(orientation: landscape)" />
<img src="/assets/shrines/starwarskotor/images/swkotor-header.avif" alt="anner of Star Wars: Knights of the Old Republic Shrine" />
</picture>
{% endblock %}
{% block eventScript %}
const todayEvent = getTodayEvent();
const todayEvent = getTodayEvent();
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const year = date.getFullYear();
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
const kotor1Anniversary = year - kotor1ReleaseDate;
const kotor2Anniversary = year - kotor2ReleaseDate;
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
const kotor1Anniversary = year - kotor1ReleaseDate;
const kotor2Anniversary = year - kotor2ReleaseDate;
if (month === 7 && day === 15)
return `
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
`;
else if (month === 12 && day === 6)
return `
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
`;
else
return null;
}
{% endblock %}
if (month === 7 && day === 15)
return `
Today is the ${kotor1Anniversary}-year anniversary of the release of <cite>Star Wars: Knihgts of the Old Republic</cite>
`;
else if (month === 12 && day === 6)
return `
Today is the ${kotor2Anniversary}-year anniversary of the release of <cite>Star Wars: Knights of the Old Republic II — The Sith Lords</cite>
`;
else
return null;
}
{% endblock %}

View File

@ -1,11 +1,11 @@
{% extends "global/shrineinfo.njk" %}
{% block shrineAbout %}
<p>Welcome to {{ sitemeta.siteAuthor.name }}'s shrine for {% cite "Star Wars: Knights of the Old Republic" %}, a series of role-playing video games set in the {% cite "Star Wars" %} universe, taking place almost 4,000 years before the events of the Skywalker film saga.</p>
<p>Welcome to {{ sitemeta.siteAuthor.name }}'s shrine for {% cite "Star Wars: Knights of the Old Republic" %}, a series of role-playing video games set in the {% cite "Star Wars" %} universe, taking place almost 4,000 years before the events of the Skywalker film saga.</p>
{% endblock %}
{% block shrineLinks %}
<li><a href="https://kotor.neocities.org/">KOTOR Community Portal</a></li>
<li><a href="https://glitterskies.org/kotor/"><cite>Star Wars: KotOR</cite> fanlisting</a></li>
<li><a href="https://glitterskies.org/kotor2/"><cite>Star Wars: KotOR II</cite> fanlisting</a></li>
<li><a href="https://kotor.neocities.org/">KOTOR Community Portal</a></li>
<li><a href="https://glitterskies.org/kotor/"><cite>Star Wars: KotOR</cite> fanlisting</a></li>
<li><a href="https://glitterskies.org/kotor2/"><cite>Star Wars: KotOR II</cite> fanlisting</a></li>
{% endblock %}