I would like to use produce summaries of my posts so that I can display them in brief on sections. I have found page.summary
which does what I want but requires manual markup on my posts. That’s possible but as I am porting an existing blog it’s quite a lot of effort. I’ve also tried the truncate
filter. That works okay, but only truncates as a string – not something that is HTML aware. So, if it truncates in the middle of a tag, then we end up with broken HTML.
I can work around this, since I am producing the CommonMark that zola acts on via pandoc, but it would seem a bit neater to do this in zola. Is there a context aware method of breaking HTML into bits to produce an approximately sized summary without manual markup?