revise styles for displaying draft posts
This commit is contained in:
parent
77613eb5ce
commit
9cd5abf95b
3 changed files with 16 additions and 5 deletions
|
@ -19,3 +19,7 @@
|
||||||
.pull-right {
|
.pull-right {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.draft {
|
||||||
|
color: #999 !important;
|
||||||
|
}
|
||||||
|
|
|
@ -6,23 +6,30 @@
|
||||||
<div class="post-list">
|
<div class="post-list">
|
||||||
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }}
|
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }}
|
||||||
{{ range $paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
|
{{ if .Draft }}
|
||||||
|
{{ .Scratch.Set "draftPage" true }}
|
||||||
|
{{ else }}
|
||||||
|
{{ .Scratch.Set "draftPage" false }}
|
||||||
|
{{ end }}
|
||||||
<div class="post-list__item">
|
<div class="post-list__item">
|
||||||
<span class="item__title--big">
|
<span class="item__title--big">
|
||||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
<a href="{{ .RelPermalink }}" {{if .Scratch.Get "draftPage" }}class="draft"{{end}}>{{ .Title }}</a>
|
||||||
{{ if .Draft }}<sup><i class="fas fa-comment-dots fa-xs"></i></sup>{{ end }}
|
|
||||||
</span>
|
</span>
|
||||||
<span class="item__date">
|
<span class="item__date">
|
||||||
{{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }}
|
{{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }}
|
||||||
</span>
|
</span>
|
||||||
|
<span {{if .Scratch.Get "draftPage" }}class="draft"{{end}}>
|
||||||
{{ if .Description }}
|
{{ if .Description }}
|
||||||
{{ .Description }}
|
{{ .Description }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
</span>
|
||||||
{{ if .Truncated }}
|
{{ if .Truncated }}
|
||||||
... <a class="read-more-symbol" href="{{ .RelPermalink }}">➦</a>
|
... <a class="read-more-symbol" href="{{ .RelPermalink }}">➦</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
{{ .Scratch.Delete "draftPage" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ partial "pagination.html" . }}
|
{{ partial "pagination.html" . }}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
<li>
|
<li>
|
||||||
<span class="list__title--small">
|
<span class="list__title--small">
|
||||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
<a href="{{ .RelPermalink }}" {{if .Draft}}class="draft"{{end}}>{{ .Title }}</a>
|
||||||
{{if not .Date.IsZero}}
|
{{if not .Date.IsZero}}
|
||||||
<time class="pull-right hidden-tablet">{{.Date.Format ("Jan 02 '06")}}</time>
|
<time class="pull-right hidden-tablet">{{.Date.Format ("Jan 02 '06")}}</time>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in a new issue