Wowchemy-hugo-modules: "Homepage not found" error after upgrading Hugo >= v0.65 < 0.69

Created on 13 Mar 2020  Â·  22Comments  Â·  Source: wowchemy/wowchemy-hugo-modules

After I upgrade my Hugo to 0.67.0 and Academics to 4.8, I began to get the following error message when I execute blogdown::build_site(): Homepage not found or duplicate homepages detected for a localization!.

Before the upgrade, it was compiling without any problem, everything was good.

The source code of my web site is found at https://gitlab.com/ogurcan/web-site/-/tree/upgradeHugo67Academic48

Can anyone help me? What could be the problem? I did all the breaking changes of the Academics releases, but still getting the same error.

stale upstream

Most helpful comment

@gcushen

The latest release v0.71.1 seems to solve this problem. However, a new error rise during building

Error: Error building site: failed to render pages: render of "page" failed: 
".../academic-kickstart/themes/academic/layouts/publication/single.html:14:10": 
execute of template failed: template: publication/single.html:14:10: 
executing "main" at <(.Params.publication_types) and (ne (index .Params.publication_types 0) "0")>: 
can't give argument to non-function .Params.publication_types

All 22 comments

The full message that Academic outputs if a homepage is not found is as follows - maybe Blogdown truncated it in your case:

Homepage not found or duplicate homepages detected for a localization! Add the home/ folder (especially /home/index.md) to each language's content folder. For example, your site should have a content/home/ folder containing index.md and your homepage sections, or for multi-language sites, content/en/home/ and content/zh/home/ etc. Refer to the 'Build Your Homepage' and 'Language' documentation at https://sourcethemes.com/academic/docs/ and the example homepage at https://github.com/gcushen/hugo-academic/tree/master/exampleSite/content/home/index.md .

So it would appear that you may have missed an item in the Breaking Changes of the upgrade process (creating the /home/index.md file for the homepage), or your contentDir config in config.toml/languages.toml file has been explicitly set but is not pointing to a valid location of your content folder. In any case, the full error msg above mentions how to help resolve this error.

For support, see https://github.com/gcushen/hugo-academic/blob/master/.github/support.md

Thank you for the comment. I checked config.toml / languages.toml and could not find any explicit content dir definition. I am still getting the same error message which does not help me to find the source of the problem. Isn't there any kind of log or something like where we can trace the process and see what is happening?

The config.toml file I have is:

# Configuration of Academic
# Documentation: https://sourcethemes.com/academic/
#
# This file is formatted using TOML syntax - learn more at https://learnxinyminutes.com/docs/toml/
# Each configuration section is defined by a name in square brackets (e.g. `[outputs]`).

# Title of your site
title = "Önder Gürcan"

# The URL of your site.
# End your URL with a `/` trailing slash, e.g. `https://example.com/`.
baseurl = "/"

# Enter a copyright notice to display in the site footer.
# To display a copyright symbol, type `&copy;`. For current year, type `{year}`.
copyright = ""

############################
## Advanced options below ##
############################

# Name of Academic theme folder in `themes/`.
theme = "hugo-academic"

# Get last modified date for content from Git?
enableGitInfo = false

# Default language to use (if you setup multilingual support)
defaultContentLanguage = "en"
hasCJKLanguage = false  # Set `true` for Chinese/Japanese/Korean languages.
defaultContentLanguageInSubdir = false
removePathAccents = true  # Workaround for https://github.com/gohugoio/hugo/issues/5687

summaryLength = 30  # Listing summary length in words. Also, see `abstract_length` in `params.toml`.
paginate = 10  # Number of items per page in paginated lists.
enableEmoji = true
footnotereturnlinkcontents = "<sup>^</sup>"
ignoreFiles = ["\\.ipynb$", ".ipynb_checkpoints$", "\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]

[outputs]
  home = [ "HTML", "RSS", "JSON", "WebAppManifest" ]
  section = [ "HTML", "RSS" ]

[mediaTypes."application/manifest+json"]
  suffixes = ["webmanifest"]

[outputFormats.WebAppManifest]
  mediaType = "application/manifest+json"
  rel = "manifest"

[markup]
  defaultMarkdownHandler = "goldmark"
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true  # Enable user to embed HTML snippets in Markdown content.
  [markup.highlight]
    codeFences = false  # Disable Hugo's code highlighter as it conflicts with Academic's highligher.
  [markup.tableOfContents]
    startLevel = 2
    endLevel = 3

[imaging]
  resampleFilter = "lanczos"
  quality = 90
  anchor = "smart"  # Anchor for cropping. Options include Smart and Center.

# Taxonomies.
[taxonomies]
  tag = "tags"
  category = "categories"
  publication_type = "publication_types"
  author = "authors"

The languages.toml file I have is:

# Languages
#   Create a `[X]` block for each language you want, where X is the language ID.
#   Refer to https://sourcethemes.com/academic/docs/language/

# Configure the English version of the site.
[en]
  languageCode = "en-us"
  # contentDir = "content/en"  # Uncomment for multi-lingual sites, and move English content into `en` sub-folder.

# Uncomment the lines below to configure your website in a second language.
#[zh]
#  languageCode = "zh-Hans"
#  contentDir = "content/zh"
#  title = "Chinese website title..."
#  [zh.params]
#    description = "Site description in Chinese..."
#  [[zh.menu.main]]
#    name = "Wo"
#    url = "#about"
#    weight = 1

PS: I have already asked for help both in the community chat and the forum few days ago but I got no response.

Your home page is actually fine - you've upgraded it successfully. You can verify this by temporarily moving everything out of the content folder except for authors and home.

The error message actually appears if there is an issue loading any of the widget pages (including the home page). We can improve the error message to clarify that.

The issue appears to be relating to the other widget pages that your site has. If I rename the folders of your other widget pages to random words or things like our-projects, your site builds fine. So it would appear that page bundles with singular/plural or similar names might be affected.

The cause of the issue may be something related to a Hugo bug or the recent changes in Hugo, especially the changes Hugo team made to how page bundles and page resources work.

You may wish to reach out on the Hugo forums and see if any other Hugo users have been experiencing issues with using Hugo's GetPage function on page bundles in recent versions of Hugo.

Thank you for the feedback. I tried renaming the widget pages one by one and found out that my site builds fine if I rename posts as my-posts, projects as my-projects and talks as my-talks.

However, the tags widget page is not built as before. When I was using the older Academic version, the generated tags page (which is found here) was listing all the tags as a tag cloud in one page. But when I am using 4.8, it is showing again all but it is automatically creating several pages to display all the tags and tags are listed as a list - one item per line and all items have the same size.

But, very interestingly, if I rename tags as my-tags, it builds fine again and showing the tags as before (as a tag cloud). However, this time, rather showing all the tags (which are in total 69), it is showing a subset of them (which are in total 20).

rather showing all the tags (which are in total 69), it is showing a subset of them (which are in total 20)

Based on feedback, an option named count was added to Tag widget front matter to control the number of tags displayed: https://sourcethemes.com/academic/docs/page-builder/#tag-cloud . If you add the option to your front matter, you can control the number of tags displayed to visitors.

OK thanks for the explanation. I just want to precise that my site is building when I rename all of the three following folders: posts, projects and talks. If I do not rename any of them, the site is not building.

I hope that this information helps you find the bug.

Similar issue in #1599, but caused by Emacs temporary files

I precise that I am using RStudio 1.2.5033. However, as I understand, you have reproduced the same error in your environment also.

I think I have the same problem.

Hugo Version 0.68.1
Academic Version 4.8

I do not use the multi-language feature.
My hompage (widget page) is in content/home/index.md.
I have a second widget page called projects content/projects/index.md.
My project files are at content/project/.

Hugo does not render unless I rename content/projects/ to e.g. content/my-projects. If I do everything is working fine.

Just to add that my website seem to have the same problem too. Nothing to do with the actual home page, but with other widget pages content/publications and content/talks (I also have content/publication and content/talk as "standard hugo-academic widgets and they work perfectly).

I suppose this is then a hugo problem? (I think the website (that is a version that still works, not the broken one...) was updated last on March 19th, using V4.9 and the latest hugo, though)...

The cause of this issue is a confirmed bug in Hugo - see https://github.com/gohugoio/hugo/issues/7096

Hugo team have submitted a fix to be included in Hugo v0.69.

Thank you @gcushen. This is most helpful.

This issue has been automatically marked as stale because it has not had any recent activity. The resources of the Academic team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically close soon if no further activity occurs. Thank you for your contributions.

This is still occurring for me, with hugo 0.70. Any thoughts on how I can get rid of it now?

Same problem for me, it is really bad, because I cannot create my group homepage. It worked partly with changing to content/my-xx but then it crashes again...

I can confirm that this issue is still in play.

Renaming the folders of widget pages solved the problem for me. I am using Hugo 0.69.2.

Same for me now

denizCvrl notifications@github.com schrieb am So., 24. Mai 2020, 10:46
vorm.:

Renaming the folders of widget pages solved the problem for me. I am using
Hugo 0.69.2.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/gcushen/hugo-academic/issues/1595#issuecomment-633164659,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHQHHH7YDFZ35Y3R65GHQR3RTB37PANCNFSM4LHGVODA
.

If the bug still exists in Hugo 0.70+, then please consider opening a new bug report (similar to https://github.com/gohugoio/hugo/issues/7096) in the Hugo repo.

Perhaps Bep might have fixed the remaining bugs around this issue yesterday (23 May 2020) in https://github.com/gohugoio/hugo/issues/7305 , although you might have to wait for the next Hugo release containing that fix to find out.

@gcushen

The latest release v0.71.1 seems to solve this problem. However, a new error rise during building

Error: Error building site: failed to render pages: render of "page" failed: 
".../academic-kickstart/themes/academic/layouts/publication/single.html:14:10": 
execute of template failed: template: publication/single.html:14:10: 
executing "main" at <(.Params.publication_types) and (ne (index .Params.publication_types 0) "0")>: 
can't give argument to non-function .Params.publication_types

@gcushen

The latest release v0.71.1 seems to solve this problem. However, a new error rise during building

Error: Error building site: failed to render pages: render of "page" failed: 
".../academic-kickstart/themes/academic/layouts/publication/single.html:14:10": 
execute of template failed: template: publication/single.html:14:10: 
executing "main" at <(.Params.publication_types) and (ne (index .Params.publication_types 0) "0")>: 
can't give argument to non-function .Params.publication_types

actually that's described and solved in #1717

my temporary dirty hack (I have to keep my teaching up to date):
remove the publications

  • backup!
  • rm content/publication
  • rm content/home/publication.md
  • rm all refs to publications

@highlando @sringe @denizCvrl @lyndondrake

Rather than changing the entire structure of your website because of this bug, just hold the Hugo package on an older more stable version. I am deploying on Netlify which is backed with Ubuntu 16.04 and Hugo 0.58.3. Until a real solution is found to this, its a really bad idea to be constantly changing the URL structure of your domain with each bugged version of Hugo. Pretty much any SEO value you have built up will be useless unless you go back and redirect all those pages.

Package Downgrades
Deb: https://www.linuxuprising.com/2019/02/how-to-downgrade-packages-to-specific.html
RHL: https://access.redhat.com/solutions/29617
Arch: https://wiki.archlinux.org/index.php/downgrading_packages

@gcushen
Is there anything we can add or test to create a more accurate issue on the Hugo repo? The logs are really generic in terms of reporting the conflicts creating the error. Given that this is over 3 months old and has already been closed and reopened, I get the feeling that we are missing the real issue here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anirbanbasu picture anirbanbasu  Â·  3Comments

gcushen picture gcushen  Â·  3Comments

netw0rkf10w picture netw0rkf10w  Â·  4Comments

halfrost picture halfrost  Â·  3Comments

Framartin picture Framartin  Â·  4Comments