Webappmanifest support

hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended darwin/arm64 BuildDate=2024-01-26T15:54:24Z VendorInfo=brew

Hello Hugo friends, I’m reviewing Hugo Output Formats (Custom output formats | Hugo) with an eye towards the WebAppManifest support. From the docs, and I’ve very likely misunderstood terms here, but it seems like I should be able to drive the support with default Hugo output setup[0], and simply add the webappmanifest output flavor to the pages I want it to be linked[1], and toss in a template at the appropriate place and name[2], and voila! Alas, it is not to be:

[0]$ hugo config --format json | jq .outputs.home

[1]$ hugo config --format json | jq .outputformats.webappmanifest
  "basename": "manifest",
  "isplaintext": true,
  "mediatype": "application/manifest+json",
  "name": "webappmanifest",
  "notalternative": true,
  "rel": "manifest"

[2] $ find | grep manifest | sort

Despite several of those template variations seeming to be on the lookup path, Hugo will still alert me WARN found no layout file for "webappmanifest" for kind "home"; And none of the generated manifest files in public/ appear to have been formatted via the template renderer, ie they contain just the naked file from content/. (Tried with and without marker files under content/, yielding apparently same result.)

Is this support limited to just media types for server mode? Have I hit an edge case due to multilingual mode? If none of the above, would someone please show me the silly mistake I am making here? :slight_smile: Thanks in advance for some clarity!

Works for me.

home = ['html','webappmanifest']
└── _default/
    ├── baseof.html
    ├── home.html
    ├── home.webappmanifest.webmanifest
    ├── list.html
    └── single.html

This works too:

├── _default/
│   ├── baseof.html
│   ├── home.html
│   ├── list.html
│   └── single.html
└── home.webappmanifest.webmanifest


Thanks Joe! I confirm my own user error here.

I’m about half a decade in to my enjoyment of Hugo and I still can not reliably interpret Custom output formats | Hugo to get a useful outcome on the first try. Entirely my bad. Ty! :slight_smile:

1 Like

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