Skip to content

hugo-site/config.toml is dead config: Hugo loads hugo.toml and ignores it #111

Description

@sanity

Problem

hugo-site/ contains both hugo.toml and config.toml, with different, non-overlapping content. Hugo ≥0.110 prefers hugo.toml and ignores a root config.toml entirely, so everything in config.toml is silently inert.

config.toml currently holds only settings that are therefore having no effect:

  • [[module.mounts]] for static and static/wasm
  • [server.headers] setting Content-Type: application/wasm for /wasm/**
  • [mediaTypes."application/wasm"]
  • [outputFormats.WASM]

Evidence

Confirmed empirically against hugo config (Hugo 0.154.5), not inferred:

  • [outputFormats.WASM], defined only in config.toml, is absent from the effective config.
  • The static/wasm -> static/wasm mount is absent; hugo config shows only Hugo's default mounts (content, data, layouts, …).
  • The [[server.headers]] block for /wasm/** is absent from the effective [server].

Note application/wasm does appear in the effective config's mediaTypes — but that is Hugo's built-in, not the one declared here. Checking for it is a false positive; check [outputFormats.WASM] instead.

Impact

Low today, but it's a trap rather than a bug:

  • hugo server won't stamp Content-Type: application/wasm on dev requests. Production is unaffected (GitHub Pages sets its own headers).
  • static/ is mounted by default anyway, so the explicit mounts are redundant.

The real cost is that the next person to edit config.toml will get no effect and no warning. Two independent reviewers hit this file during an unrelated docs review and both had to stop and determine which config Hugo actually reads.

Suggested fix

Either delete config.toml, or merge its blocks into hugo.toml if any are actually wanted. Deleting is probably right for the mounts (redundant with defaults) and the mediaType (Hugo has it built in); the dev-server header and the custom output format are the two worth a moment's thought before dropping.

Worth verifying the WASM/ghostkey pages still build and serve correctly either way, since that's the surface these settings were aimed at.

Found while working on #110. Not fixed there to keep a docs copy change from touching the build config.

[AI-assisted - Claude]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions