diff options
author | Urja Acharya <urja.acharya@huskers.unl.edu> | 2021-03-11 06:21:00 +0300 |
---|---|---|
committer | Urja Acharya <urja.acharya@huskers.unl.edu> | 2021-03-11 06:21:00 +0300 |
commit | 705b318b15f64b0e9278198f808ef2eeaa12a37d (patch) | |
tree | 2859ed8df96e30f2e6336db4579ac9389ff82eeb | |
parent | 23c6354a93609b78397c2397b6d721e32f1f9e1a (diff) |
if no pinned post, shows latest post in home page
-rw-r--r-- | layouts/partials/index/pinnedPost.html | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/layouts/partials/index/pinnedPost.html b/layouts/partials/index/pinnedPost.html index dfeef70..5ed661f 100644 --- a/layouts/partials/index/pinnedPost.html +++ b/layouts/partials/index/pinnedPost.html @@ -1,17 +1,16 @@ <div class="pinned-post card shadow round-corner"> -{{ if .Site.Params.theme.pinnedPosts }} - {{ range ((where .Site.Pages "Params.pinned" true).ByDate.Reverse) | first 1 }} - {{ partial "index/homePageArticle" . }} + {{ if .Site.Params.theme.pinnedPosts }} + {{ range (where .Site.Pages "Params.pinned" true).ByDate.Reverse | first 1 }} {{ partial "index/homePageArticle" . }} {{ end }} - <hr class="red-hr"/> - <div style="text-align: right; margin-bottom: 1em;"> - <a class="card-links" - href="{{ `pinnedposts` | relURL }}" - >Previously Pinned Posts</a - ></div> -{{ else }} - {{ range site.RegularPages | first 1 }} - {{ partial "index/homePageArticle" . }} + <hr class="red-hr" /> + <div style="text-align: right; margin-bottom: 1em"> + <a class="card-links" href="{{ `pinnedposts` | relURL }}" + >Previously Pinned Posts</a + > + </div> + {{ else }} + {{ range site.RegularPages.ByDate.Reverse | first 1 }} + {{ partial "index/homePageArticle" . }} {{ end }} -{{ end }} -</div>
\ No newline at end of file + {{ end }} +</div> |