ERROR deprecated: .Site.DisqusShortname was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.Disqus.Shortname instead

When I tried to deploy my site today, I received errors that prompted me to upgrade gohugo-theme-ananke that hasn’t resolved the issue of the title and I’m unsure how to resolve it.

Hugo humbles me :frowning:

I had go.mod:

module {my-repo}

go 1.19

require (
    github.com/theNewDynamic/gohugo-theme-ananke v0.0.0-20230203204610-a1a99cf12681 // indirect
)

When I tried to deploy the site or just hugo server -D, I received errors:

Start building sites … 
hugo v0.132.0-DEV-e42263529c35d966b752690ad1bcb461b90b470d+extended linux/amd64 BuildDate=2024-08-11T18:57:15Z VendorInfo=snap:0.131.0+git23.e42263529

WARN  deprecated: .Site.Social was deprecated in Hugo v0.124.0 and will be removed in a future release. Use .Site.Params instead.
ERROR deprecated: .Site.DisqusShortname was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.Disqus.Shortname instead.

Curiously the (breaking) ERROR is β€œwill be removed in Hugo 0.133.0” but I’m running Hugo 0.132.0 :frowning:

My Hugo site content (ex-theme) does not reference .Site.Social nor .Site.DisqusShortname and so I assume the error results from the combination with the gohugo-theme-ananke.

I realized I’m using an outdated gohugo-theme-ananke and bumped it:

go get github.com/theNewDynamic/gohugo-theme-ananke@latest

This resulted in other errors which I’ve avoided by deleting the content from my local layouts/_default/baseof.html because…

However, the .Site.Social and .Site.DisqusShortname errors persist.

I cloned gohugo-theme-ananke repo and used the same hugo instance to run its exampleSite which works without issue.

So, my questions are:

  1. What can I do to resolve this error?
  2. Why is hugo bailing on a future ERROR (v0.133.0 vs v0.132.0)?
  3. Why does exampleSite serve (no .Site.DisqusShortname error) when my site (that doesn’t reference .Site.DisqusShortname doesn’t?

Thanks!

tree:

.
β”œβ”€β”€ archetypes
β”‚   └── default.md
β”œβ”€β”€ content
β”‚   └── posts
β”‚       └── {various}
β”œβ”€β”€ data
β”œβ”€β”€ deploy.sh
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
β”œβ”€β”€ hugo.toml
β”œβ”€β”€ layouts
β”‚   β”œβ”€β”€ _default
β”‚   β”‚   β”œβ”€β”€ baseof.html
β”‚   β”‚   └── _markup
β”‚   β”‚       └── render-link.html
β”‚   └── partials
β”‚       └── analytics.html
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ 404.html
β”‚   β”œβ”€β”€ ananke
β”‚   β”‚   β”œβ”€β”€ css
β”‚   β”œβ”€β”€ categories
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   └── index.xml
β”‚   β”œβ”€β”€ CNAME
β”‚   β”œβ”€β”€ dist
β”‚   β”‚   β”œβ”€β”€ css
β”‚   β”‚   └── js
β”‚   β”œβ”€β”€ images
β”‚   β”‚   └── {various}
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ index.xml
β”‚   β”œβ”€β”€ posts
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   β”œβ”€β”€ index.xml
β”‚   β”‚   └── page

β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ robots.txt
β”‚   β”œβ”€β”€ sitemap.xml
β”‚   └── tags
β”‚       └── {various}
β”‚           β”œβ”€β”€ index.html
β”‚           └── index.xml
β”œβ”€β”€ README.md
β”œβ”€β”€ resources
β”‚   └── _gen
β”‚       β”œβ”€β”€ assets
β”‚       β”‚   β”œβ”€β”€ ananke
β”‚       β”‚   β”‚   └── css
β”‚       β”‚   β”‚       └── {several .content|.json}
β”‚       β”‚   └── css
β”‚       β”‚       └── ananke
β”‚       β”‚           └── css
β”‚       β”‚               └── {several .content|.json}
β”‚       └── images
β”œβ”€β”€ static
β”‚   └── images
β”‚       └── ...
└── themes
1 Like

The deprecation policy described in

When we remove this feature in Hugo 0.133.0 we cannot warn/error about it anymore, because it’s not there, which is why you get this now.

I haven’t checked, but are you sure this isn’t fixed in the Ananke theme?

1 Like

Thanks for replying!

I understand why you can’t warn/error when it’s not there

But, with v0.132.0, why does it (error and) break the build?

When I run the gohugo-ananke-theme’s exampleSite, I don’t get the error so I think it is fixed.

But why do I then get the error if:

  1. My content doesn’t reference .Site.DisqusShortname and;
  2. I’m taking the latest commit of gohugo-ananke-theme

This is clearly user error but I don’t understand where I’m making the mistake.

That’s what ERROR do in Hugo. We have given this some consideration, and we thought that doing the INFO, WARN and then finally ERROR for about a year should give people enough time to do some search and replace in their templates.

But I’m a little curious; the error message should be clear; what is your question?

I don’t reference .Site.DisqusShortname and yet I’m unable to build the site:

WARN  deprecated: .Site.Social was deprecated in Hugo v0.124.0 and will be removed in a future release. Use .Site.Params instead.
ERROR deprecated: .Site.DisqusShortname was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.Disqus.Shortname instead.
Total in 723 ms
Error: error building site: logged 1 error(s)

Corrollary: I’m getting an error for something I think I’m not doing.

Sure, but you do understand what the error message means?

My final take on this is this:

  • We INFO log about this for a few months.
  • Then we WARN log month about this for a few months.
  • Then we ERROR log and fail the build as a final heads up.
  • Then we remove the β€œthing” and it will fail with a confusing message.

The above is at least well intentioned, but I understand that there may be different opinions.

Yes, I feel I’m explaining myself poorly.

If I were using .Site.DisqusShortname in my site, I would understand the error.

But, since I think I’m not using .Site.DisqusShortname, I don’t understand:

  • Why I’m receiving the error;
  • Why – as a result – I’m unable to build my site.

I am also feeling guilty at occupying your time on this issue but I don’t know how to proceed.

I suspect something is, but it’s difficult to know what that something is without seeing the full picture. It would help if you could share your project repository, privately if you wish.

My email address is the account name at Gmail.

I will add whatever email address you PM me to my repo.

Thank you!

You’re added, thank you!

I may have jumped to the conclusions above and assumed that this was about how we handled deprecations. I slightly apologise for that.

I have looked at the Ananke theme and it looks to be updated, but I notice that they use a versioning/path setup not compatible with Go Modules (which Hugo uses).

I will check up on that and try to get a fix merged upstream to fix this, and get back to you about this tomorrow.

Thank you both for your time on this!

I really appreciate you.

1 Like

@jmooring has helped me resolve the issue:

  1. Create a clean clone of the repo
  2. hugo mod get -u ./...

It now builds.

Thank you both very much!

3 Likes

A post was split to a new topic: Help with deprecation error

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.