Author
Displays the page author name with optional icon.
Location : layouts/_partials/widgets/meta/author.html
Parameters :
| Parameter | Type | Description | Default |
|---|---|---|---|
page | Page | Page context | required |
site | Site | Site context | required |
class | string | Additional CSS classes | - |
key | string | Config key for visibility | "Author" |
Configuration :
yaml
params:
showAuthor: true # Show/hide author
showAuthorIcon: true # Show/hide author iconFront Matter :
yaml
---
author: "Jane Doe" # Page-specific author
---If not specified in front matter, falls back to site-level author:
yaml
# hugo.yaml
params:
author: "Site Author"Examples :
go
// Basic usage
{{ partial "widgets/meta/author.html" (dict "page" . "site" .Site) }}
// With custom class
{{ partial "widgets/meta/author.html" (dict
"page" .
"site" .Site
"class" "post-author"
) }}
// In metadata flex layout
{{ $metadata := slice
(partial "widgets/meta/author.html" (dict "page" . "site" .Site))
(partial "widgets/meta/date.html" (dict "page" . "site" .Site))
}}
{{ partial "layouts/flex.html" (dict
"items" $metadata
"separator" " · "
) }}