Exclude image shortcode from .Summary

In a markdown file, book.md, I start my post with an image shortcode followed by text.

In books/list.html, I want to show a list of all books and a summary of each.

W:hen I do

{{.Content | truncate 100}} the image and caption is show, and text.

When I do:

{{.Summary}} the caption and text is shown.

How can I do so that only text is shown in the summary, and not the image and caption?

Basically you are asking about controlling the beginning of the summary to exclude the image caption.

This is not possible out-of-the-box.

Either you define your desired summary in a front matter parameter and use that.

OR

See this technique that makes use of a HTML comment to trim the beginning of the .Summary

I am afraid that there is no clear cut answer to your question.

1 Like

Thank you

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.