Rename niceDate variable to formatDate

This commit is contained in:
Helen Chong 2024-05-10 10:34:12 +08:00
parent e21fbcfc9f
commit 4ed5a38efc
15 changed files with 19 additions and 19 deletions

View File

@ -4,7 +4,7 @@
<subtitle>Leilukin&#39;s personal website.</subtitle>
<link href="https://leilukin.neocities.org/feed.xml" rel="self"/>
<link href="https://leilukin.neocities.org"/>
<updated>2024-05-10T00:16:30Z</updated>
<updated>2024-05-10T02:32:54Z</updated>
<id>https://leilukin.neocities.org</id>
<author>
<name>Leilukin</name>

View File

@ -46,7 +46,7 @@ module.exports = function (eleventyConfig) {
day: 'numeric',
};
const dateTimeLocale = new Intl.DateTimeFormat("en-GB", dateOptions);
eleventyConfig.addFilter("niceDate", function(date) {
eleventyConfig.addFilter("formatDate", function(date) {
return dateTimeLocale.format(date);
});

View File

@ -13,9 +13,9 @@
{% if isArticle %}
<h1>{{ articleTitle }}</h1>
<div class="article__info">
<p>Posted on {{ date | niceDate }} by {{ sitemeta.siteAuthor.name }}
<p>Posted on {{ date | formatDate }} by {{ sitemeta.siteAuthor.name }}
{% if updated %}
• Last updated on {{ updated | niceDate }}</p>
• Last updated on {{ updated | formatDate }}</p>
{% endif %}
{% if categories %}
<p>Categories:

View File

@ -9,7 +9,7 @@
{% endif %}
</a>
</p>
<time>{{ content.date | niceDate }}</time>
<time>{{ content.date | formatDate }}</time>
</li>
{% endfor %}
</ul>

View File

@ -1,7 +1,7 @@
<article>
{% for log in changelogList | reverse %}
<div class="heading-wrapper h2">
<h2 id="{{ log.fileSlug }}">{{ log.date | niceDate }}</h2>
<h2 id="{{ log.fileSlug }}">{{ log.date | formatDate }}</h2>
<a class="heading-anchor" href="#{{ log.fileSlug }}" aria-labelledby="{{ log.fileSlug }}"><span hidden="">#</span></a>
</div>
{{ log.templateContent | safe }}

View File

@ -20,7 +20,7 @@ eleventyNavigation:
{% endif %}
</a>
</h2>
<time>{{ post.date | niceDate }}</time>
<time>{{ post.date | formatDate }}</time>
</li>
{% endfor %}
</ul>

View File

@ -19,7 +19,7 @@ eleventyNavigation:
<article>
<h2>Latest Changelogs</h2>
{% for log in changelogs %}
<h3 class="date-style">{{ log.data.date | niceDate }}</h3>
<h3 class="date-style">{{ log.data.date | formatDate }}</h3>
{{ log.templateContent | safe }}
{%- endfor %}
</article>

View File

@ -2,6 +2,6 @@
"tags": ["changelogs", "feed items"],
"permalink": false,
"eleventyComputed": {
"title": "Changelog: {{ date | niceDate }}"
"title": "Changelog: {{ date | formatDate }}"
}
}

View File

@ -29,7 +29,7 @@ eleventyNavigation:
<h2>Updates</h2>
<div class="text-box">
{% for log in collections["changelogs"] | reverse | itemLimit(1) %}
<h3 class="date-style">{{ log.data.date | niceDate }}:</h3>
<h3 class="date-style">{{ log.data.date | formatDate }}:</h3>
{{ log.templateContent | safe }}
{%- endfor %}
<p><a href="/changelogs">View all site changelogs</a></p>

View File

@ -16,7 +16,7 @@ Articles I have written.
{%- for article in collections["my articles"] -%}
<li>
<p><a href="{{ article.url }}">{{ article.data.articleTitle }}</a></p>
<time>{{ article.date | niceDate }}</time>
<time>{{ article.date | formatDate }}</time>
</li>
{%- endfor -%}
</ul>
@ -32,7 +32,7 @@ Articles featuring other people's interview with me.
{%- for article in collections["featured articles"] -%}
<li>
<p><a href="{{ article.url }}">{{ article.data.articleTitle }}</a></p>
<time>{{ article.date | niceDate }}</time>
<time>{{ article.date | formatDate }}</time>
</li>
{%- endfor -%}
</ul>

View File

@ -26,7 +26,7 @@ eleventyNavigation:
{% endif %}
</a>
</h2>
<time>{{ post.date | niceDate }}</time>
<time>{{ post.date | formatDate }}</time>
<p>{{ post.data.desc }}</p>
</li>
{% endfor %}

View File

@ -9,7 +9,7 @@ eleventyNavigation:
order: 3
---
*This page was last updated on {{ updated | niceDate }}.*
*This page was last updated on {{ updated | formatDate }}.*
This is my [/now page](https://nownownow.com/about). You can find more pages like this at [nownownow.com](https://nownownow.com/).

View File

@ -18,7 +18,7 @@ eleventyNavigation:
{%- for article in collections["cassette beasts articles"] -%}
<li>
<p><a href="{{ article.url }}">{{ article.data.articleTitle }}</a></p>
<time>{{ article.date | niceDate }}</time>
<time>{{ article.date | formatDate }}</time>
</li>
{%- endfor -%}
</ul>

View File

@ -18,7 +18,7 @@ eleventyNavigation:
{%- for article in collections["kotor both articles"] -%}
<li>
<p><a href="{{ article.url }}">{{ article.data.articleTitle }}</a></p>
<time>{{ article.date | niceDate }}</time>
<time>{{ article.date | formatDate }}</time>
</li>
{%- endfor -%}
</ul>
@ -28,7 +28,7 @@ eleventyNavigation:
{%- for article in collections["kotor 1 articles"] -%}
<li>
<p><a href="{{ article.url }}">{{ article.data.articleTitle }}</a></p>
<time>{{ article.date | niceDate }}</time>
<time>{{ article.date | formatDate }}</time>
</li>
{%- endfor -%}
</ul>
@ -38,7 +38,7 @@ eleventyNavigation:
{%- for article in collections["kotor 2 articles"] -%}
<li>
<p><a href="{{ article.url }}">{{ article.data.articleTitle }}</a></p>
<time>{{ article.date | niceDate }}</time>
<time>{{ article.date | formatDate }}</time>
</li>
{%- endfor -%}
</ul>

View File

@ -18,7 +18,7 @@ eleventyNavigation:
{%- for article in collections["kotor guides"] -%}
<li>
<p><a href="{{ article.url }}">{{ article.data.articleTitle }}</a></p>
<time>{{ article.date | niceDate }}</time>
<time>{{ article.date | formatDate }}</time>
</li>
{%- endfor -%}
</ul>