diff --git a/README.md b/README.md index 8fcf1b4..6571b62 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,14 @@ These posts are rendered slightly different with an → to signify that it is re  +#### Specifying a featured image for social media + +Sometimes you want to feature an image as your featured image that will display when linking your post in social media. This can be done by including the `feature` parameter on your individual post. Note you don't need to put the URL, just the path to the image without a leading `/` + +``` +feature: "assets/posts/20240219/image.jpg" +``` + ### Variables | Variable | What value? | Required | diff --git a/layouts/partials/site_header.html b/layouts/partials/site_header.html index 9d1fb05..392441f 100644 --- a/layouts/partials/site_header.html +++ b/layouts/partials/site_header.html @@ -6,17 +6,27 @@ - {{ hugo.Generator }} + {{ $siteTitle := .Site.Title }} {{ $title := $siteTitle }}{{ if .IsPage }}{{ $title = .Title }} + + + {{ if .Param "feature" }}{{ end }} + + + + + {{ end }} + {{ hugo.Generator }} {{ $.Scratch.Add "title" .Site.Title }}