I’m working on a blog in GRAV CMS and aiming for a specific layout for my blog posts. I plan to include a header, an introductory paragraph, followed by the first image in the folder, and then the rest of the content. I’ve tried using the following code to manipulate the layout:
However, this results in the text summary appearing both above and below the image within the full text block. Is there a way to configure the “Summary Size and Separator” or adjust my code to display the first paragraph above the first image from the folder, without repeating the summary text?
If there is === in the page file, everything works and page.summary contains text with “===” above it.
Text summary
<img ... />
Text
However, if there is no === in the file, page.summary is not empty but contains a string of characters from the beginning trimmed to the value from the configuration file:
summary:
size: 300
For this second example, I would like the content to look like this:
<img ... />
Text
not:
Text trimmed to 300 characters...
<img />
text from 300 characters to the end.
You’re explicitly telling Grav that this page has a summary of 300 chars, aren’t you? If you remove that and there’s no === in the content, then there’s no summary and it should work as expected