New most horrifying line of 11ty templating wizardy I'm written.

"permalink": "/talking-about-music/{% if title %}{{title | slug}}{% endif %}{% if subject and title %}-{% endif %}{% if subject %}{{subject|slug}}{% endif %}/",

This monstrosity allows me to format the page url differently depending on if I’ve put one of these in the metadata:

  1. A proper title for the page (example: Cursed Runes in the Form of a Song)
  2. An album or track that the page is about (example: American War by Pitbull)
  3. Both!

Keeping these separate allows me to specify different things when rendering the pages, but also makes horrors of verbosity like this necessary. (For context if you’re not familiar with 11ty & nunjucks, this would normally be as simple as permalink: /talking-about-music/{{ title | slug }}/)

6 Likes

Man what is going on over in the 11ty world? lol

Nice work, thanks for sharing!

1 Like

This is how I include my “thanks for reading with RSS” message at the bottom of each entry…

<p>Hey, thanks for reading this post in your feed reader! Want to chat? <a href="mailto:hello@flamedfury.com?subject=RE: {{ post.data.title }}">Reply by email</a> or add me on <a href="xmpp:flamed@omg.lol">XMPP</a>, or send a <a href="{{ absolutePostUrl }}#webmention">webmention</a>. Check out the <a href="https://flamedfury.com/posts/">posts archive</a> on the website.</p>

you 11ty folks are on a whole other level!!! :joy: