fix: remove hidden posts using where keyword (#1212)
This commit is contained in:
@@ -16,8 +16,7 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||||
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
|
||||||
|
|
||||||
{{ range $filtered.GroupByDate "2006" }}
|
{{ range $filtered.GroupByDate "2006" }}
|
||||||
{{ $id := lower (replace .Key " " "-") }}
|
{{ $id := lower (replace .Key " " "-") }}
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||||
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
|
||||||
{{ $pag := .Paginate ($filtered) }}
|
{{ $pag := .Paginate ($filtered) }}
|
||||||
|
|
||||||
<section class="article-list">
|
<section class="article-list">
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
|
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
|
||||||
{{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}}
|
{{- $filtered := where $pages "Params.hidden" "!=" true -}}
|
||||||
{{- $filtered := ($pages | intersect $notHidden) -}}
|
|
||||||
|
|
||||||
{{- $result := slice -}}
|
{{- $result := slice -}}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
<!-- Build paginator -->
|
<!-- Build paginator -->
|
||||||
{{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
{{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
||||||
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
|
||||||
{{ $pag := .Paginate ($filtered) }}
|
{{ $pag := .Paginate ($filtered) }}
|
||||||
|
|
||||||
{{ if .Paginator.HasPrev }}
|
{{ if .Paginator.HasPrev }}
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
|
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
|
||||||
|
|
||||||
{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }}
|
{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }}
|
||||||
{{ $notHidden := where $context.Site.RegularPages "Params.hidden" "!=" true }}
|
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
|
||||||
{{ $archives := $filtered.GroupByDate "2006" }}
|
{{ $archives := $filtered.GroupByDate "2006" }}
|
||||||
|
|
||||||
<div class="widget-archive--list">
|
<div class="widget-archive--list">
|
||||||
|
|||||||
Reference in New Issue
Block a user