Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Additional Markdown

Started by Muut Archive 11 years ago · 3 replies · 411 views
11 years ago

Is it possible to add additional markdown to a .md file? I see that there is a plugin, but that uses a completely different file extension it seems, and is clearly incompatible with the admin plugin. Basically, I want to have a summary markdown area and a content markdown area. The summary will be shown on the parent page, and the content will be shown when the user clicks through. Cheers.

11 years ago

Grav supports the === for breaking between summary and rest of content. As it happens, I just wrote this in a reply to another post, so for example the .md content:

TXT
Introduction, for example a paragraph or two.

===

Rest of content, several paragraphs.

And in twig, I use:

TWIG
{{ page.summary }}
{% include "forms/form.html.twig" %}
{{ page.content|slice(page.summary|length) }}

So you could just loop over child-pages and only access the summary.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2288 9 years ago
Archive · by Muut Archive, 9 years ago
2 1500 9 years ago
Archive · by Muut Archive, 9 years ago
2 4753 9 years ago
Archive · by Muut Archive, 9 years ago
1 3570 9 years ago
Archive · by Muut Archive, 9 years ago
3 1626 9 years ago