Add featured events

This commit is contained in:
Sofía Aritz 2025-04-26 15:50:45 +02:00
parent ba0189de0a
commit ee5fca4628
Signed by: sofia
GPG key ID: 5A1485B4CCCDDB4A
3 changed files with 37 additions and 5 deletions

View file

@ -167,10 +167,12 @@ export default async function (eleventyConfig) {
.sort(dateDesc);
})
eleventyConfig.setLibrary("md", markdownIt(markdownItOptions))
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownItAnchor))
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownItEmoji.full, { shortcuts: {} }))
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownItFootnote))
const markdown = markdownIt(markdownItOptions)
.use(markdownItAnchor)
.use(markdownItEmoji.full, { shortcuts: {} })
.use(markdownItFootnote);
eleventyConfig.setLibrary("md", markdown)
eleventyConfig.addPlugin(syntaxHighlight)
eleventyConfig.addPlugin(eleventyImageTransformPlugin)
@ -180,6 +182,10 @@ export default async function (eleventyConfig) {
return (data) => eleventyConfig.getFilter("slugify")(data.page.fileSlug).concat("/")
})
eleventyConfig.addFilter("markdown", content => {
return markdown.render(content)
})
eleventyConfig.addFilter("readTime", content => {
const minutes = content.trim().split(" ").length / 130 // 130 wpm
return Math.ceil(minutes)

14
src/_data/events.json Normal file
View file

@ -0,0 +1,14 @@
{
"featured": [
{
"title": "SalmorejoTech 2025",
"description": "I will be presenting at SalmorejoTech 2025 on FSFE's upcoming project, MP Scrape.",
"link": "https://salmorejo.tech/2025"
},
{
"title": "Devconf.CZ 2025",
"description": "I will be hosting at Devconf.CZ:\n- An [Upcycling Android Workshop](https://pretalx.devconf.info/devconf-cz-2025/talk/FRXKNL/)\n- A talk about [Munin](/projects/munin): [“Identity: Supporting dementia care with Free Software”](https://pretalx.devconf.info/devconf-cz-2025/talk/P8ZEE8/).",
"link": "https://www.devconf.info/cz/"
}
]
}

View file

@ -45,4 +45,16 @@ which I believe are essential for building a fairer and more sustainable technol
{% endif %}
<hr style="color: var(--color-secondary); border: 3px dotted; border-style: none none dotted;">
</div>
{% endfor %}
{% endfor %}
{% if events.featured %}
<h2>featured events</h2>
{% for event in events.featured %}
<div style="margin-bottom: 0.5rem;">
<h3 style="margin-bottom: 0;"><a style="text-decoration: none;" href="{{ event.link }}">{{ event.title }}</a></h3>
<p style="font-size: 0.9rem; margin-top: 0.4rem;">{{ event.description | markdown }}</p>
</div>
{% endfor %}
{% endif %}