diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index f9114728..e2d643c7 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1510,6 +1510,10 @@ select { margin-top: 1.25rem; } +.mt-4 { + margin-top: 1rem; +} + .mt-3 { margin-top: 0.75rem; } @@ -1530,10 +1534,6 @@ select { margin-top: 0.1rem; } -.mt-4 { - margin-top: 1rem; -} - .\!mt-0 { margin-top: 0px !important; } @@ -1618,6 +1618,10 @@ select { height: 3rem; } +.h-36 { + height: 9rem; +} + .h-full { height: 100%; } @@ -1638,10 +1642,6 @@ select { height: 50%; } -.h-36 { - height: 9rem; -} - .max-h-\[5rem\] { max-height: 5rem; } @@ -2982,6 +2982,12 @@ body:has(#menu-controller:checked) { background-position:center; } +.single_hero { + background-repeat:no-repeat; + background-size:cover; + background-position:center; +} + .thumbnailshadow { box-shadow: 5px 5px 20px 1px rgba(0, 0, 0, 0.3); } @@ -3523,6 +3529,10 @@ body:has(#menu-controller:checked) { display: none; } + .md\:h-56 { + height: 14rem; + } + .md\:w-1\/3 { width: 33.333333%; } @@ -3601,6 +3611,10 @@ body:has(#menu-controller:checked) { display: none; } + .lg\:h-72 { + height: 18rem; + } + .lg\:h-full { height: 100%; } diff --git a/assets/css/main.css b/assets/css/main.css index 590504fa..7799513c 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -347,6 +347,12 @@ body:has(#menu-controller:checked) { background-position:center; } +.single_hero { + background-repeat:no-repeat; + background-size:cover; + background-position:center; +} + .thumbnailshadow { box-shadow: 5px 5px 20px 1px rgba(0, 0, 0, 0.3); } diff --git a/config/_default/params.toml b/config/_default/params.toml index 204d97af..979fbc83 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -35,6 +35,7 @@ enableCodeCopy = true #showLikes = true showDateUpdated = false showAuthor = true + showHero = true showBreadcrumbs = true showDraftLabel = true showEdit = true diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index fa8bdd59..c5467e4e 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -35,6 +35,7 @@ mainSections = ["docs"] showLikes = true showDateUpdated = false showAuthor = true + showHero = true showBreadcrumbs = true showDraftLabel = true showEdit = true diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 31e9f602..fd44bc54 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -145,6 +145,7 @@ Many of the article defaults here can be overridden on a per article basis by sp |`article.showLikes`|`false`|Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below.| |`article.showDateUpdated`|`false`|Whether or not the dates articles were updated are displayed.| |`article.showAuthor`|`true`|Whether or not the author box is displayed in the article footer.| +|`article.showHero`|`true`|Whether the thumbnail image will be shown as a hero image within each article page.| |`article.showBreadcrumbs`|`false`|Whether or not breadcrumbs are displayed in the article header.| |`article.showDraftLabel`|`true`|Whether or not the draft indicator is shown next to articles when site is built with `--buildDrafts`.| |`article.showEdit`|`false`|Whether or not the link to edit the article content should be displayed.| diff --git a/exampleSite/content/docs/front-matter/index.md b/exampleSite/content/docs/front-matter/index.md index 87778b27..dad157da 100644 --- a/exampleSite/content/docs/front-matter/index.md +++ b/exampleSite/content/docs/front-matter/index.md @@ -26,6 +26,7 @@ Front matter parameter default values are inherited from the theme's [base confi |`showAuthor`|`article.showAuthor`|Whether or not the author box for the deafult author is displayed in the article footer.| |`authors`|_Not set_|Array of values for authors, if set it overrides `showAuthor` settings for page or site. Used on the multiple authors feature, check [this page]({{< ref "multi-author" >}}) for more details on how to configure that feature.| |`showAuthorsBadges`|`article.showAuthorsBadges`|Whether the `authors` taxonomies are are displayed in the article or list header. This requires the setup of `multiple authors` and the `authors` taxonomy. Check [this page]({{< ref "multi-author" >}}) for more details on how to configure that feature.| +|`showHero`|`article.showHero`|Whether the thumbnail image will be shown as a hero image within the article page.| |`showBreadcrumbs`|`article.showBreadcrumbs` or `list.showBreadcrumbs`|Whether the breadcrumbs are displayed in the article or list header.| |`showDate`|`article.showDate`|Whether or not the article date is displayed. The date is set using the `date` parameter.| |`showDateUpdated`|`article.showDateUpdated`|Whether or not the date the article was updated is displayed. The date is set using the `lastmod` parameter.| diff --git a/exampleSite/content/docs/thumbnails/index.md b/exampleSite/content/docs/thumbnails/index.md index 1fc1217f..43ee1f1a 100644 --- a/exampleSite/content/docs/thumbnails/index.md +++ b/exampleSite/content/docs/thumbnails/index.md @@ -36,4 +36,8 @@ content └── awesome_article └── featured.png ``` -The you just need to add an image like explain earlier. If you want to see a sample of this you can consult [this sample]({{< ref "thumbnail_sample" >}}). \ No newline at end of file +The you just need to add an image like explain earlier. If you want to see a sample of this you can consult [this sample]({{< ref "thumbnail_sample" >}}). + +## Hero Images + +Thumbnails will be used by default as hero images withing each article. Use the global `article.showHero` or the front-matter parameter `showHero` to control this feature across the entire site or for each specific post. \ No newline at end of file diff --git a/exampleSite/resources/_gen/images/docs/advanced-customisation/featured_huc648350f543f5a6da75f60f86e4aecc9_625096_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/advanced-customisation/featured_huc648350f543f5a6da75f60f86e4aecc9_625096_600x0_resize_box_3.png new file mode 100644 index 00000000..17f71051 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/advanced-customisation/featured_huc648350f543f5a6da75f60f86e4aecc9_625096_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/configuration/featured_hu61945c9a50a7e783444cb54fb71dc68a_650977_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/configuration/featured_hu61945c9a50a7e783444cb54fb71dc68a_650977_600x0_resize_box_3.png new file mode 100644 index 00000000..becaf18b Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/configuration/featured_hu61945c9a50a7e783444cb54fb71dc68a_650977_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/content-examples/featured_hua9cafb9ef9e179b71d05f85e3ab9080d_648770_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/content-examples/featured_hua9cafb9ef9e179b71d05f85e3ab9080d_648770_600x0_resize_box_3.png new file mode 100644 index 00000000..44de25f4 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/content-examples/featured_hua9cafb9ef9e179b71d05f85e3ab9080d_648770_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/firebase-views/featured_hu893b4009285a3fc236e74f3cf6b73d3e_4462659_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/firebase-views/featured_hu893b4009285a3fc236e74f3cf6b73d3e_4462659_600x0_resize_box_3.png new file mode 100644 index 00000000..54d6a60f Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/firebase-views/featured_hu893b4009285a3fc236e74f3cf6b73d3e_4462659_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/front-matter/featured_hu2d8098f125aeb5b866c985ce18317fa7_5037509_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/front-matter/featured_hu2d8098f125aeb5b866c985ce18317fa7_5037509_600x0_resize_box_3.png new file mode 100644 index 00000000..65004ecb Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/front-matter/featured_hu2d8098f125aeb5b866c985ce18317fa7_5037509_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/getting-started/featured_hu7b932db01f62f5127910b65e3cd14f9d_599809_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/getting-started/featured_hu7b932db01f62f5127910b65e3cd14f9d_599809_600x0_resize_box_3.png new file mode 100644 index 00000000..3d30158c Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/getting-started/featured_hu7b932db01f62f5127910b65e3cd14f9d_599809_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/homepage-layout/featured_hu2b64bd3fbe5e1f5f3d9d27abc9d45f1e_648252_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/homepage-layout/featured_hu2b64bd3fbe5e1f5f3d9d27abc9d45f1e_648252_600x0_resize_box_3.png new file mode 100644 index 00000000..989df218 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/homepage-layout/featured_hu2b64bd3fbe5e1f5f3d9d27abc9d45f1e_648252_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/hosting-deployment/featured_hu64bf821b067f4f95fc394dc0a744aa3f_4868715_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/hosting-deployment/featured_hu64bf821b067f4f95fc394dc0a744aa3f_4868715_600x0_resize_box_3.png new file mode 100644 index 00000000..7a4067f6 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/hosting-deployment/featured_hu64bf821b067f4f95fc394dc0a744aa3f_4868715_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/installation/featured_hua34c938079c0c05729a2a4d4783f7807_634706_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/installation/featured_hua34c938079c0c05729a2a4d4783f7807_634706_600x0_resize_box_3.png new file mode 100644 index 00000000..4bf413b9 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/installation/featured_hua34c938079c0c05729a2a4d4783f7807_634706_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/multi-author/featured_hub711b3bcf9ec72021fe99f7bb1f650e4_637127_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/multi-author/featured_hub711b3bcf9ec72021fe99f7bb1f650e4_637127_600x0_resize_box_3.png new file mode 100644 index 00000000..33ca0cf9 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/multi-author/featured_hub711b3bcf9ec72021fe99f7bb1f650e4_637127_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/partials/featured_hue41d16dad4a5698d84d57019e7c71ba2_674943_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/partials/featured_hue41d16dad4a5698d84d57019e7c71ba2_674943_600x0_resize_box_3.png new file mode 100644 index 00000000..786da147 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/partials/featured_hue41d16dad4a5698d84d57019e7c71ba2_674943_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/shortcodes/featured_huccf4470440ae6b15644c014dfa031fdc_4868633_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/shortcodes/featured_huccf4470440ae6b15644c014dfa031fdc_4868633_600x0_resize_box_3.png new file mode 100644 index 00000000..87087bca Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/shortcodes/featured_huccf4470440ae6b15644c014dfa031fdc_4868633_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/thumbnails/featured_hu93f196360c2371d7e9554814ee21804a_5014315_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/thumbnails/featured_hu93f196360c2371d7e9554814ee21804a_5014315_600x0_resize_box_3.png new file mode 100644 index 00000000..5edbc380 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/thumbnails/featured_hu93f196360c2371d7e9554814ee21804a_5014315_600x0_resize_box_3.png differ diff --git a/exampleSite/resources/_gen/images/docs/welcome/featured_hu6c1a40751b0ecb38722eba3ab5726016_6942334_600x0_resize_box_3.png b/exampleSite/resources/_gen/images/docs/welcome/featured_hu6c1a40751b0ecb38722eba3ab5726016_6942334_600x0_resize_box_3.png new file mode 100644 index 00000000..e06e38e0 Binary files /dev/null and b/exampleSite/resources/_gen/images/docs/welcome/featured_hu6c1a40751b0ecb38722eba3ab5726016_6942334_600x0_resize_box_3.png differ diff --git a/layouts/_default/single.html b/layouts/_default/single.html index aa1d800b..4ebdb754 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,13 +1,25 @@ {{ define "main" }}
-
+ + {{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }} + {{- $images := .Resources.ByType "image" -}} + {{- $featured := $images.GetMatch "*feature*" -}} + {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} + {{- with $featured -}} + {{ with .Resize "600x" }} +
+ {{ end }} + {{- end -}} + {{- end -}} + +
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }} {{ partial "breadcrumbs.html" . }} {{ end }}

{{ .Title | emojify }}

-
+
{{ partial "article-meta.html" (dict "context" . "scope" "single") }}
diff --git a/layouts/partials/meta/likes_button.html b/layouts/partials/meta/likes_button.html index 7860ab80..919f3059 100644 --- a/layouts/partials/meta/likes_button.html +++ b/layouts/partials/meta/likes_button.html @@ -1,6 +1,6 @@