Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/parsiya/Hugo-Octopress.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Zhiburt <zhiburt@gmail.com>2022-01-15 13:15:35 +0300
committerGitHub <noreply@github.com>2022-01-15 13:15:35 +0300
commit4db7d0e7b60a84cf4a17945e856df09159eef63d (patch)
treef71d13c9210647ed4e6e4020cec0fdb514f7348c
parentbc4b2a2a22c69600bedf5a2220b4f58a876d553d (diff)
Fix a nil pointer error (#71)
```log failed to render pages: render of "page" failed: execute of template failed: template: myarchivetype/single.html:7:5: executing "myarchivetype/single.html" at <partial "classic_index.html" .>: error calling partial: execute of template failed: template: _internal/pagination.html:21:17: executing "_internal/pagination.html$htmltemplate_stateHTMLCmt" at <$page.Paginator.TotalPages>: error calling TotalPages: runtime error: invalid memory address or nil pointer dereference ```
-rwxr-xr-xlayouts/partials/classic_index.html40
1 files changed, 21 insertions, 19 deletions
diff --git a/layouts/partials/classic_index.html b/layouts/partials/classic_index.html
index 0813f46..5a4d567 100755
--- a/layouts/partials/classic_index.html
+++ b/layouts/partials/classic_index.html
@@ -4,26 +4,28 @@
<div id="content">
<div class="blog-index">
{{ $paginator := where site.RegularPages "Type" "in" site.Params.mainSections | .Paginate }}
- {{ range $paginator.Pages }}
- <article>
- <!-- {{ .Scratch.Set "isHome" true }} -->
- {{ partial "post_header.html" . }}
- {{ if eq .Site.Params.truncate false }}
- {{ .Content }}
- {{ else if .Description }}
- {{ .Description }}
- <footer>
- <a href="{{ .Permalink }}" rel="full-article">{{ with .Site.Params.continueReadingText }}{{ . | markdownify }}{{ else }}Read On &rarr;{{ end }}</a>
- </footer>
- {{ else }}
- <p>{{ .Summary }}</p>
- {{ if .Truncated }}
- <footer>
- <a href="{{ .Permalink }}" rel="full-article">{{ with .Site.Params.continueReadingText }}{{ . | markdownify }}{{ else }}Read On &rarr;{{ end }}</a>
- </footer>
+ {{ if $paginator }}
+ {{ range $paginator.Pages }}
+ <article>
+ <!-- {{ .Scratch.Set "isHome" true }} -->
+ {{ partial "post_header.html" . }}
+ {{ if eq .Site.Params.truncate false }}
+ {{ .Content }}
+ {{ else if .Description }}
+ {{ .Description }}
+ <footer>
+ <a href="{{ .Permalink }}" rel="full-article">{{ with .Site.Params.continueReadingText }}{{ . | markdownify }}{{ else }}Read On &rarr;{{ end }}</a>
+ </footer>
+ {{ else }}
+ <p>{{ .Summary }}</p>
+ {{ if .Truncated }}
+ <footer>
+ <a href="{{ .Permalink }}" rel="full-article">{{ with .Site.Params.continueReadingText }}{{ . | markdownify }}{{ else }}Read On &rarr;{{ end }}</a>
+ </footer>
+ {{ end }}
{{ end }}
+ </article>
{{ end }}
- </article>
{{ end }}
<!-- {{ template "_internal/pagination.html" . }} default pagination -->
{{ partial "pagination.html" . }} <!-- use custom pagination -->
@@ -31,4 +33,4 @@
{{ partial "sidebar.html" . }} <!-- sidebar -->
</div>
</div>
-{{ partial "footer.html" . }} <!-- footer --> \ No newline at end of file
+{{ partial "footer.html" . }} <!-- footer -->