more calendar stuff

This commit is contained in:
inherentlee committed 2026-09-27 13:52:28 -07:00
1 parent d4311335a2
commit dd0019a666
3 files changed
+20 -4

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
<h3>{{ event.data.title }}</h3>
<p>
<time datetime="{{ event.data.date | htmlDateString }}">{{ event.data.date | readableDateTime }}</time>
</p>
<p>{{ event.content | safe }}</p>
{% if event.data.ics %}
<p><a href="{{ event.data.ics }}">Add {{ event.data.title }} to your calendar</a></p>
{% endif %}
+10 -2
View File
@@ -2,6 +2,8 @@ import { HtmlBasePlugin } from "@11ty/eleventy";
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
import { consolePlus } from 'eleventy-plugin-console-plus';
import { attrs } from "@mdit/plugin-attrs";
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
import markdownitIdAttributes from "markdown-it-anchor";
@@ -47,9 +49,13 @@ export default async function (eleventyConfig) {
/* Passthroughs */
eleventyConfig
.addPassthroughCopy("favicon.ico")
.addPassthroughCopy("robots.txt");
.addPassthroughCopy("robots.txt")
.addPassthroughCopy("ics");
/* Plugins */
/* Debug */
eleventyConfig.addPlugin(consolePlus);
/* HTML base */
eleventyConfig.addPlugin(HtmlBasePlugin);
@@ -81,7 +87,8 @@ export default async function (eleventyConfig) {
/* Permalink: true handling */
eleventyConfig.addPreprocessor("permalinkTrue", "md", (data, content) => {
if (data.permalink === true) delete data.permalink;
if (data.permalink === true)
data.permalink = `/${eleventyConfig.getFilter("slugify")(data.title)}/index.html`;
return content;
})
@@ -92,6 +99,7 @@ export default async function (eleventyConfig) {
/* Watch when serving */
eleventyConfig.addWatchTarget("css");
eleventyConfig.addWatchTarget("js");
}
export const config = {
+2 -2
View File
@@ -6,7 +6,7 @@ title: Calendar of Events
{% for event in collections.events | sortByDate %}
{% if not event.data.date | inThePast %}
<p>{{ event.data.title }}</p>
{% include "event.njk" %}
{% endif %}
{% endfor %}
@@ -14,6 +14,6 @@ title: Calendar of Events
{% for event in collections.events | sortByDate | reverse %}
{% if event.data.date | inThePast %}
<p>{{ event.data.title }}</p>
{% include "event.njk" %}
{% endif %}
{% endfor %}