The theme I am working with has a summary.html layout in default.
I don’t actually need a summary, happy with signle.html - I have a page ( defined in its top stuff as on a menu ), going to that slug give me a summary - I don’t understand why, and I don’t understand how to get it to display a single, and I can’t work out from the documentation why either.
Can you point me to a repo; I would need to know where this summary.html is located in order to help you override it, but this will give you an idea:
Assuming you have themes/yourtheme/layouts/_default/summary.html with something like the following:
<div class="summary">
{{.Summary}}
</div>
Just create the same file but up a level so that it’s in your project directory and remove the unwanted templating. So, using the above example, you could create a layouts/_default/summary.html and leave it blank or comment out what you don’t want, etc. This is because Hugo has a specific lookup order:
Also, I linked to the new documentation above for the template lookup order. However, you should be using _index.md and not index.md for your index pages for content sections. This can be found in the current docs, or if you want to take a look at the upcoming docs, I’ve made a specific section in the list template page too:
Unfortunately whilst I understand the basic heirachy, there is nothing I can see in the docs that explains why /content/prices/index.md picks up the summary for a single ( apart from it is a mis use … )
setting /contents/prices.md works ( single )
/content/prices/prices.md works (single ) but the slug is domain/prices/prices ( no good)
using /content/prices/_index.md doesn’t work as it uses list format ( as per your document )
But there is a definite difference I’m testing on 20,6 and the summary is appearing but single is appearing on my other server ( which will be probably hugo 18 ), I assume a difference because of index.md no longer should be used
Try content/prices.md, which should render according to single.html and output to your finished site as /prices/index.html…
Right. Here is the code in question:
As I mentioned above, _index.md has specific use in that it’s the way to add content and front matter to a list page. The docs on what constitutes a list page also might help you:
This is the way Hugo’s data model and content organization work. An _index.md content file doesn’t render according to a single.html layout because it’s not a single content page; it is a list page.
I’m also going to phone a friend and ask @digitalcraftsman for some input since he is the guru of this particular theme. Also, summary.html is a content view (hence the use of .Render). HTH.