Print page params in content

Hi!

I’m trying to directly print some page params in a content page. I discovered built-in param shortcode and I’m trying to use it for my purpose.

I have a simple content post like:

---
title: "Test title"
date: 2020-12-31T16:00:00Z
draft: true
---

Hello

And I’m trying to print title or date page parameters using param shortcode. I tried things like this:

Date: {{< param ".Params.date" >}}

but I always get this error:
Param ".Params.date" not found:

How do I print page params in my content page?

Hi again.

After some digging, I realize (again) that usually the simplest solution just works. Proper code:

Date: {{< param date >}}

Hope it guides someone else than me.

Regards!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.