I can’t figure out how to use two views for the same content type.
I have this view which works fine. It shows the upcoming events and it’s located in themes/MYTHEME/layouts/section/concerts.html:
{{ range where .Data.Pages.ByDate "Type" "concerts" }}
{{ if ge .Date.Unix .Now.Unix }}
{{ .Render "summary" }}
{{ end }}
{{ end }}
Now I want to create another view/page to list the past concerts. I just need to change if ge to if lt:
{{ range where .Data.Pages.ByDate "Type" "concerts" }}
{{ if lt .Date.Unix .Now.Unix }}
{{ .Render "summary" }}
{{ end }}
{{ end }}
But I’m not sure where should I place this view. I tried themes/MYTHEME/layouts/section/archive.html but it doesn’t work. I see that I’m confused about this but I have no other ideas.
Create single pages means using hugo new to create a .md file under content/?
What I definitely don’t want is using single pages. I need to generate the list programatically. I don’t think I can use templates in markdown content files…
Using a new content type makes no sense, since the archive of past concerts refer to the same content type. It’s just a different view.
I’m afraid that we speak two different languages and of course it’s my fault because I don’t know Hugo yet.
I understand that you suggest creating the directory content/archive/ and put some dummy content there just to have access to a new view. With view I mean the second block I posted in my first post.
I think I need to have a look to some hugo sites source code.