Good day,
I have this markdown that contains category metadata:
---
title: "Sample Title"
date: 2024-01-22
category: "Technology"
featured: false
---
we can get the values of different pages with different category by iterating the path
{{ $categories := slice }}
{{ $folder := .Site.GetPage "posts" }}
{{ range sort (where $folder.RegularPagesRecursive "Params.featured" false) "Params.Date" }}
{{ if not (in $categories .Params.category )}}
{{ $categories = $categories | append .Params.category }}
{{ end }}
{{ end }}
This will work to get the list but I do not find my solution as efficient. I’m hoping to find a one line solution to get those values, something like:
$categories:=$folder.RegularPagesRecursive.<RightField>.<ToListUniqueValues>
I’ve tried to debug.Dump $folder, and its shows me a collection of pages but it does not show the metadata, so I will have to search how to access those metadata. Please note that I’ve just started learning Hugo few weeks ago…
Is it feasible in Hugo? Or is this feature currently not available?