Skip to content

Commit 6cf7a0e

Browse files
committed
Display blog post metadata
1 parent 6964e23 commit 6cf7a0e

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

app/Resources/views/admin/blog/show.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
{% block main %}
66
<h1>{{ post.title }}</h1>
77
<p class="post-metadata">
8-
<i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}
9-
<i class="fa fa-user"></i> {{ post.author.email }}
8+
<span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</span>
9+
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.email }}</span>
1010
</p>
1111

1212
<div class="well">

app/Resources/views/blog/index.html.twig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
</a>
1212
</h2>
1313

14+
<p class="post-metadata">
15+
<span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</span>
16+
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.email }}</span>
17+
</p>
18+
1419
{{ post.summary|md2html }}
1520
</article>
1621
{% else %}

app/Resources/views/blog/post_show.html.twig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
{% block main %}
66
<h1>{{ post.title }}</h1>
77

8+
<p class="post-metadata">
9+
<span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</span>
10+
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.email }}</span>
11+
</p>
12+
813
{{ post.content|md2html }}
914

1015
<div id="post-add-comment" class="well">

web/css/main.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,17 @@ body#login #login-users-help p .console {
207207
padding: 10px
208208
}
209209

210+
/* Common Blog page elements
211+
------------------------------------------------------------------------- */
212+
.post-metadata {
213+
color: #b4bcc2;
214+
font-size: 19px;
215+
margin-bottom: 16px;
216+
}
217+
.post-metadata .metadata {
218+
margin-right: 1.5em;
219+
}
220+
210221
/* Page: 'Blog index'
211222
------------------------------------------------------------------------- */
212223
body#blog_index h1 {
@@ -217,6 +228,11 @@ body#blog_index article.post {
217228
margin-bottom: 3em
218229
}
219230

231+
body#blog_index .post-metadata {
232+
font-size: 16px;
233+
margin-bottom: 8px;
234+
}
235+
220236
/* Page: 'Blog post show'
221237
------------------------------------------------------------------------- */
222238
body#blog_post_show h3 {

0 commit comments

Comments
 (0)