-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog-post.html.twig
39 lines (36 loc) · 1.39 KB
/
blog-post.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% macro blog_post(post, summary) %}
<article class="c-blog-post">
<header class="c-blog-post__header">
<h1 class="c-blog-post__title">
{% if summary %}<a href="{{ url(post) }}">{% endif %}
{{ post.title }}
{% if summary %}</a>{% endif %}
</h1>
<p class="c-blog-post__date">{{ post.date | date('M d, Y') }}</p>
</header>
<section class="c-blog-post__body s-markdown">
{% if summary %}
{{ post.content | summary }}
{% else %}
{{ post.content | anchors(
anchorBody='<span class="sr-only">Permalink to "{heading}" section</span>',
anchorClass='c-heading-anchor'
) }}
{% endif %}
</section>
<footer class="c-blog-post__footer">
{% if post.categories %}
<div>
<i class="fa fa-fw fa-folder" aria-hidden="true"></i> {{ post.categories | join(', ') | title }}
</div>
{% endif %}
{% if not summary %}
{% if post.tags %}
<div>
<i class="fa fa-fw fa-tags" aria-hidden="true"></i> {{ post.tags | join(', ') }}
</div>
{% endif %}
{% endif %}
</footer>
</article>
{% endmacro %}