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

🔍 Fails to build using Utterances Module #776

Closed
axeII opened this issue Jun 12, 2023 · 5 comments
Closed

🔍 Fails to build using Utterances Module #776

axeII opened this issue Jun 12, 2023 · 5 comments
Labels
help wanted Extra attention is needed investigating investigating the issue

Comments

@axeII
Copy link

axeII commented Jun 12, 2023

Describe the bug
Building my blog using blowfish theme was fine until I suddenly started using Utterances Module (tool adding comments via github). I followed the module instructions for installation however after installation I am unable to build my blog.

I get this strange error complaining about series order sequence:

ERROR 2023/06/13 01:27:58 render of "page" failed: "/Users/akira/Development/my-blog/themes/blowfish/layouts/_default/single.html:40:11": execute of template failed: template: _default/single.html:40:11: executing "main" at <partial "series.html" .>: error calling partial: "/Users/akira/Development/my-blog/themes/blowfish/layouts/partials/series.html:10:22": execute of template failed: template: partials/series.html:10:22: executing "partials/series.html" at <sort (index .Site.Taxonomies.series $seriesNameURL) "Params.series_order">: error calling sort: sequence must be provided
Error: Error building site: failed to render pages: render of "page" failed: "/Users/akira/Development/my-blog/themes/blowfish/layouts/_default/single.html:40:11": execute of template failed: template: _default/single.html:40:11: executing "main" at <partial "series.html" .>: error calling partial: "/Users/akira/Development/my-blog/themes/blowfish/layouts/partials/series.html:10:22": execute of template failed: template: partials/series.html:10:22: executing "partials/series.html" at <sort (index .Site.Taxonomies.series $seriesNameURL) "Params.series_order">: error calling sort: sequence must be provided

Once I remove the module, error goes away. It's strange since I did not touch blowfish theme just installed it.

To Reproduce
Steps to reproduce the behavior:

  1. Install blowfish theme as git submodule
  2. Setup blog with posts and some of them set as series
  3. Install Utterances as module (follow it's instructions how to install)
  4. Setup it as comments following blowfish documentation for comments
  5. Try to build the site and get the error

Expected behavior
Normal build without any error with series.

Desktop (please complete the following information):

  • OS: macOS 13.4
  • Browser : Firefox
  • Version 113

Hugo & Blowfish versions

hugo: v0.111.3+extended darwin/arm64 BuildDate=unknown
blowfish: 2.33.2

Additional context
Here is the PR that adds comments as module and has the issue (main branch works fine) axeII/axell.dev#1

@axeII axeII changed the title Fails to build using Utterances Module 🐛 Fails to build using Utterances Module Jun 14, 2023
@nunocoracao
Copy link
Owner

Hello @axeII didn't have time to investigate this further. Could you provide the links to the installation guide you followed for utterances? And also the comments docs from Blowfish you are referring to? That will help when I get time to investigate this.

@nunocoracao nunocoracao added help wanted Extra attention is needed investigating investigating the issue labels Jul 10, 2023
@nunocoracao nunocoracao changed the title 🐛 Fails to build using Utterances Module 🔍 Fails to build using Utterances Module Jul 10, 2023
@thedaxshepherd
Copy link

I followed the steps as indicated above (including uncommenting the required lines in the Hugo.toml file) and
was able to reproduce the issue. I know what is causing the issue and propose a couple solutions below. It is
not an issue with the theme.

This is an issue with having multiple configuration files in the root folder. It is not picking up the taxonomies
configuration in the Config.toml file in the root folder because a Hugo.toml file has been added with the Utterances
configuration. When you run Hugo you can confirm where it is watching for config changes and the Hugo.toml file is listed but
not the Config.toml file.

The easiest way to test this is to run Hugo with a flag to read multiple configuration files:
Hugo --config config.toml,hugo.toml -t blowfish server

If you were not using the -t flag and had the theme in the config.toml file (theme = "blowfish") you would get an error message
about the alert shortcode since the theme would not be loading. Instead it loaded the theme but did not have the taxonomies
configuration which is why you received the series error.

There are a couple solutions to fix this beyond adding the flag everytime you run Hugo. The first is to just copy the config.toml
into the /config/_default folder. This aligns with the current instructions for BlowFish
(https://blowfish.page/docs/installation/#set-up-theme-configuration-files) which places the config.toml in that folder.
Then Hugo will read both files.

Personally I would copy the information from the Hugo.toml file and put it in the Config.toml file so it is all in one place.
And then remove the Hugo.toml file regardless of where you place the Config.toml file.

The instructions on the HugoMods file are not easy to follow. It really should have said to just add the site parameters to your
current site configuration file with an example. Make sure you still go through the setup steps on the Utterances site
(https://utteranc.es/) to configure the repo.

@Ast3risk-ops
Copy link
Contributor

Ast3risk-ops commented Feb 6, 2024

Though at the same time, you could try giscus (utterances but powered by github discussions, so it has more features) in the meantime, which works out of the box with Blowfish (add the script to the comments partial)

@thedaxshepherd
Copy link

@nunocoracao I think this issue can be closed. My solution is posted above along with the root cause.

@nunocoracao
Copy link
Owner

Thanks @thedaxshepherd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed investigating investigating the issue
Projects
None yet
Development

No branches or pull requests

4 participants