Skip to content

Commit

Permalink
Move authors name to params.author map
Browse files Browse the repository at this point in the history
  • Loading branch information
lordmathis committed Nov 22, 2023
1 parent c35654f commit b8cb057
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ Add these params to you `config.toml`

```toml
[params]
author = "Mr Hugo"
user = "hello"
hostname = "gohugo.io"

[params.author]
name = "Mr Hugo"
email = "[email protected]
```
### Social links
Expand Down
5 changes: 4 additions & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ theme = "hugo-theme-nightfall"
url = "about"

[params]
author = "Hugo Nightfall"
user = "hello"
hostname = "gohugo.io"
[params.author]
name = "Hugo Nightfall" # Website and RSS feed author
email = "[email protected]" # RSS feed email address


readingTime = true # Show reading time on post page
published = true # Show published data on post page
Expand Down
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "title"}}
404 | {{ .Site.Params.author }}
404 | {{ .Site.Params.author.name }}
{{ end }}

{{ define "main"}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "title"}}
{{ .Title }} | {{ .Site.Params.author }}
{{ .Title }} | {{ .Site.Params.author.name }}
{{ end }}

{{ define "main" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "title"}}
{{ .Title }} | {{ .Site.Params.author }}
{{ .Title }} | {{ .Site.Params.author.name }}
{{ end }}

{{ define "main" }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<title>
{{ i18n "home" }} | {{ .Site.Params.author }}
{{ i18n "home" }} | {{ .Site.Params.author.name }}
</title>

{{ partial "head.html" . }}
Expand All @@ -19,7 +19,7 @@
<main class="main">
<div class="indexWrapper">
<div>
<h1 class="indexHeader">{{ .Site.Params.author }}</h1>
<h1 class="indexHeader">{{ .Site.Params.author.name }}</h1>
</div>
{{ if isset .Site.Params "social" }}
{{ partial "social.html" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<span>{{ . | safeHTML }}</span>
{{ else }}
<span>
© {{ now.Format "2006" }} {{ .Site.Params.author }}, {{ i18n "powered_by" }}
© {{ now.Format "2006" }} {{ .Site.Params.author.name }}, {{ i18n "powered_by" }}
<a href="https://gohugo.io" class="footerLink">Hugo</a> {{ i18n "and" }}
<a href="https://github.com/LordMathis/hugo-theme-nightfall" class="footerLink">Nightfall</a> {{ i18n "theme" }}
</span>
Expand Down

0 comments on commit b8cb057

Please sign in to comment.