Question

I'm having some trouble with this Hyde project, my homepage and blog index page show correctly pulling from the individual blog post's excerpt and image marked sections, but when viewing the individual blog posts, the excerpt is also being shown, which I do not want.

Trying to customize the individual post template is an option I tried, but then failed to display those image and excerpt sections on the homepage and blog index.

Any solution which allows me to write the excerpt in the post content file as default, but hiding it from single post views would be ideal, but open to any suggestions.

Cheers,

Leon

Was it helpful?

Solution

Since you do not want it to be displayed in the content, you should probably add it to the post meta data. You can have full blown markdown stuff there and use the markdown|typogrify filter just like you do now.

---
title: Django, Debian and Postgre Web Development (part 1)
excerpt: >
     A complete walkthrough to developing a web app using double D's and some P 
...
---
...

and in your home page:

{{ res.meta.excerpt|markdown|typogrify }}

If you do not want that for some reason, you can always use this to determine if you are rendering for a refer call or a regular one:

{% mark excerpt -%}
{% if _markings_ is defined -%}

 A complete walkthrough to developing a web app using double D's and some P

{%- endif %}
{%- endmark %}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top