Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy latest website updates to staging #324

Merged
merged 7 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading