My theme is currently able to provide a dedicated search page. This can be activated by setting the output format searchpage for home (search is necessary to create the search index file that is used by the search page)
[outputs]
home = ["html", "search", "searchpage"]
This has the major drawback, that the search page gets its title from the home page itself while the user expect to see something like Search. The code is quite littered with special cases to adjust for it.
While this works, it also makes caching of template results difficult, as the title of a page is now dependend on the output format.
I try to get rid of this.
I came up with a working solution involving content adapters. The content adapter would be shipped with the theme, that so causes to generate the page in the users site. This means, my theme contains a content directory.
In a rather old thread, it was mentioned, that a theme is not allowed to have a content directory.
Because my test is working but contradicts the above statement, is it a bug I found or is a theme now allowed to contain a content directory?
This page lists the folders for a theme skeleton, and content is included.
The default hugo new theme mytheme also includes a content directory.
If you use a module for a theme its just a standard module and the full mount config is docuemented
With all that together - yes it’s allowed. (If not…it’s a doumentation bug )
Ofc you will have to take care that users do not use the same filenames… especially with a content adapter. Theme documentation here imho is important
Ofc you will have to take care that users do not use the same filenames… especially with a content adapter. Theme documentation here imho is important
I am aware of this and will be (hopefully) configurble once I overcome some limitations with content adapters. But that’s for another topic.