diff --git a/README.md b/README.md index f95e63d..27d70b1 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,17 @@ If you want to use these branded icons in your contact list, use the full class icon = "fa-brands fa-github" ``` +You may also use the `icon` parameter in your page frontmatter to set an icon before your title in the section heading, as well as in the header button and nav bar. + +```yaml +--- +title: "Contact us" +icon: comments +header_menu: true +weight: 6 +--- +``` + ### Header logo Configured in `_index.md`, see `exampleSite`: `header_logo: "images/chef-hat.png"` diff --git a/exampleSite/content/de/homepage/contact.md b/exampleSite/content/de/homepage/contact.md index 0d01e14..ba5ce3e 100644 --- a/exampleSite/content/de/homepage/contact.md +++ b/exampleSite/content/de/homepage/contact.md @@ -1,5 +1,6 @@ --- title: "Contact" +icon: comments weight: 4 header_menu: true --- diff --git a/exampleSite/content/en/homepage/contact.md b/exampleSite/content/en/homepage/contact.md index 0d01e14..ba5ce3e 100644 --- a/exampleSite/content/en/homepage/contact.md +++ b/exampleSite/content/en/homepage/contact.md @@ -1,5 +1,6 @@ --- title: "Contact" +icon: comments weight: 4 header_menu: true --- diff --git a/exampleSite/content/en/homepage/services.md b/exampleSite/content/en/homepage/services.md index dc54148..f5a631e 100644 --- a/exampleSite/content/en/homepage/services.md +++ b/exampleSite/content/en/homepage/services.md @@ -39,6 +39,17 @@ If you want to use these branded icons in your contact list, use the full class icon = "fa-brands fa-github" ``` +You may also use the `icon` parameter in your page frontmatter to set an icon before your title in the section heading, as well as in the header button and nav bar. + +```yaml +--- +title: "Contact us" +icon: comments +header_menu: true +weight: 6 +--- +``` + ### Nutrition Coaching This is not an easy task. diff --git a/layouts/_default/index.html b/layouts/_default/index.html index 09d8db0..936864f 100644 --- a/layouts/_default/index.html +++ b/layouts/_default/index.html @@ -108,8 +108,13 @@ {{ else if isset .Params "detailed_page_path" }} {{ $button_title }} {{ else }} - {{ $fnav_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }} - {{ $button_title }} + {{ $fnav_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }} + + {{ with .Params.icon }} + + {{ end }} + {{ $button_title }} + {{ end }} {{ end }} @@ -131,7 +136,12 @@ {{ $last_index_val := 0 }} {{ range $index_val, $elem_val := $content }} {{ $fnav_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }} - {{ $fnav_title | safeHTML }} + + {{ with .Params.icon }} + + {{ end }} + {{ $fnav_title | safeHTML }} + {{ $last_index_val = $index_val }} {{ end }} {{ if eq .Params.nav_to_top_weight "last" }} @@ -145,9 +155,13 @@ {{ if .Title }} {{ $fnav_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }}