Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/htr3n/hyde-hyde.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuy Tran <hoang.huy.tran@gmail.com>2018-11-27 13:17:45 +0300
committerHuy Tran <hoang.huy.tran@gmail.com>2018-11-27 13:17:45 +0300
commit9cd5abf95bf8f1138757d3caeb6b9e7bfc428ee6 (patch)
tree05434d93efe71f1e57e1f7f9a408706b24a6c23b
parent77613eb5ced284d6d51812591995eef4c96cfc5a (diff)
revise styles for displaying draft posts
-rw-r--r--assets/scss/hyde-hyde/_misc.scss6
-rw-r--r--layouts/index.html11
-rw-r--r--layouts/partials/posts-list.html4
3 files changed, 16 insertions, 5 deletions
diff --git a/assets/scss/hyde-hyde/_misc.scss b/assets/scss/hyde-hyde/_misc.scss
index 869ee40..bf4de9f 100644
--- a/assets/scss/hyde-hyde/_misc.scss
+++ b/assets/scss/hyde-hyde/_misc.scss
@@ -10,7 +10,7 @@
color: #333;
border-radius: 2px;
padding: 1px 5px;
-}
+}
.text-center {
text-align: center;
@@ -19,3 +19,7 @@
.pull-right {
float: right;
}
+
+.draft {
+ color: #999 !important;
+}
diff --git a/layouts/index.html b/layouts/index.html
index e508122..c500765 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -6,23 +6,30 @@
<div class="post-list">
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }}
{{ range $paginator.Pages }}
+ {{ if .Draft }}
+ {{ .Scratch.Set "draftPage" true }}
+ {{ else }}
+ {{ .Scratch.Set "draftPage" false }}
+ {{ end }}
<div class="post-list__item">
<span class="item__title--big">
- <a href="{{ .RelPermalink }}">{{ .Title }}</a>
- {{ if .Draft }}<sup><i class="fas fa-comment-dots fa-xs"></i></sup>{{ end }}
+ <a href="{{ .RelPermalink }}" {{if .Scratch.Get "draftPage" }}class="draft"{{end}}>{{ .Title }}</a>
</span>
<span class="item__date">
{{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }}
</span>
+ <span {{if .Scratch.Get "draftPage" }}class="draft"{{end}}>
{{ if .Description }}
{{ .Description }}
{{ else }}
{{ .Summary }}
{{ end }}
+ </span>
{{ if .Truncated }}
... <a class="read-more-symbol" href="{{ .RelPermalink }}">➦</a>
{{ end }}
</div>
+ {{ .Scratch.Delete "draftPage" }}
{{ end }}
</div>
{{ partial "pagination.html" . }}
diff --git a/layouts/partials/posts-list.html b/layouts/partials/posts-list.html
index 174ea5e..8b98604 100644
--- a/layouts/partials/posts-list.html
+++ b/layouts/partials/posts-list.html
@@ -1,10 +1,10 @@
{{ range . }}
<li>
<span class="list__title--small">
- <a href="{{ .RelPermalink }}">{{ .Title }}</a>
+ <a href="{{ .RelPermalink }}" {{if .Draft}}class="draft"{{end}}>{{ .Title }}</a>
{{if not .Date.IsZero}}
<time class="pull-right hidden-tablet">{{.Date.Format ("Jan 02 '06")}}</time>
{{end}}
</span>
</li>
-{{ end }} \ No newline at end of file
+{{ end }}