Sitemapindex and .Site.Title error on list.html

I’m in the process of updating a theme for hugo 0.123.1 and I got the error below. I’m confused because it’s mentioning the sitemapindex.

Error: error building site: render: failed to render pages: render of "sitemapindex" failed: "/Users/brunoamaral/Labs/themes/soft-ui/layouts/_default/list.xml:3:18": execute of template failed: template: _default/list.xml:3:18: executing "_default/list.xml" at <.Title>: can't evaluate field Title in type []*hugolib.Site

The code on list.xml causing the error is a call to site title:
<title>{{ .Site.Title }} by {{ .Site.Params.author }}</title>

My site is multilingual, and I have set the title on the root of config.yaml and for each language. Already tried to keep the title just at the root or just within each language, always getting the same result.

Can we please see your site config?

This is the version that was working before v0.123.1

baseurl: "https://brunoamaral.eu/"
copyright: "Bruno Amaral 2024"
enableGitInfo: true
enableRobotsTXT: true
languageCode: "en-us"
publishdir: "public"
pygmentsCodefences: true
pygmentsOptions: ""
pygmentsUseClasses: true
rssLimit: 30
theme: "soft-ui"
timeout: 20000
title: "Bruno's Notebook"
# ignoreErrors:
#   - "error-remote-getjson"

params:
  author: "Bruno Amaral"
  cloudflareAnalytics: 
  umamiAnalytics: 
  defaultAuthor: "authors/bruno-amaral"
  defaultImage: "/images/shannon-potter-bHlZX1D4I8g-unsplash.jpeg"
  googleSiteVerification: ""
  googleTagManager: "GTM-MJBD46"
  headerPhoto: "/homepage/photo-1594047752131-1ec0a6dfa4fc.jpg"
  logo: "/brunoamaral-notebook.png"
  navbar: "sticky"
  subtitle: "The Creative Escape of Bruno Amaral"
  summary: ""
  subscriberForm: "https://dash.lisboncollective.com/add-subscriber/brunoamaral.eu"
  profiles:
    github: 'https://github.com/brunoamaral'
    instagram: 'https://instagram.com/brunoamaral'
    linkedin: 'https://www.linkedin.com/in/brunoamaral/'
    mastodon: 'https://mastodon.social/@brunoamaral'
    bluesky: 'https://bsky.app/profile/brunoamaral.eu'

mediaTypes:
  "application/json":
    suffixes:
      - "json"
outputs:
  home:
    - "HTML"
    - "RSS"
    - "JSON"
    - "Search"
  section:
    - "HTML"
    - "RSS"
    - "JSON"
  term:
    - "HTML"
    - "RSS"
outputFormats:
  Search:
    baseName: "index"
    mediaType: "application/json"
    path: "search"
permalinks:
  post: "/post/:slug/"
sitemap:
  changefreq: "weekly"
  priority: 0.5
  filename: "sitemap.xml"
taxonomies:
  tag: "tags"
  category: "categories"
  author: "authors"
  story: "stories"
DefaultContentLanguage: "en"
Languages:
  en:
    weight: 1
    LanguageName: "English"
    title: "Bruno's Notebook"
    params:
      description: "A creative escape by Bruno Amaral. Articles, blogposts, and projects relating to Digital Culture, Marketing and Technology."
      subtitle: "The creative escape of Bruno Amaral"
  pt:
    weight: 2
    LanguageName: "Portuguese"
    title: "Bruno's Notebook"
    params:
      description: "A fuga criativa de Bruno Amaral. Artigos, projectos, e escrita em torno de Cultura Digital, Marketing e Tecnologia"
      subtitle: "Contos de uma mente hiperactiva"
imaging:
  resampleFilter: "lanczos"
  quality: 75
  anchor: "smart"
minify:
  minifyOutput: true
security:
  enableInlineShortcodes: false
  exec:
    allow:
      - '^dart-sass-embedded$'
      - '^go$'
      - '^npx$'
      - '^postcss$'
    osEnv:
      - '(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$'
  funcs:
    getenv:
      - '^HUGO_'
      - 'SLUG'
      - 'post_datetime'
      - 'post_image'
      - 'post_tags'
      - 'post_slug'
      - 'post_title'
      - 'post_content'
      - 'google_maps_link'
      - 'latitude'
      - 'longitude'
  http:
    methods:
      - '(?i)GET|POST'
    urls:
      - '.*'
frontmatter:
  lastmod:
    - "lastmod"
    - ":fileModTime"
    - ":default"

OK, I can reproduce the problem with this RSS template:

layouts/_default/list.xml

There are no problems if I rename the template to any of these:

layouts/_default/rss.xml
layouts/_default/list.rss.xml  <-- preferred because the output format is not inferred
layouts/_default/section.xml

That fixed it, thank you!

I’ll log a bug on this, but I’m glad it’s working for you.

https://github.com/gohugoio/hugo/issues/12101

This was resolved with https://github.com/gohugoio/hugo/pull/12102

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