Skip to content

Instantly share code, notes, and snippets.

@nunocodex
Created September 14, 2014 20:36
Show Gist options
  • Save nunocodex/3cc7d23e18e99b1fbd04 to your computer and use it in GitHub Desktop.
Save nunocodex/3cc7d23e18e99b1fbd04 to your computer and use it in GitHub Desktop.
blog_item.html.twig
<div class="list-item">
<div class="list-blog-header">
{{ hook('blog.item.date.before') }}
<span class="list-blog-date">
<span>{{ page.date|date("d") }}</span>
<em>{{ page.date|date("M") }}</em>
</span>
{{ hook('blog.item.date.after') }}
<h4>{{ hook('blog.item.title.before') }} <a href="{{ page.url }}">{{ page.title }}</a> {{ hook('blog.item.title.after') }}</h4>
{{ hook('blog.item.tags.before') }}
{% if page.taxonomy.tag %}
<span class="tags">
{% for tag in page.taxonomy.tag %}
<a href="{{ base_url }}/tag:{{ tag }}">{{ tag }}</a>
{% endfor %}
</span>
{% endif %}
{{ hook('blog.item.tags.after') }}
{% if big_header %}
{{ page.media.images|first.cropResize(900,600).html }}
{% else %}
{{ page.media.images|first.cropZoom(900,300).html }}
{% endif %}
</div>
<div class="list-blog-padding">
{% if truncate %}
{{ hook('blog.item.content.before') }}
<p>{{ page.content|truncate(550) }}</p>
{{ hook('blog.item.content.after') }}
<p><a href="{{ page.url }}">Continue Reading...</a></p>
{% else %}
{{ hook('blog.item.full_content.before') }}
<p>{{ page.content }}</p>
{{ hook('blog.item.full_content.after') }}
{% endif %}
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment