I’m trying to use .Summary and manually tune how much of the content will belong to summary. While automatic summaries seem to work reasonably well I have not managed to get reasonable output when using . Depending on the location of the tag I get either empty .Summary or possibly same .Summary but not the text from the beginning to the tag.
I us “Hugo Static Site Generator v0.25.1 windows/amd64 BuildDate: 2017-07-26T01:20:59+03:00” Any help would be greatly appreciated as I’m in progress on moving Wordpress site to Hugo and summaries are used as important design element.
So something isn’t building properly. Probably something with the way you’ve got the index.md and the layout html for index and the type “homepage” or something.
Also, for the <!--more--> keyword within the content, I’ve found that it doesn’t work unless I put it on a new line with a blank line either above or below it. Maybe there’s something strange with mine, but try that. Still, that wouldn’t cause it to not build the page.
It does build properly for me. Problem is that .Summary is empty. If you remove more tag or move it around you get different results. Almost none of them is that I expect. I expect .Summary to contain text from the beginning of content up to more tag.
It clearly misbehaves, for example Summary depends on whether more tag is in first half or second half of the paragraph. I would be happy to fix it, although I’m not even able to guess from the code how it should behave. I see 2 options.
From the beginning of the document to closing paragraph tag. Closest to the current behavior, although not exactly how similar tag works in Wordpress.
Make it work like it is described in documentation. Everything before tag is included in summary. That would provide exact control for Summary but can return invalid HTML if tag is in the middle of the paragraph.