mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 00:52:43 +00:00
add param to customize the featured image in page and site header
- Add the param to the example with an explanation - It can also be used to add more classes for futher customization if needed
This commit is contained in:
parent
5d7339037b
commit
d11d1d2014
@ -34,6 +34,8 @@ site_logo = ""
|
|||||||
description = "The last theme you'll ever need. Maybe."
|
description = "The last theme you'll ever need. Maybe."
|
||||||
# choose a background color from any on this page: https://tachyons.io/docs/themes/skins/ and preface it with "bg-"
|
# choose a background color from any on this page: https://tachyons.io/docs/themes/skins/ and preface it with "bg-"
|
||||||
background_color_class = "bg-black"
|
background_color_class = "bg-black"
|
||||||
|
# choose an alignment style for the featured image from "bg-top|bg-center|bg-bottom", or add any other class space-separated to customize further
|
||||||
|
featured_image_class = "bg-top"
|
||||||
recent_posts_number = 3
|
recent_posts_number = 3
|
||||||
|
|
||||||
[[params.ananke_socials]]
|
[[params.ananke_socials]]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
||||||
{{ if $featured_image }}
|
{{ if $featured_image }}
|
||||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
||||||
<header class="cover bg-{{ .Params.featured_image_alignment | default "top" }}" style="background-image: url('{{ $featured_image }}');">
|
<header class="cover {{ .Params.featured_image_class | .Site.Params.featured_image_class | default "bg-top" }}" style="background-image: url('{{ $featured_image }}');">
|
||||||
<div class="bg-black-60">
|
<div class="bg-black-60">
|
||||||
{{ partial "site-navigation.html" . }}
|
{{ partial "site-navigation.html" . }}
|
||||||
<div class="tc-l pv6 ph3 ph4-ns">
|
<div class="tc-l pv6 ph3 ph4-ns">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
{{ $featured_image := partial "func/GetFeaturedImage.html" . }}
|
||||||
{{ if $featured_image }}
|
{{ if $featured_image }}
|
||||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
|
||||||
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
|
<header class="cover {{ .Site.Params.featured_image_class | default "bg-top" }}" style="background-image: url('{{ $featured_image }}');">
|
||||||
<div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }}">
|
<div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }}">
|
||||||
{{ partial "site-navigation.html" .}}
|
{{ partial "site-navigation.html" .}}
|
||||||
<div class="tc-l pv4 pv6-l ph3 ph4-ns">
|
<div class="tc-l pv4 pv6-l ph3 ph4-ns">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user