I am currently trying to create a small website with Hugo. It should have an index page and a blog section.
For generating my index page I am using some content types so I don’t have to put it’s data into layout files. But I do not want Hugo to generate single pages for them. On the other hand, for my content type “post” Hugo should generate single pages.
It is possible to disable page creation for specific content types, so you can use them as a data Backend without worrying about empty and unnecessary single pages?
I didn’t know that I can’t get a page in a headless bundle directly with `.Get.Page “my/headless/page.md”.
For me, it is still unclear how I can access font matter data from the headless bundle index element:
You can, but you need to understand what a bundle is. A headless bundle’s content file must start with “index”, “index.md” being the normal case. And, you can address that bundle with its path + filename, but for those files you can also just point to the owning folder:
.Site.GetPage "page" “blog/my-bundle/index.md"
.Site.GetPage "page" “blog/my-bundle"
The last variant is useful if you have a multilingual setup (“give me the current language version”).
The above will work if you have a content file in content/blog/my-bundle/index.md.
That’s correct. I don’t say that it is not possible to undestand. It is easy, if you got the point, that you have to access “pages” of a headless bundle using its index, because these pages are “objects” of the headless bundle.
Maybe it is hard for me because I am new to Hugo and Go.