Skip to content

Commit 4b0e1f2

Browse files
committed
Add option to alter greeting
Add the parameter greeting to your config.toml to choose a greeting of your own. See #5
1 parent 58377ef commit 4b0e1f2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ You can alter the colours of your website using configuration options. Add the f
136136
>
137137
> Hugo Basic will then use this `resources` folder to find the transpiled SCSS.
138138
139+
### Greeting text
140+
141+
By default, the theme uses the translation of the word 'Hello' for the language of your site. You can also choose to alter this text completely. To do so, add the parameter `greeting` to your `config.toml`, like so:
142+
143+
```
144+
[params]
145+
greeting = "Greetings!"
146+
```
147+
139148
## Acknowledgments
140149

141150
Stock portrait photo obtained [here](https://www.pexels.com/photo/adult-beautiful-blonde-blur-324658/).

layouts/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
<img src="images/portrait.jpg" width="300" height="300" class="portrait" alt="Portrait" />
66
</div>
77
<div class="column right">
8-
<h1>{{ i18n "hello" }}.</h1>
8+
{{- with .Param "greeting" -}}
9+
<h1>{{ . }}</h1>
10+
{{- else -}}
11+
<h1>{{ i18n "hello" }}.</h1>
12+
{{- end -}}
913
<h2>{{ i18n "i-am" }} {{ .Site.Author.name | default "Hallo" }}.</h2>
1014
<p>{{- partial "introduction.html" . -}}</p>
1115

0 commit comments

Comments
 (0)