chipzoller / hugo-clarity

A theme for Hugo based on VMware Clarity
Other
577 stars 262 forks source link

[Bug] .Site.DisqusShortname deprecated as of Hugo v0.120.0 #471

Open IntModifier opened 3 months ago

IntModifier commented 3 months ago

I confirm:

Hugo version

hugo v0.127.0-74e0f3bd63c51f3c7a0f07a7c779eec9e922957e+extended windows/amd64 BuildDate=2024-06-05T10:27:59Z VendorInfo=gohugoio

Where is this bug showing up?

On the command line: Hugo won't build the site and shows warnings or errors.

Operating system

Windows 11

Browser (if applicable)

Firefox 126.0.1 (64-bit)

Current behavior

When running 'hugo' or 'hugo server' command, a warning is displayed: (the site still builds as expected after the warning is displayed)

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

i looked through the file and found that .\layouts\partials\comments.html is the file referencing '.Site.DisqusShortname', on my local copy of the theme project I updated line 2 to be:
{{ if .Site.Config.Services.Disqus.Shortname }} and tried building the site again and now received no Warning.

I am not nearly confident enough about the details on how a Hugo theme is built and works to submit a pull request but I wanted to share in case it is as simple as updating this one file.

Thanks for the great theme!

Expected behavior

Not receiving the depreciation warning when running 'hugo' or 'hugo server' commands

Steps to reproduce

build site using hugo-clarity theme with Hugo v0.120.0 or later

Relevant log output

Start building sites … 
hugo v0.127.0-74e0f3bd63c51f3c7a0f07a7c779eec9e922957e+extended windows/amd64 BuildDate=2024-06-05T10:27:59Z VendorInfo=gohugoio     

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

                   | EN
-------------------+-----
  Pages            | 47
  Paginator pages  |  2
  Non-page files   | 16
  Static files     | 41
  Processed images |  0
  Aliases          | 33
  Cleaned          |  0

Total in 5584 ms

Related code

File: .\layouts\partials\comments.html Line 2 current: {{ if .Site.DisqusShortname }} new: {{ if .Site.Config.Services.Disqus.Shortname }}

Preferred solution

No response

Other information

No response