What I want to have is a simple blog that will display a list of all posts split by year by default and will have a couple of “special” pages (e.g. About me, Projects). Here’s what my content/
layout looks like:
├── content
│ ├── about
│ │ └── index.md
│ ├── lorem-ipsum.md
│ ├── projects
│ │ └── index.md
│ └── another-post.md
So, for index.html
I would like to have something like
{{ define "main" }}
{{ range .Pages }}
<article>
<div>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
ReadingTime: {{ .ReadingTime }}
<br>
{{ .Summary }}
</div>
</article>
{{ end }}
{{ end }}
However, this would select both about/index.md
and projects/index.md
which is not what I want. I know I can make these indices hidden: true
and check for {{ if not .Params.hidden }}
in home.html
but this sounds like the solution that wouldn’t be idiomatic. Is there any clean way of
- Selecting the first-level pages (not indices under second level)?
- Making a bunch of “special” pages (not listed anywhere except in the main menu on the right)? These don’t necessarily have to be under their own directory each, I might want a single directory for all of them and maybe just having a set of “special” files in there, separating them from the blog posts.