Hi, can some on please explain why something like this not working? I would like to have custom variable “history” with manual entered dates when the page was updated. Here is an example.
my markdown: content/blog/about.md
---
date: "2022-01-01"
lastmod: "2022-11-11"
title: "About Page"
slug: "about"
categories:
- "pages"
history:
- "2022-03-10"
- "2022-02-05"
- "2022-01-01"
---
# My markdown page here
Something here
my html: /layouts/_default/single.html
{{ with .Params.history }}
{{ . }}
{{ end }}
This works but outputs all dates, and I want just the first.
Result: [2022-01-01 2022-02-05 2022-03-10]
Now when I try doing something like this it will show an error instead of showing me first date on the list “2022-03-10”.
{{ index .Params.history 0 }}
I’ve also tried this and its not working =(
{{ with .Params.history }}
{{ range first 1 (.Params.history) }}
{{ . }}
{{ end }}
{{ end }}
Thank you for any help!