[SOLVED] Problems understanding sections and custom layout

I’m making a new attempt at understanding sections. What I want to do is to have a section that doesn’t generate an index.

Say that I have the following:

content -+- posts
         +- xfiles -- somefile.md

I don’t want to have an index page for the content of xfiles. What I’ve done is to copy a list template file from theme I use (hugo-coder), added some text just to make sure that the correct template is used and put it here

layout --- xfiles -- list.html

and it generates this

public -+- ...
        +- xfiles -+- page --- 1 --- index.html
                   +- somefile --- index.html
                   +- index.html
                   +- index.xml

My problem is that when I view the xfiles/index.html file it lacks most of the head-content and thus the page index page doesn’t format according to the theme. I assume I’m missing something when add the list.html file.

I tried to read the docs and search the forum but I couldn’t figure out what I’m missing … probably because I don’t know what I’m looking for.

Some other questions:

  1. How do I prevent the index.xml from being generated for this section?

  2. The page directory, what is the purpose of it?

That is the RSS feed, ne? I think you turn that off.

I believe that is for pagination.

Hey, is what you are looking for more along the lines of page bundles?

Yep, it looks like the RSS feed but I don’t understand how I turn it off for this section only. Thanks for info about the page directory.

I don’t think I’m looking for page bundles (at least not what I understand). What I want to do is to create pages that are not secret but they shouldn’t be listed so anyone just click to find the pages - what I’m going to use this for is writing replies to questions I get in my work as a teacher. Answers that can sometimes get re-used but are usually very specific to one question and to avoid embarrassment to those who asks questions I want to make answers a bit more difficult to find.

Assuming a separate markdown file for each question, if your content was arranged like this


You could create a list template for xfiles in your site at layouts/xfiles/list.html then range through each question

{{ define "title" }}
  {{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
<section class="container list">
{{ range .Paginator.Pages }}
    <a href="{{.Permalink}}">{{.Title}}</a>
{{ end }}
{{ end }}

(The above is untested since I typed this from my phone)

What happens if you override the RSS layout for that section? So in layouts/xfiles/ create the file xfiles.rss.xml and leave it empty. (There may be a less ‘hacky’ way to do this…)

Thanks to both of you, now it starts to look the way I want.