-
This might be a question for Hugo in general, but it involves creating a list using the templates and modules provided by this theme. On the homepage, you have the availability to enable "recent articles" to display a list (preferably in cardview) of recent pages/posts. Although this is nice, and probably will be re-enabled later, what I am looking to do is generate a cardview list of pages within a section/series labeled "research". The series is in it's own section, and has been added to the hugo param configuration under "main sections". Which would look like this So now all I should need to do is tell Hugo to generate a list from the research section using the cardview template, and this is where things get royally buggered. I have tried to modify the code within the cardview layout file, including it in my <!-- First I tried altering the code that was already present -->
{{ range first 7 (where (where .Site.RegularPagesRecursive "Type" "in"
.Site.Params.mainSections) ".Parent" "=" "research")}}
{{ partial "article-link/card.html" . }}
{{ end }}
<!-- Then I got real brave and tried this smattering of code -->
{{ range first 7 .Site.Taxonomies.Parent "=" "research" }}
{{ partial "article-link/card.html" . }}
{{ end }}
<!-- Then I tried both again, attempting to call the section -->
{{ range first 7 (where (where .Site.RegularPagesRecursive "Type" "in"
.Site.Params.mainSections) ".Section" "=" "research")}}
{{ partial "article-link/card.html" . }}
{{ end }}
{{ range first 7 .Site.Taxonomies.Section "=" "research" }}
{{ partial "article-link/card.html" . }}
{{ end }} As you can assume, neither of the two were accepted. So, any help pointing me in the right direction to create this list would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Don't ask me how, but I found a combination that worked. {{ range last 6 (.Site.GetPage "section" "research" ).Pages }}
{{ partial "article-link/card.html" . }}
{{ end }} |
Beta Was this translation helpful? Give feedback.
Don't ask me how, but I found a combination that worked.