Feat: add parameter params.home.profile.avatarMenu

This commit is contained in:
Cell
2022-11-04 22:37:31 +08:00
parent c56b7d3d33
commit 13f825b7c2
4 changed files with 13 additions and 2 deletions
+1
View File
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
- :sparkles: Feat: add custom templates and parameter `params.customFilePath` support
- :sparkles: Feat: add feature end of post flag support ([#236](https://github.com/hugo-fixit/FixIt/issues/236))
- :sparkles: Feat: add params to close wordcount and readingTime in post ([#209](https://github.com/hugo-fixit/FixIt/issues/209))
- :sparkles: Feat: add parameter `params.home.profile.avatarMenu`
- :truck: Feat: migrate parameter `params.autoBookmark` to `params.page.autoBookmark` ([#55](https://github.com/hugo-fixit/FixIt/issues/55))
- :zap: Perf: optimize close comment feature when the post has expired ([#204](https://github.com/hugo-fixit/FixIt/issues/204))
- :zap: Perf: optimize sub menu position calculation in desktop header with css replace of javascript
+2
View File
@@ -203,6 +203,8 @@
gravatarEmail = "xx@xx.com"
# URL of avatar shown in home page
avatarURL = ""
# FixIt 0.2.17 | NEW identifier of avatar menu link
avatarMenu = ""
# FixIt 0.2.7 | CHANGED title shown in home page (HTML format is supported)
title = ""
# subtitle shown in home page
+1 -1
Submodule docs updated: ebed6cbba2...af37a6cff9
+9 -1
View File
@@ -14,7 +14,15 @@
{{- if $avatar -}}
<div class="home-avatar">
{{- $menus := $.Site.Menus.main | default slice -}}
{{- with index $menus 0 -}}
{{- $avatarMenuIndex := 0 -}}
{{- if $profile.avatarMenu -}}
{{- range $index, $menu := $menus -}}
{{- if eq $menu.Identifier $profile.avatarMenu -}}
{{- $avatarMenuIndex = $index -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- with index $menus $avatarMenuIndex -}}
{{- $url := .URL | relLangURL -}}
{{- with .Page -}}
{{- $url = .RelPermalink -}}