I am trying to implement a shortcode which injects the last modified date of a simple page into the page itself. Unfortunately there are two errors:
ERROR 2018/01/23 08:10:56 Shortcode 'lastmodified' in page 'my-page.md' has no .Inner, yet a closing tag was provided
ERROR 2018/01/23 08:10:56 error processing shortcode "shortcodes/lastmodified.html" for page "my-page.md": template: shortcodes/lastmodified.html:2:68: executing "shortcodes/lastmodified.html" at <$.Page.Params.lastmo...>: can't evaluate field format in type interface {}
Shortcode:
<meta itemprop="datePublished" content="{{ $.Page.Params.LastMod }}">
{{ default (i18n "formatDate") .Site.Params.General.DateFormat | $.Page.Params.LastMod.Format | i18n "txtModifiedOn" }}
</meta>
Page:
---
title: "My Page"
url: "my-page"
lastmod: "2018-01-23"
---
{{% lastmodified %}}{{% / lastmodified %}}
LONG LONG TEXT ...
According to the hugo documentation, this should work but it does not.
What have to be edited?