generated from inherentlee/11ty
more calendar stuff
This commit is contained in:
1 parent
d4311335a2
commit
dd0019a666
3 files changed
+20
-4
No files matched your search
@@ -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
@@ -2,6 +2,8 @@ import { HtmlBasePlugin } from "@11ty/eleventy";
|
|||||||
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
||||||
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
|
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
|
||||||
|
|
||||||
|
import { consolePlus } from 'eleventy-plugin-console-plus';
|
||||||
|
|
||||||
import { attrs } from "@mdit/plugin-attrs";
|
import { attrs } from "@mdit/plugin-attrs";
|
||||||
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
|
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
|
||||||
import markdownitIdAttributes from "markdown-it-anchor";
|
import markdownitIdAttributes from "markdown-it-anchor";
|
||||||
@@ -47,9 +49,13 @@ export default async function (eleventyConfig) {
|
|||||||
/* Passthroughs */
|
/* Passthroughs */
|
||||||
eleventyConfig
|
eleventyConfig
|
||||||
.addPassthroughCopy("favicon.ico")
|
.addPassthroughCopy("favicon.ico")
|
||||||
.addPassthroughCopy("robots.txt");
|
.addPassthroughCopy("robots.txt")
|
||||||
|
.addPassthroughCopy("ics");
|
||||||
|
|
||||||
/* Plugins */
|
/* Plugins */
|
||||||
|
/* Debug */
|
||||||
|
eleventyConfig.addPlugin(consolePlus);
|
||||||
|
|
||||||
/* HTML base */
|
/* HTML base */
|
||||||
eleventyConfig.addPlugin(HtmlBasePlugin);
|
eleventyConfig.addPlugin(HtmlBasePlugin);
|
||||||
|
|
||||||
@@ -81,7 +87,8 @@ export default async function (eleventyConfig) {
|
|||||||
|
|
||||||
/* Permalink: true handling */
|
/* Permalink: true handling */
|
||||||
eleventyConfig.addPreprocessor("permalinkTrue", "md", (data, content) => {
|
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;
|
return content;
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -92,6 +99,7 @@ export default async function (eleventyConfig) {
|
|||||||
|
|
||||||
/* Watch when serving */
|
/* Watch when serving */
|
||||||
eleventyConfig.addWatchTarget("css");
|
eleventyConfig.addWatchTarget("css");
|
||||||
|
eleventyConfig.addWatchTarget("js");
|
||||||
}
|
}
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ title: Calendar of Events
|
|||||||
|
|
||||||
{% for event in collections.events | sortByDate %}
|
{% for event in collections.events | sortByDate %}
|
||||||
{% if not event.data.date | inThePast %}
|
{% if not event.data.date | inThePast %}
|
||||||
<p>{{ event.data.title }}</p>
|
{% include "event.njk" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
@@ -14,6 +14,6 @@ title: Calendar of Events
|
|||||||
|
|
||||||
{% for event in collections.events | sortByDate | reverse %}
|
{% for event in collections.events | sortByDate | reverse %}
|
||||||
{% if event.data.date | inThePast %}
|
{% if event.data.date | inThePast %}
|
||||||
<p>{{ event.data.title }}</p>
|
{% include "event.njk" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
Reference in new issue
Block a user