[SOLVED] Set .Summary completely manually

My problem:

My articles/posts/whatever is formatted like this:

some intro text (can be more than 70 words, but is not interesting to the summary at all)

##my articles title (I know I remove the space to prevent this from being formatted)

and some more text (which is interesting to the summary)

What I want: to make my summary being only part of this “more text” or to set it completely manually.

What I tried:

  • overriding .Summary in the meta information. Works not.
  • creating a variable .Mysummary to be used as summary for these posts. I run into problems while rendering it, because I use taxonomy pages which control more than one section. I tried to work with an archtype but I still had problems while rendering. Maybe I don’t really understand how archetypes work.

What I would like to be able to:

  • set the value of summary or some equivalent variable in the meta information of the markdown file
  • or (this is my preferred solution): Be able to type someting like This text will be in the summary. This would mean to have a “start summary”-tag as well as the “end summary”-tag <!--more-->

Is this possible?

I am doing what you want with a custom post front matter paramater and then render it in list pages with

{{ with .Params.entry }}{{ . }}{{ end }}

If you want to append <!--more--> you can easily do this in your list.html template at the end of what I posted.

Then just use this in your post’s frontmatter (with whatever name you want):

entry= "blah-blah"

Note, that I don’t use .Summary because I want to have absolute control over the text that is in the summary and the 70 character limit most of the time is not enough for me.

1 Like

Thank you!