diff options
author | syui <syui@syui.cf> | 2019-08-17 21:02:04 +0300 |
---|---|---|
committer | syui <syui@syui.cf> | 2019-08-18 13:31:57 +0300 |
commit | 1d9d2065cc47544f2e2be6b315a9184fd4c33095 (patch) | |
tree | aee67612ef4065531496120f07fa06b5c1123451 | |
parent | 5f5fd71773655cb4ad43f0e7914d4949de3ed679 (diff) |
fix issues-682 gohugoio/hugoThemes
fix error
fix .Pages
-rw-r--r-- | config.toml | 1 | ||||
-rw-r--r-- | layouts/_default/list.html | 34 | ||||
-rw-r--r-- | layouts/partials/article_list.html | 11 | ||||
-rw-r--r-- | layouts/partials/profile.html | 3 | ||||
-rw-r--r-- | layouts/partials/widgets/recent_articles.html | 2 |
5 files changed, 32 insertions, 19 deletions
diff --git a/config.toml b/config.toml index e27b04c..6e08ea5 100644 --- a/config.toml +++ b/config.toml @@ -14,6 +14,7 @@ paginate = 10 copyright = "Powered by [Hugo](//gohugo.io). Theme by [wave](https://gitlab.com/syui/hugo-theme-wave)." date_format = "2006-01-02" dateformat = "2006-01-02" + mainSections = "posts" [[params.menu]] before = true diff --git a/layouts/_default/list.html b/layouts/_default/list.html index e3cb4f4..81eb49b 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -2,21 +2,25 @@ <div id="container"> <div class="outer"> - <section id="main"> - <section class="archives-wrap"> - <div class="archive-category-wrap"> - <span class="archive-category">{{ .Title }}</span> - </div> - <div class="archives"> - {{ $paginator := .Paginate .Data.Pages }} - {{ range $paginator.Pages }} - {{ .Render "summary" }} - {{ end }} - </div> - </section> - {{ partial "pagination" . }} - </section> - {{ partial "sidebar" . }} + <section id="main"> + <section class="archives-wrap"> + <div class="archive-category-wrap"> + <span class="archive-category">{{ .Title }}</span> + </div> + <div class="archives"> + {{ $pages := .Pages }} + {{ if .IsHome }} + {{ $pages = .Site.RegularPages }} + {{ end }} + {{ $paginator := .Paginate .Data.Site.RegularPages }} + {{ range $paginator.Pages }} + {{ .Render "summary" }} + {{ end }} + </div> + </section> + {{ partial "pagination" . }} + </section> + {{ partial "sidebar" . }} </div> </div> diff --git a/layouts/partials/article_list.html b/layouts/partials/article_list.html index 81bb1a2..6dc7f8b 100644 --- a/layouts/partials/article_list.html +++ b/layouts/partials/article_list.html @@ -1,7 +1,14 @@ <section id="main"> - {{ $paginator := .Paginate (where .Site.Pages "Type" "post") }} - {{ range $paginator.Pages }} + {{ $pages := .Pages }} + {{ if .IsHome }} + {{ $pages = .Site.RegularPages }} + {{ end }} + {{ $paginator := .Paginate $pages }} + <!-- + {{ $paginator := .Paginate (where .Site.Pages "Type" "post") }} + --> + {{ range $paginator.Pages }} <article class="article article-type-post" itemscope="" itemprop="blogPost"> <div class="article-inner"> diff --git a/layouts/partials/profile.html b/layouts/partials/profile.html index 647efad..288bf5a 100644 --- a/layouts/partials/profile.html +++ b/layouts/partials/profile.html @@ -13,7 +13,8 @@ </div> <div class="article-info profile-block"> <div class="article-info-block"> - {{ len (where .Site.Pages "Type" "post") }} + + {{ len (where .Site.RegularPages "Type" "post") }} <span>{{with .Site.Data.l10n.profile.posts}}{{.}}{{end}}</span> </div> <div class="article-info-block"> diff --git a/layouts/partials/widgets/recent_articles.html b/layouts/partials/widgets/recent_articles.html index 844d3d7..073df57 100644 --- a/layouts/partials/widgets/recent_articles.html +++ b/layouts/partials/widgets/recent_articles.html @@ -6,7 +6,7 @@ <li id="first-recent"><a href="/index.xml" id="firstmove" class="move"><h3 class="widget-title"> Posts </h3></a></li> - {{ range first 10 (where .Site.Pages "Type" "post") }} + {{ range first 10 (where .Site.RegularPages "Type" "post") }} <li><a href="{{ .Permalink }}" class="move"> {{ .Title }}</a> </li> {{ end }} |