Skip to content

Error when title = null for the current language #502

@axelkar

Description

@axelkar

Summary and motivation

With this config (trying to achieve /en/ and /fi/ without either of them being at top-level)

# top-level "title" missing
default_language = "zz"

[languages.en]
title = "tabi"
[languages.fi]
title = "tabi"

Zola returns this fairly cryptic error:

Error: Failed to build the site
Error: Failed to render '404.html' (error happened in 'base.html').
Error: Reason: Tried to concat a value that is not a string or a number from ident prefix

In reality it happens in template/partials/title.html:

{%- set prefix = config.title | safe -%}
...
{{- suffix ~ separator ~ prefix -}}

Implementation details

Somewhere in templates/partials/title.html. I have no idea how you can throw an error in Tera, and I guess making the error better would be in the scopes of Tera and Zola

Checklist

  • I've searched existing issues to make sure this feature hasn't already been requested.
  • This feature aligns with tabi's philosophy (minimal JS, accessible…)
  • I'm willing to contribute to the implementation of this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions