mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🐛 Fix: author display error in post and markdown file
This commit is contained in:
@@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
- :sparkles: Feat: add custom aside template in post page ([#172](https://github.com/hugo-fixit/FixIt/issues/172))
|
||||
- :bug: Fix: add function doc2unix to unify new lines symbol between Windows and Unix/Mac OS
|
||||
- :bug: Fix: author display error in post and markdown file
|
||||
- :wrench: Chore: modify babel config and optimize theme.js compilation and loading
|
||||
- :wrench: Chore(deps-dev):
|
||||
- Remove minimist
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
{{- $author := .Site.Author | merge (dict "name" "Anonymous" "link" (echoParam $params "authorlink")) -}}
|
||||
{{- if isset $params "author" | and (ne $params.author .Site.Author.name) -}}
|
||||
{{- $author = dict "name" $params.author | merge $author -}}
|
||||
{{- $author = dict "link" (echoParam $params "authorlink") | merge $author -}}
|
||||
{{- end -}}
|
||||
# {{ .Title }}
|
||||
|
||||
{{ if $params.password -}}
|
||||
@@ -9,6 +14,6 @@
|
||||
|
||||
---
|
||||
|
||||
> {{ T "author"}}: {{ .Site.Author.name }}
|
||||
> {{ T "author"}}: {{ with $author.link }}[{{ $author.name }}]({{ . }}){{ else }}{{ $author.name }}{{ end }}
|
||||
> URL: {{ .Permalink }}
|
||||
{{ if $params.repost.enable | and (hasPrefix $params.repost.url "http") }}> {{ T "repost" }} URL: {{ $params.repost.url }}{{ end }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
|
||||
{{- $author := .Site.Author | merge (dict "name" "" "link" (echoParam $params "authorlink") "email" (echoParam $params "authoremail")) -}}
|
||||
{{- $author := .Site.Author | merge (dict "name" "Anonymous" "link" (echoParam $params "authorlink") "email" (echoParam $params "authoremail")) -}}
|
||||
{{- $avatar := .Site.Params.home.profile.avatarURL -}}
|
||||
{{- if isset $params "author" | and (ne $params.author .Site.Author.name) -}}
|
||||
{{- $author = dict "name" $params.author | merge $author -}}
|
||||
|
||||
Reference in New Issue
Block a user