Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement looping over mainSections #445

Merged
merged 3 commits into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{ if eq .Params.covermeta "out" }}hasCoverMetaOut{{ else }}hasCoverMetaIn{{ end }}
{{ with .Params.coverCaption }}hasCoverCaption{{ end }}">
<section class="postShorten-group main-content-wrap">
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "posts") }}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" site.Params.mainSections ) }}
{{ range $paginator.Pages }}
{{ .Render "summary" }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="modal-body">
<div class="no-result text-color-light text-center">{{ i18n "global.posts_found.zero" }}</div>
<div class="results">
{{ $posts := (where .Site.RegularPages "Section" "posts") }}
{{ $posts := (where .Site.RegularPages "Section" "in" site.Params.mainSections) }}
{{ range first 10 $posts }}
<div class="media">
{{ if .Params.thumbnailImageUrl }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/taxonomy/archive.terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<form id="filter-form" action="#">
<input name="date" type="text" class="form-control input--xlarge" placeholder="{{ i18n "global.search_date" }}" autofocus="autofocus">
</form>
{{ partial "archive-post.html" (where .Site.RegularPages "Type" "posts") }}
{{ partial "archive-post.html" (where .Site.RegularPages "Type" "in" site.Params.mainSections) }}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions layouts/taxonomy/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{ with .Params.coverCaption }}hasCoverCaption{{ end }}">
{{ if or (not (isset .Site.Params "categoryPagination")) (.Site.Params.categoryPagination) }}
<section class="postShorten-group main-content-wrap">
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }}
{{ $paginator := .Paginate (where .Data.Pages "Type" "in" site.Params.mainSections) }}
{{ range $paginator.Pages }}
{{ .Render "summary" }}
{{ end }}
Expand All @@ -23,7 +23,7 @@
<form id="filter-form" action="#">
<input name="date" type="text" class="form-control input--xlarge" placeholder="{{ i18n "global.search_date" }}" autofocus="autofocus">
</form>
{{ partial "archive-post.html" (where .Data.Pages "Type" "posts") }}
{{ partial "archive-post.html" (where .Data.Pages "Type" "in" site.Params.mainSections) }}
</div>
{{ end }}
{{ partial "footer.html" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/taxonomy/category.terms.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ if $.Site.Params.hierarchicalCategories }}
{{ $.Scratch.Set "max-level" 0 }}
{{ range where $.Site.RegularPages "Type" "posts" }}
{{ range where $.Site.RegularPages "Type" "in" site.Params.mainSections }}
{{ $page := . }}
{{ if .Params.categories }}
{{ $categories := (apply .Params.categories "urlize" ".") }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/taxonomy/tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{ with .Params.coverCaption }}hasCoverCaption{{ end }}">
{{ if or (not (isset .Site.Params "tagPagination")) (.Site.Params.tagPagination) }}
<section class="postShorten-group main-content-wrap">
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }}
{{ $paginator := .Paginate (where .Data.Pages "Type" "in" site.Params.mainSections) }}
{{ range $paginator.Pages }}
{{ .Render "summary" }}
{{ end }}
Expand All @@ -23,7 +23,7 @@
<form id="filter-form" action="#">
<input name="date" type="text" class="form-control input--xlarge" placeholder="{{ i18n "global.search_date" }}" autofocus="autofocus">
</form>
{{ partial "archive-post.html" (where .Data.Pages "Type" "posts") }}
{{ partial "archive-post.html" (where .Data.Pages "Type" "in" site.Params.mainSections) }}
</div>
{{ end }}
{{ partial "footer.html" . }}
Expand Down