So I understand defer is disabled on content adapter because “No, that would not make sense.” but I’m currently trying to fix some thing that would definitely benefit from that.
I have some pages divided by “souce”, but I need to combine all of them in new pages automatically. What I’m doing is adding the pages to the global store on render:
{{- if eq .Type "mytype" -}}
{{- site.Store.SetInMap .Type .Path . -}}
{{- end -}}
And then using that store in the content adapter:
{{ range $path, $page := site.Store.Get "mytype" }}
{{ $.AddPage ... }}
{{ end }}
To be clear, it works in the dev server if I re-trigger the content adapters after all pages render, but of course it fails in the normal build.
I’m looking to contribute this change, but I’m not sure if there is interest or how hard it would be to implement.
I’ve read this a few times, and I don’t understand either the starting point or the objective. Can you please clarify (a) what you have, and (b) what you want.
I can achieve it with aliases, sure, but in the /collections/my-collection page I want to display a table with all the matching elements (type element with the matching collection field) as well.
Having two different pages would make sense for me since then you can see which stuff comes from my-book and which comes another-book.
I guess what I really want are resources rather than actual pages that I can compose as I please. But it would create issues for the content inside the books that isn’t a collection or an element, if that makes sense.
Yes I could organize the content in another way, I understand, but I want to abstract as much as possible the content from the “site” logic and I’m not sure how it can be achieved with what you’re suggesting. In the end what I’m considering is using the sources as an asset and creating as many pages as I want in a content adapter.
It makes sense here. You should be able to browse book by book or “globally”.
What I’m looking for here is a “double-hugo” approach, where I can use the section/page tree of a site to build another site.