diff --git a/layouts/shortcodes/pages-list.html b/layouts/shortcodes/pages-list.html new file mode 100644 index 0000000..1b1a7e1 --- /dev/null +++ b/layouts/shortcodes/pages-list.html @@ -0,0 +1,33 @@ +{{- $sectionName := .Get "section" -}} +{{- $limit := .Get "limit" -}} +{{- $style := .Get "style" | default "bullets" -}} + +{{- $pagesSource := dict -}} +{{- with $sectionName -}} + {{ with $section := site.GetPage . }} + {{ $pagesSource = $section }} + {{ else }} + {{ errorf "Couldn't get Page for section named '%s'" . }} + {{ end }} +{{ else }} + {{ $pagesSource = site }} +{{- end -}} + +{{- $pages := $pagesSource.Pages.ByTitle -}} +{{- with $limit -}} + {{ $pages = $pages.Limit $limit }} +{{- end -}} + +{{ with $pages -}} + {{- if eq $style "bullets" }} +