Add post_meta partial

This commit is contained in:
vimux 2018-03-04 10:21:14 +03:00
parent 35d9f72287
commit ac8cec336b
4 changed files with 44 additions and 0 deletions

View file

@ -2,6 +2,7 @@
<div class="main"> <div class="main">
<div class="single block"> <div class="single block">
<article class="post"> <article class="post">
<div class="post__meta meta mb">{{ partial "post_meta.html" . }}</div>
<h1 class="post__title">{{ .Title }}</h1> <h1 class="post__title">{{ .Title }}</h1>
<div class="post__content">{{ .Content }}</div> <div class="post__content">{{ .Content }}</div>
{{ if .Params.tags }}{{ partial "post_tags.html" . }}{{ end }} {{ if .Params.tags }}{{ partial "post_tags.html" . }}{{ end }}

View file

@ -1,4 +1,5 @@
<article class="post block"> <article class="post block">
<h1 class="post__title"><a class="post__title-link" href="{{ .RelPermalink }}">{{ .Title }}</a></h1> <h1 class="post__title"><a class="post__title-link" href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
<div class="post__content">{{- .Summary }}</div> <div class="post__content">{{- .Summary }}</div>
<div class="post__meta meta mt tar">{{ partial "post_meta.html" . }}</div>
</article> </article>

View file

@ -0,0 +1,11 @@
{{- if not .Date.IsZero }}
<time class="post__meta-published meta-published" datetime="{{ .Date.Format "2006-01-02T15:04:05" }}">{{ .Date.Format ( .Site.Params.dateformat | default "January 02, 2006" )}}</time>
{{ end }}
{{- if ne .Date .Lastmod }}
<time class="post__meta-lastmod meta-lastmod" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05" }}">Updated: {{ .Lastmod.Format ( .Site.Params.dateformat | default "January 02, 2006" )}}</time>
{{- end }}
{{- if .Params.categories }}
<span class="post__meta-categories meta-categories">
<span class="meta-categories__list">Categories: {{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}, {{ end }}<a class="meta-categories__link" href="{{ "categories/" | relLangURL }}{{ . | urlize | lower }}" rel="category">{{ . }}</a>{{ end }}</span>
</span>
{{- end }}

View file

@ -346,6 +346,26 @@ mark {
background-color: #f8ae00; background-color: #f8ae00;
} }
.mt {
margin-top: 1rem;
}
.mb {
margin-bottom: 1rem;
}
.mla {
margin-left: auto;
}
.tal {
text-align: left;
}
.tar {
text-align: right;
}
/* Header */ /* Header */
.header { .header {
margin: 0 0 5px; margin: 0 0 5px;
@ -391,6 +411,17 @@ mark {
text-decoration: none; text-decoration: none;
} }
/* Post */
.post__meta {
font-size: 14px;
color: #888;
}
.post__meta-published,
.post__meta-lastmod {
display: block;
}
.post__tags { .post__tags {
margin-top: 2rem; margin-top: 2rem;
} }