#dev 2025-05-08
2025-05-08 UTC
[tw2113], grufwub, gRegor, alephalpha0, perryflynn, bterry1, gRegorLove_, [morganm], NaomiAmethyst, gRegorLove__, jeremy, chudincolous, [qubyte], Guest6 and [KevinMarks] joined the channel
#
[KevinMarks] Can you do it with a nunjucks macro? That would let you keep state in a variable.

PsyLok, ttybitnik, jeremy, jeremycherfas, barnaby, gRegorLove__, gRegorLove_, [schmarty], NaomiAmethyst6, btrem and lanodan joined the channel
balintm joined the channel
#
[KevinMarks] You can make a macro that is an external js function that can keep state

#
Zegnat Per this old article https://www.sitepoint.com/accessible-footnotes-css/

#
[KevinMarks] Oh, maybe I have mixed up filters, which run in the node environment with macros, where I'm not sure <% set %> does what you want

#
btrem Zegnat: I can see how that might work. Though it's an unconventional way to mark footnotes. In a sense, I was trying to replicate css counters in my 11ty shortcode. So each footnote ref would have been
{% fn %}
. And the footnotes would be an array of strings in front matter. The second part is easy, and done. The first part probably can't be done.#
[KevinMarks] Hm, so you're wanting a `yield` pattern

ttybitnik joined the channel
chimo joined the channel
#
[KevinMarks] The closest thing in nunjucks is a cycler - so you can set one up and call next() on it to get the next in sequence: https://mozilla.github.io/nunjucks/templating.html#cycler-item1-item2-itemn

#
[KevinMarks] ```

{% set fn = cycler ("*", "†", "‡", "§", "‖", "⁑", "⁂") %}
#
[KevinMarks] In text

{{fn.next()}}
gives the next one```#
[KevinMarks] Or, if you're Tantek:

#
[KevinMarks] In text

{{fn.next()}}
gives the next one```#
[KevinMarks] ```

{% set fn = cycler ("¹", "²", "³", "⁴", "⁵", "⁶", "⁷") %}
#
capjamesg "two asterisks aligned vertically" https://graphemica.com/%E2%81%91 😂

#
capjamesg [edit] "two asterisks aligned vertically" https://graphemica.com/%E2%81%91 😂

#
[KevinMarks] does what it says on the tin

barnaby joined the channel
#
[qubyte] I used to use asterisms between entry snippets. Now I use a set of emoji, and a random picker with the feature that it never picks the same element of a collection twice in a row. I encode the emoji as attributes in HTML so that I can have one set for the light colour scheme and the other for dark. https://github.com/qubyte/qubyte-codes/blob/823c0e377f3387234b412c1cfb779cb6202869d0/lib/templates.js#L56-L70

#
[qubyte] You can see the result on any collection page, between items. For example: https://qubyte.codes/blog/
