News for hackers. Stuff that matters.
Re:Building a personal website in 2021 by minimaxir on Sunday May 16, 2021 @02:54PM (#27176040)
That particular example could theoretically be replicated with rendering the content to HTML via .RenderString (https://gohugo.io/functions/renderstring/) + replaceRE (https://gohugo.io/functions/replacere/) + an ugly regex, with a layout override to call that modified filter instead of the normal content.

Not 100% sure if that would work, but on paper business logic LOC would be about the same and using a regex is the more canonical way to handle this sort of processing anyways.

Re:Building a personal website in 2021 by edoceo on Sunday May 16, 2021 @03:23PM (#27176234)
> using a regex is the more canonical way

Yuck.

I also ran into similar issue with Hugo, where I'm out of the happy-path. Those short codes didn't work, complex processing of some unique bits of content was easier in Jekyll (but also other script-lang based tools) than it was in tools like Hugo.

Re:Building a personal website in 2021 by nickjj on Sunday May 16, 2021 @03:57PM (#27176513)
> with a layout override to call that modified filter instead of the normal content

Would it apply to all content in a specific layout or only specific bits of a certain layout?

With the way I have it set up with Jekyll, only a specific post gets the audioseek timestamps added to it, because I wouldn't want it to apply to all lists on the site. I also happen to share a single layout for both podcasts and interviews and interview lists shouldn't get processed with audioseek'd timestamps.

With Jekyll this is super easy to pull off because it's only a custom filter. It can be applied to the specific content I want without having to worry about layouts.