I do understand how Hugo determines which layout to use. However. I struggle how to use the same layout for links and posts. I already have a layout for posts and want to reuse it for links without having to add type and/or layout to every file within links. As I also want links and posts to be separate content types I donβt think that using type would be a good idea anyways.
In both cases I could still see the template being using for content/links/link1.md was layouts/_default/single.html in contrast to my expectation of layouts/posts/single.html being used.
But maybe I wasnβt specific enough. Iβd rather have all the same layouts for posts and links, not only for single pages but at the same retain their content type. Is this possible as well?
Thanks. With the latest change it still works for page but not for section. It doesnβt work, even though I have both, the cascade entry and corresponding file in _default.
I updated the TOML and YAML in my previous post so that it would catch the top level sections.
I have no idea what else your site has, but it might be easier to use the default list and single templates for your links and posts (since they share the same templates), and create unique templates for the other content types, taxonomies, and terms.
Fair point. Itβs actually quite a good idea. Your latest change did make it work for posts top level section for whatever itβs still not working for links top level section. Anyhow, I do have enough feedback/solution so that I know what to tinker with going forward.
Your latest change is working and I also found why it wasnβt initially working for links. I still had an _index.md in links which set a layout from my earlier experiment.s