I am working on a project where most of the content lives in a database behind a self-hosted CMS, and I would like to generate static pages from my CMS’ api through content adapters.
In order to reuse the logic for handling requests (building the requests & handling errors), I have tried setting up a partial template to be called from _content.gotmpl, but am encountering this error:
ERROR error building site: process: readAndProcessContent: "[...]/temp-hugo/content/_content.gotmpl:8:46": template: [...]/temp-hugo/content/_content.gotmpl:8:46: executing "[...]/temp-hugo/content/_content.gotmpl" at <partial "my-partial" .>: error calling partial: "[...]/temp-hugo/layouts/_partials/my-partial.html:3:23": execute of template failed: template: _partials/my-partial.html:3:23: executing "_partials/my-partial.html" at <transform.Unmarshal>: error calling Unmarshal: type *pagesfromdata.pagesFromDataTemplateContext not supported
Here’s a minimal setup that reproduces the error, with some logs to compare request made from _content.gotmpl with request made from the partial template:
Quick update: the fix does work in my main project
with error handling for GetRemote you might also need to modernize to the new error handling introduced with 141
@irkode Thank for the advice, I am in fact using the new error handling feature in my project. I simply removed it for the minimal reproduction code when trying to debug the issue