Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: add author deprecation warning #693
- Loading branch information
Showing
3 changed files
with
19 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- $authorName := "" }} | ||
{{- if .Site.Params.author }} | ||
{{- if reflect.IsMap .Site.Params.author }} | ||
{{- with .Site.Params.author.name }} | ||
{{- $authorName = . }} | ||
{{- end }} | ||
{{- else }} | ||
{{- warnf "%q: DEPRECATED usage of 'params.author' config parameter found, replace it with `params.author.name` in your config.toml; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration/#5230" .File.Path }} | ||
{{- $authorName = .Site.Params.author }} | ||
{{- end }} | ||
{{- else }} | ||
{{- with .Site.Author.name }} | ||
{{- $authorName = . }} | ||
{{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} | ||
{{- end }} | ||
{{- end }} | ||
{{- return $authorName }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters