hugo-sid/hugo-blog-awesome

RSS Template Errors Preventing Build

Closed this issue · 6 comments

nibl commented

RSS template fails with multiple errors:

... render of "home" failed: ".../themes/hugo-blog-awesome/layouts/_default/rss.xml:22:17": execute of template failed: template: _default/rss.xml:22:17: executing "_default/rss.xml" at : can't evaluate field LanguageCode in type *langs.Language

Hugo gives the same error for render of "taxonomy" and "term". The errors do not occur with version 1.2.0 of the theme, which is the only older version I have tested.

Theme is latest version pulled via git. Hugo is v0.111, the latest available on Ubuntu via Snap.

Same exact issue here on the same Hugo version, but was able to build this by changing this (line 22) in rss.xml:
{{ .Site.Language.LanguageCode }}{{ with .Site.Author.email }}
To this:
{{ .Site.LanguageCode }}{{ with .Site.Author.email }}

It seems the ability to select a language disappears, however.

Thanks @nibl, @the-chronomancer & @InSpaceDude for reporting this.

I don't see any error with the latest version of Hugo (v0.120.4). See the screenshot below for more details.

image

This issue has been marked stale due to inactivity. It will auto-close in 7 days without an update.

@hugo-sid I am encountering this issue now as well:
It doesn't appear when building locally but using the hugo action doesn't work anymore to publish the changes

Local

image

GitHub action:

image

Edit: After some more inspections I found an inconsistency that could be the the culprit:

Take a look at the small site whereas everywhere else .Site is used

 <language>{{ site.Language.LanguageCode }}</language>{{ with .Site.Author.email }}
 <language>{{ .Site.LanguageCode }}</language>{{ with .Site.Author.email }}

Never mind... it is still broken because I can't use my own fork for the hugo action -.-

Alright after a LOOONG look at it again, I solved it now. It doesn't work with the GitHub Action because the action uses an older version of hugo.

@nibl @the-chronomancer Make sure you have hugo set to the latest version:

jobs:
  # Build job
  build:
    runs-on: ubuntu-latest
    env:
      HUGO_VERSION: 0.120.4

I had mine before on HUGO_VERSION: 0.111.2

Make sure you have hugo set to the latest version:

Thanks @paddy-exe for confirming that this issue doesn't exist in Hugo (v0.120.4).

I'm closing this issue for now. Please feel free to reopen/comment if anyone encounters this issue again.