What I want to do with Hugo, is to have pages and tags as you would normally
have. But in addition to that, I would like the option, of being able to have a
“Talk” page linked to any type of page. So if I have a normal page:
content/sunday/index.md
I would also like the option of making a Talk page:
content/sunday/talk/index.md
that can be accessed from the normal page. This is similar to Talk page on
Wikipedia, or Discussion page with Rosetta Code:
as can be seen, the “tags/talk” page is created (youll need to browse manually,
I am not allowed many links per post):
public/tags/talk/index.html
but the “tags” page does not see it:
public/tags/index.html
Here is the loop code:
{{ range .Pages }}
{{ . }}
{{ end }}
layouts/_default/list.html
The loop picked up tagged pages, but not pages that are physically in the same
folder or subfolder. If some loop is available to capture those files, it would
solve the problem.
As an aside, also have a look at this “bare min” theme that I created as I was learning the ins and outs of Hugo. It puts out a lot of debug info on the published pages (like this).
The result of this, is that when you navigate to tags/talk, you will be
viewing of list of all pages with the talk tag. I dont want that. When I
navigate to tags/talk, I want to be viewing a single page. A page that is
notes or information about the tags page. The reason is this: some pages are
lists of items, for example:
tags
tags/day
and in some cases these lists can be quite large. To add to that, notes or
content that I might want to add to these pages could be quite large as well.
What I dont want, is a large list, and a large amount of content on the same
page. Wikipedia and Rosetta Code handle this quite well. If you visit a tag
page:
Now to avoid situations like this ( https://hungry-brown-520e14.netlify.app/sunday/ ), where “talk” is a special page, you may need to give those pages a special layouts or tags frontmatter to filter from out of the normal .Pages loop.
I think I finally sorted it. The issue was that running .Pages on a taxonomy
page would miss any physical files in the folder.
This was solved by your suggestion of .GetPage. However that introduced
another problem. I also want to use .GetPage with section pages, so that I
can separate the Talk page from the .Pages loop. As you mentioned, this
creates duplicate Talk page entries.
I didnt really like your suggestions for dealing with that, but I was able to
find this:
It seems for the Talk pages under section pages, that if I add this:
_build:
list: never
It removes the Talk page from the .Pages loop, but still allows it to be
pulled with .GetPage. All this seems to make a complete solution, so thank
you!
Hm actually I noticed another issue. The act of creating these:
content/tags/_index.md
content/tags/talk/index.md
Causes /tags to populate in the .Pages loop on the home page. I dont want
that if possible, as I already have link in the header to the Tags page. I
tried getting it out of the loop by adding: