Hi,
I don’t use archetypes, and type/section/kind either, except for my homepage (/themes/hugo-book/layouts/_default/home.html acting as baseof.html), but I didn’t write Kind:home. I found that particular case either by chance or reading the docu, but haven’t actually understood how the hell Kind/section/type attributes work by default, without stuffing templates/partials full of {{ if }}. I learn by doing, case by case, until it sank.
Here I wanna use “type” to have an image renderhook for the homepage only.
You can also create type/section specific hooks in layouts/[type/section]/_markup, e.g.: layouts/blog/_markup.
so I created /home/drm/WEBSITE/themes/hugo-book/layouts/essai/_markup/render-image.htm with (valid) rubbish (dfsfds sdfds) inside. My `/content/_index.md is
I haven’t checked, but I’m guessing that the home page cannot have a type (or that it does not have any effect). You can probably verify this by setting type on any of the other content pages you have in your site.
home page “kind” is not overridden by frontmatter kind: test - it is always of kind “home”, which makes sense, it is a special kind vs page or index.
home page “type” can be overridden by frontmatter type: test
You can set up a different render-image.html hook in
layouts/test/_markup/render-image.html
That will give you the render-hook on any pages, including the homepage you give type: page
Tested it worked.
A .Template would be useful to have. Template lookup was my only real sticking point when starting with Hugo, it is very flexible but that makes it a little tricky at first.
is rendered first then sent to to the shortcode (or _index.md). So types work on intro.md instead ! Or else, type works with the homepage if I have to change .Content for .RawContent | markdownify so delay the rendering to after its inclusion into _index.md. < or % has no impact.
I just didn’t know how it worked since I knew .RawContent existed… I could have predicted it. I think I confused not building with not rendering. So it was my fault, but it’s fine, I learnt stuff.
Thanks for you time.