Skip to content

Commit

Permalink
Merge pull request #324 from stride3d/master
Browse files Browse the repository at this point in the history
Deploy latest website updates to staging
  • Loading branch information
VaclavElias authored Dec 22, 2024
2 parents 1db3460 + b64c592 commit 26a7d3f
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 159 deletions.
9 changes: 8 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import markdownItAnchor from 'markdown-it-anchor'
import markdownItToc from 'markdown-it-table-of-contents'
import pluginRss from '@11ty/eleventy-plugin-rss'
import eleventyFetch from '@11ty/eleventy-fetch'
import { DateTime } from 'luxon';

export default function (eleventyConfig) {

Expand Down Expand Up @@ -105,11 +106,17 @@ export default function (eleventyConfig) {
return text;
});

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

eleventyConfig.addFilter("customDateToRfc822", (dateObj) => {
const dt = DateTime.fromJSDate(dateObj, { zone: 'utc' });
const formattedDate = dt.toFormat("EEE, dd MMM yyyy HH:mm:ss");
const offset = dt.toFormat("ZZ").replace(":", "");
return `${formattedDate} ${offset}`;
});

eleventyConfig.addShortcode("img", function (title, url) {
return `<img alt="${title}" src="${url}" class="img-fluid mb-3" loading="lazy" data-src="${url}">`;
});
Expand Down
6 changes: 3 additions & 3 deletions feed.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
<link>{{ site.url }}</link>
<link>{{ permalink | absoluteUrl(site.url) }}</link>
<atom:link href="{{ permalink | absoluteUrl(site.url) }}" rel="self" type="application/rss+xml"/>
<pubDate>{{ collections.blog | getNewestCollectionItemDate | dateToRfc822 }}</pubDate>
<lastBuildDate>{{ collections.blog | getNewestCollectionItemDate | dateToRfc822 }}</lastBuildDate>
<pubDate>{{ collections.blog | getNewestCollectionItemDate | customDateToRfc822 }}</pubDate>
<lastBuildDate>{{ collections.blog | getNewestCollectionItemDate | customDateToRfc822 }}</lastBuildDate>
<generator>{{ site.engine }}</generator>
{%- for post in collections.blog | reverse %}
{%- set absolutePostUrl = post.url | absoluteUrl(site.url) %}
{%- set author = site.authors[post.data.author] %}
<item>
<title>{{ post.data.title | escape }}</title>
<description>{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</description>
<pubDate>{{ post.date | dateToRfc822 }}</pubDate>
<pubDate>{{ post.date | customDateToRfc822 }}</pubDate>
<link>{{ absolutePostUrl }}</link>
<guid isPermaLink="true">{{ absolutePostUrl }}</guid>
{%- if post.data.image_thumb -%}
Expand Down
Loading

0 comments on commit 26a7d3f

Please sign in to comment.