mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
fix: use timestamp filter for buildtime instead of date filter
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
{% set mentions = webmentions | webmentionsForUrl(page.url, urlAliases) %}
|
||||
{% set absoluteUrl = site.url + page.url %}
|
||||
{% set buildTimestamp = "now" | date("x") %}
|
||||
{% set buildTimestamp = "" | timestamp %}
|
||||
|
||||
{# Data container for client-side JS to fetch new webmentions #}
|
||||
<div data-webmentions
|
||||
|
||||
@@ -223,6 +223,9 @@ export default function (eleventyConfig) {
|
||||
}
|
||||
});
|
||||
|
||||
// Current timestamp filter (for client-side JS buildtime)
|
||||
eleventyConfig.addFilter("timestamp", () => Date.now());
|
||||
|
||||
// Date filter (for sidebar dates)
|
||||
eleventyConfig.addFilter("date", (dateObj, format) => {
|
||||
if (!dateObj) return "";
|
||||
|
||||
Reference in New Issue
Block a user