Skip to content

Commit

Permalink
Add option to alter greeting
Browse files Browse the repository at this point in the history
Add the parameter greeting to your config.toml to choose a greeting of
your own.

See #5
  • Loading branch information
EmielH committed Mar 3, 2019
1 parent 58377ef commit 4b0e1f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ You can alter the colours of your website using configuration options. Add the f
>
> Hugo Basic will then use this `resources` folder to find the transpiled SCSS.
### Greeting text

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:

```
[params]
greeting = "Greetings!"
```

## Acknowledgments

Stock portrait photo obtained [here](https://www.pexels.com/photo/adult-beautiful-blonde-blur-324658/).
Expand Down
6 changes: 5 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<img src="images/portrait.jpg" width="300" height="300" class="portrait" alt="Portrait" />
</div>
<div class="column right">
<h1>{{ i18n "hello" }}.</h1>
{{- with .Param "greeting" -}}
<h1>{{ . }}</h1>
{{- else -}}
<h1>{{ i18n "hello" }}.</h1>
{{- end -}}
<h2>{{ i18n "i-am" }} {{ .Site.Author.name | default "Hallo" }}.</h2>
<p>{{- partial "introduction.html" . -}}</p>

Expand Down

0 comments on commit 4b0e1f2

Please sign in to comment.