From 4b0e1f2c509486e0b0eceb35cbc94772d0d8ace2 Mon Sep 17 00:00:00 2001 From: Emiel Hollander Date: Sun, 3 Mar 2019 15:39:02 +0100 Subject: Add option to alter greeting Add the parameter greeting to your config.toml to choose a greeting of your own. See #5 --- README.md | 9 +++++++++ layouts/index.html | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c29fb96..9e34988 100644 --- a/README.md +++ b/README.md @@ -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/). diff --git a/layouts/index.html b/layouts/index.html index 015419c..d14a097 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -5,7 +5,11 @@ Portrait
-

{{ i18n "hello" }}.

+ {{- with .Param "greeting" -}} +

{{ . }}

+ {{- else -}} +

{{ i18n "hello" }}.

+ {{- end -}}

{{ i18n "i-am" }} {{ .Site.Author.name | default "Hallo" }}.

{{- partial "introduction.html" . -}}

-- cgit v1.2.3