Open viniciusdacal opened 9 years ago
Yes -- in the index and category pages, the excerpt part (before the <!--more-->
) is available as the post metadata's content
property:
{% for post in posts %}
{{post.content}}
{% endfor %}
IMO this seems a bit confusing though, as in the posts template the post.content
returns the full post content.
It would perhaps be a good idea to rename or alias the excerpt property and make it available on all generated content that involves posts. /cc @jaydson
Actually, I believe the post excerpt is also available in the the posts template as post.metadata.content
.
I believe "content" is a rather confusing name for an excerpt, we should rename or at least alias it (depending on how many harmonic-themes are published on npm).
Or we can just create a new property and keep the old one for back-compatibility:
metadata.content
: the content prior to <!--more-->
, or the full content if there is no <!--more-->
metadata.excerpt
: the content prior to <!--more-->
, or empty string if there is no <!--more-->
@jaydson WDYT?
Thanks, works perfectly here.
I still think we should create a better alias, so keeping this issue open for now.
Yes, you're right @UltCombo, it's confusing indeed.
metadata.content: the content prior to , or the full content if there is no metadata.excerpt: the content prior to , or empty string if there is no
Sounds good to me
Does Harmonic have something like the post.excerpt from jekyll? that takes the first paragraph from a post?