Hugo

Summary divider in a shortcode

A bit silly question, but (how) can I put summary divider (<!--more-->) into a shortcode, so it would appear on the page from which this shorcode is called?

The shortcode /layouts/shortcodes/my-shortcode.html:

some text

<!--more-->

# Some header

some more text
(other silly attempts)
some text

{{ "<!--more-->" | markdownify }}

# Some header

some more text

and

some text

{{ "<!--more-->" | safeHTML }}

# Some header

some more text

The shortcode is called like this:

{{% my-shortcode %}}

And the problem is that my list layouts use the following condition:

{{ if in .RawContent "<!--more-->" }}
    <div>{{ .Summary }}</div>
{{ else }}
    <div>{{ .Content }}</div>
{{ end }}

For pages with this shortcode the condition is never true, which (I guess) means that summary divider is not present there, so I get the full page contents instead of their summaries.

If I put summary divider out of the shortcode and put it into index.md, then of course everything is good and I get summaries.

So is there a way for summary divider to be “recognized” from the shortcode too?

My config.toml:

[markup.goldmark.renderer]
    unsafe = true

Hugo: v0.62.1-A1518704/extended