Page
Syntax
SHORTCODE.Page
Returns
hugolib.pageForShortcode
With this content:
content/books/les-miserables.md
---
author: Victor Hugo
isbn: 978-0451419439
publication_year: 1862
title: Les Misérables
---
+++
author = 'Victor Hugo'
isbn = '978-0451419439'
publication_year = 1862
title = 'Les Misérables'
+++
{
"author": "Victor Hugo",
"isbn": "978-0451419439",
"publication_year": 1862,
"title": "Les Misérables"
}
Calling this shortcode:
{{< book-details >}}
We can access the front matter values using the Page
method:
layouts/shortcodes/book-details.html
<ul>
<li>Title: {{ .Page.Title }}</li>
<li>Author: {{ .Page.Params.author }}</li>
<li>Published: {{ .Page.Params.publication_year }}</li>
<li>ISBN: {{ .Page.Params.isbn }}</li>
</ul>