Dedicated page summary instead of "more" trickery

Common in online publications is to have a short sentence or thesis conveyed in the article listing so as to draw attention to the main arguments presented in each, enticing the reader to click.

This is not currently possible with Zola out of the box, as the only way to achieve this “external summary” is through the use of the HTML tag directly in the text. That is to say, the summary that is presented in the listing is always going to be a fraction of the text itself.

Ideally, one should be able to override the summary property of a page and directly insert this summary in the frontmatter. An alternative approach might be custom markup in the text itself which allows the writer to designate what this summary should be, and have it omitted from the content of the page.

In any case, is this an idea worth exploring? Thanks

For my purposes, {{page.content | truncate | safe}} has been sufficient

Not sure what you mean, exactly.

However, I since found that each page has a “description” property, which suits my needs perfectly. Consider this request closed.

You can write whatever you want in the extra section and use that rather than the summary.

I overlooked that completely. My bad.

I went go with the “description” property instead. It doesn’t seem to be used for metadata, which actually prompts another question: how can I ensure my pages have metadata that is crawler-friendly for previews in apps like Instagram or Telegram?

Up to your templates to be written correctly according to their docs.

I ran into a related issue in the blog I am porting, and it is what I dislike most about zola. I want to format all that appears above <!-- more --> i.e. the summary differently on the blog page than the rest of the text. Doable, can put it in the extra section or what I did, wrapping it in a short code. Not elegant.

I tried to solve it with

{{ page.content  | replace(from=page.summary, to="") }}

and that does not work (even if it should work if I understand Tera correctly)

besides that and a few small issues, I think Zola is wonderful.

best, j

The summary is mostly intended if you want an excerpt from the text for other pages. If you want to style it differently, using a shortcode is probably better.

Yes, so have summary on the main index page. On the site I am porting from Jekyll, it had its equivalent to

{{ page.content  | replace(from=page.summary, to="") }}

which was very useful, as one can choose to omit the summary from the blog page, or format it differently. (and this should work in Tera, I think but it doesn’t ?)

I havent checked if I can do same (omit summary) with shortcodes.

but what bugs me is that by either using extra section or shortcodes, one is introducing zola specific code into the blog md files.

related is blockquotes. I wish I did not have to use shortcode instead of just >, and wish I could somehow tell Zola to map > to a shortcode

These are the only issue that I have not been able to do properly in zola. everything else has been a dream. and these are minor. Thanks for such a wonderful ssg.

In the abridge theme I try to cover all possibilities for a summary:

        {%- if page.summary %}
          {{ page.summary | markdown(inline=true) | safe }}
        {%- elif page.description %}
          {{ page.description | safe }}
        {%- elif page.content %}
          {{ page.content | striptags | truncate(length=150) | safe }}
        {%- endif %}