From 9cd5abf95bf8f1138757d3caeb6b9e7bfc428ee6 Mon Sep 17 00:00:00 2001 From: Huy Tran Date: Tue, 27 Nov 2018 21:17:45 +1100 Subject: [PATCH] revise styles for displaying draft posts --- assets/scss/hyde-hyde/_misc.scss | 6 +++++- layouts/index.html | 11 +++++++++-- layouts/partials/posts-list.html | 4 ++-- 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 @@
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }} {{ range $paginator.Pages }} + {{ if .Draft }} + {{ .Scratch.Set "draftPage" true }} + {{ else }} + {{ .Scratch.Set "draftPage" false }} + {{ end }}
- {{ .Title }} - {{ if .Draft }}{{ end }} + {{ .Title }} {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }} + {{ if .Description }} {{ .Description }} {{ else }} {{ .Summary }} {{ end }} + {{ if .Truncated }} ... {{ end }}
+ {{ .Scratch.Delete "draftPage" }} {{ end }}
{{ 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 . }}
  • - {{ .Title }} + {{ .Title }} {{if not .Date.IsZero}} {{end}}
  • -{{ end }} \ No newline at end of file +{{ end }}