Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post resume #157

Open
viniciusdacal opened this issue Jun 23, 2015 · 6 comments
Open

Post resume #157

viniciusdacal opened this issue Jun 23, 2015 · 6 comments

Comments

@viniciusdacal
Copy link
Contributor

Does Harmonic have something like the post.excerpt from jekyll? that takes the first paragraph from a post?

@UltCombo
Copy link
Member

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

@UltCombo
Copy link
Member

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).

@UltCombo
Copy link
Member

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?

@viniciusdacal
Copy link
Contributor Author

Thanks, works perfectly here.

@UltCombo
Copy link
Member

UltCombo commented Aug 3, 2015

I still think we should create a better alias, so keeping this issue open for now.

@jaydson
Copy link
Contributor

jaydson commented Aug 4, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants