Skip to content

Commit 93a68bf

Browse files
authored
Merge pull request #325 from stride3d/master
Deploy latest website updates to production
2 parents be7e8c4 + b64c592 commit 93a68bf

File tree

5 files changed

+165
-154
lines changed

5 files changed

+165
-154
lines changed

.eleventy.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import markdownItAnchor from 'markdown-it-anchor'
99
import markdownItToc from 'markdown-it-table-of-contents'
1010
import pluginRss from '@11ty/eleventy-plugin-rss'
1111
import eleventyFetch from '@11ty/eleventy-fetch'
12+
import { DateTime } from 'luxon';
1213

1314
export default function (eleventyConfig) {
1415

@@ -105,11 +106,17 @@ export default function (eleventyConfig) {
105106
return text;
106107
});
107108

108-
// Add custome filters
109109
eleventyConfig.addFilter("md", function (content = "") {
110110
return markdownIt({ html: true }).render(content);
111111
});
112112

113+
eleventyConfig.addFilter("customDateToRfc822", (dateObj) => {
114+
const dt = DateTime.fromJSDate(dateObj, { zone: 'utc' });
115+
const formattedDate = dt.toFormat("EEE, dd MMM yyyy HH:mm:ss");
116+
const offset = dt.toFormat("ZZ").replace(":", "");
117+
return `${formattedDate} ${offset}`;
118+
});
119+
113120
eleventyConfig.addShortcode("img", function (title, url) {
114121
return `<img alt="${title}" src="${url}" class="img-fluid mb-3" loading="lazy" data-src="${url}">`;
115122
});

feed.njk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
<link>{{ site.url }}</link>
1313
<link>{{ permalink | absoluteUrl(site.url) }}</link>
1414
<atom:link href="{{ permalink | absoluteUrl(site.url) }}" rel="self" type="application/rss+xml"/>
15-
<pubDate>{{ collections.blog | getNewestCollectionItemDate | dateToRfc822 }}</pubDate>
16-
<lastBuildDate>{{ collections.blog | getNewestCollectionItemDate | dateToRfc822 }}</lastBuildDate>
15+
<pubDate>{{ collections.blog | getNewestCollectionItemDate | customDateToRfc822 }}</pubDate>
16+
<lastBuildDate>{{ collections.blog | getNewestCollectionItemDate | customDateToRfc822 }}</lastBuildDate>
1717
<generator>{{ site.engine }}</generator>
1818
{%- for post in collections.blog | reverse %}
1919
{%- set absolutePostUrl = post.url | absoluteUrl(site.url) %}
2020
{%- set author = site.authors[post.data.author] %}
2121
<item>
2222
<title>{{ post.data.title | escape }}</title>
2323
<description>{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description>
24-
<pubDate>{{ post.date | dateToRfc822 }}</pubDate>
24+
<pubDate>{{ post.date | customDateToRfc822 }}</pubDate>
2525
<link>{{ absolutePostUrl }}</link>
2626
<guid isPermaLink="true">{{ absolutePostUrl }}</guid>
2727
{%- if post.data.image_thumb -%}

0 commit comments

Comments
 (0)