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

Example blog doesn't work #6752

Closed
falzm opened this issue Jan 14, 2020 · 2 comments · Fixed by #6772
Closed

Example blog doesn't work #6752

falzm opened this issue Jan 14, 2020 · 2 comments · Fixed by #6772

Comments

@falzm
Copy link

falzm commented Jan 14, 2020

The example blog provided in examples/ seems to be obsolete when ran with up-to-date Hugo version:

marc@cobalt:~/hugo/examples/blog$ hugo
Building sites … WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/01/14 10:35:41 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
Total in 18 ms
Error: Error building site: failed to render pages: render of "home" failed: "/var/folders/qb/512rrh_n51x1fb40yc3l1sj40000gn/T/tmp.n7Ecxv4E/hugo/examples/blog/layouts/index.html:10:90": execute of template failed: template: index.html:1:3: executing "index.html" at <partial "header.html" .>: error calling partial: "/var/folders/qb/512rrh_n51x1fb40yc3l1sj40000gn/T/tmp.n7Ecxv4E/hugo/examples/blog/layouts/partials/header.html:10:90": execute of template failed: template: partials/header.html:10:90: executing "partials/header.html" at <.Title>: can't evaluate field Title in type *page.OutputFormat

The compilation error can be fixed with this change:

--- a/examples/blog/layouts/partials/header.html
+++ b/examples/blog/layouts/partials/header.html
@@ -7,6 +7,6 @@
     <link rel="canonical" href="{{ .Permalink }}">
     {{ partial "header.includes.html" . }}
     {{ with .OutputFormats.Get "RSS" -}}
-    {{ printf "<link href=%q rel=\"alternate\" type=%q title=%q />" .Permalink .MediaType .Title | safeHTML }}
+    {{ printf "<link href=%q rel=\"alternate\" type=%q title=%q />" .Permalink .MediaType $.Site.Title | safeHTML }}
     {{- end }}
 </head>

However even when fixing the compilation error, the rendered blog is broken (clicking on either Posts or Read More lead to a blank page):

Screenshot 2020-01-14 at 10 38 02

What version of Hugo are you using (hugo version)?

$ hugo version
Hugo Static Site Generator v0.62.2/extended darwin/amd64 BuildDate: unknown

Does this issue reproduce with the latest release?

Yes

colonelpopcorn added a commit to ShowMeTheCode-io/hugo that referenced this issue Jan 18, 2020
The example blog had not been updated for some time and I had to restructure it a little bit.

Fixes gohugoio#6752

Changed tag and category directory structure
@colonelpopcorn
Copy link
Contributor

Hi, just spent some time fixing up the blog, please take a look at PR #6772. It looks like it had not been updated for some time. I moved around a few of the pages, and that fixed the broken pages. After applying the fix posted by @falzm to the header partial.

Thanks!

@bep bep closed this as completed in #6772 Jan 19, 2020
bep pushed a commit that referenced this issue Jan 19, 2020
The example blog had not been updated for some time and I had to restructure it a little bit.

Fixes #6752

Changed tag and category directory structure
jakejarvis pushed a commit to jakejarvis/hugo that referenced this issue Mar 5, 2021
The example blog had not been updated for some time and I had to restructure it a little bit.

Fixes gohugoio#6752

Changed tag and category directory structure
@github-actions
Copy link

github-actions bot commented Feb 9, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants