Created
August 18, 2020 11:46
-
-
Save danpoynor/330422d56a32c68f8de7eab1d9618343 to your computer and use it in GitHub Desktop.
Get the first and last page in a Hugo subsection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $subcat := (where .Site.Pages ".Params.section_title" "clients").ByTitle }} | |
{{ $firstItem := index $subcat 0 }} | |
{{ $lastItem := index $subcat (sub (len $subcat) 1) }} | |
<p> | |
First: {{ $firstItem.Title }} | |
<br> | |
Last: {{ $lastItem.Title }} | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment