Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

Page.summary Not Truncating at `===`

Started by Muut Archive 12 years ago · 8 replies · 319 views
12 years ago

Grav 0.9.4

As I understand the docs, {{ page.summary }} should return the content of my page up until a === delimited in that content.

But that's not happening. The content is being truncated at some point before the === delimiter. I don't want to use a fixed number of characters, so am attempting to truncate somewhat manually with ===.

What did I miss?

12 years ago

Do you have a summary: size: 300 or something in your site.yaml? If so try removing that. (then clear cache)

12 years ago

The system config summary:size is 300. Should I set the user config to 0? Or blank?

12 years ago

Might be safer to set it to a big number.

12 years ago

When I do that I just get all the content. page.summary does not seem to respect the ===.

12 years ago

I just checked the code and it's looking for the delimiter to be separated by new lines so make sure you have:

TXT

===

Actually it should not matter what the summary size is as this is only checked if the delimiter is not found first.

12 years ago

ok that's hard to read in teh quote, but you just make sure there's a new line above and below the ===

12 years ago

That was it. I had the === inline with the rest of the text. Thanks!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1280 9 years ago
Archive · by Muut Archive, 9 years ago
2 888 9 years ago
Archive · by Muut Archive, 9 years ago
2 4016 9 years ago
Archive · by Muut Archive, 9 years ago
1 2892 9 years ago
Archive · by Muut Archive, 9 years ago
3 1076 9 years ago