mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-09 14:59:45 +00:00
feat: add hiddenFromHomePage param (#37)
This commit is contained in:
parent
8274b4209d
commit
52777345e4
3 changed files with 17 additions and 1 deletions
|
@ -15,6 +15,7 @@ comment: false
|
||||||
toc: false
|
toc: false
|
||||||
autoCollapseToc: false
|
autoCollapseToc: false
|
||||||
postMetaInFooter: false
|
postMetaInFooter: false
|
||||||
|
hiddenFromHomePage: false
|
||||||
# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
|
# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
|
||||||
contentCopyright: false
|
contentCopyright: false
|
||||||
reward: false
|
reward: false
|
||||||
|
|
15
exampleSite/content/post/hidden-post.md
Normal file
15
exampleSite/content/post/hidden-post.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
title: "This is a hidden post."
|
||||||
|
date: 2018-03-08T17:40:19+08:00
|
||||||
|
lastmod: 2018-03-08T22:01:19+08:00
|
||||||
|
draft: false
|
||||||
|
author: '<a href="https://halu.lu" target="_blank">Halulu</a>'
|
||||||
|
|
||||||
|
hiddenFromHomePage: true
|
||||||
|
---
|
||||||
|
|
||||||
|
This post is hidden from the home page.
|
||||||
|
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
But you can see it in archives, rss or other pages.
|
|
@ -1,7 +1,7 @@
|
||||||
{{ define "content" }}
|
{{ define "content" }}
|
||||||
<section id="posts" class="posts">
|
<section id="posts" class="posts">
|
||||||
{{/* (index .Site.Paginate) */}}
|
{{/* (index .Site.Paginate) */}}
|
||||||
{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
|
{{ $paginator := .Paginate (where (where .Data.Pages "Type" "post") ".Params.hiddenfromhomepage" "!=" true) }}
|
||||||
{{ range $paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue