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

Blog always shows 'Continue Reading'

Started by Muut Archive 11 years ago · 4 replies · 621 views
11 years ago

I'm using the Blog Skeleton and it seems that the startpage always shows 'Continue reading' at the end of each article, regardless of the length. See the 2nd entry 'Just some text today'. It contains 2 line breaks at the end, but even after removal it still shows 'Continue reading'. The text has no more than 550 characters so it's not necessary to truncate. How could this be changed? In general I like to truncate after a certain amount of characters (e.g. 550) but 'Continue Reading' should not appear if it has less characters.
Thanks!

11 years ago

Dear Kai,

I just checked your issue and you are right. Basicly this is an issue of the default Antimatter theme and I can only give you a workaround here. You can solve it by editing

user/themes/anitmatter/templates/partials/blog_item.html.twig

around line 50 from

TWIG
{% elseif truncate %}
   {{ page.content|truncate(550) }}
   <p><a href="{{ page.url }}">Continue Reading...</a></p>
{% else %}

to

TWIG
{% elseif truncate %}
  {{ page.content }}
{% else %}

Then add

YAML
summary:
  size: 100000

to your user/config/site.yaml file and delete all occuring "===" in the pages files e.g. in "item.md" of "sunshine-in-the-hills". The summary size in the site.yaml can be arbitrary, but it should be greater than your longest article (here I set a cutoff of 100.000 characters).

If you want to switch off the continue link only for one page then you can directly add

TXT
continue_link: false

in your page header.

Hope that helps.

11 years ago

I was going to reply but @sommerregen has already covered everything!

11 years ago

Hi all,
yes, I also thought about this option but that's why I wrote "In general I like to truncate"... I hoped to have both: Hide "Continue reading" if less then 550 characters are used, and truncate if more than 550. I guess it will be fixed with one of the next releases?

11 years ago

Hi Kai,

sorry for my long abscence. Concerning your question, it is sufficient to set

YAML
summary:
  size: 550

and consider all other points in my previous post (i.e. change theme template and delete all "===" in your .md-files). And yes, your issue will be fixed with one of the next releases (at least for the Grav core).

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1319 9 years ago
Archive · by Muut Archive, 9 years ago
2 915 9 years ago
Archive · by Muut Archive, 9 years ago
2 4045 9 years ago
Archive · by Muut Archive, 9 years ago
1 2920 9 years ago
Archive · by Muut Archive, 9 years ago
3 1104 9 years ago