Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Vanegas <avanegas04@gmail.com>2020-08-27 15:45:50 +0300
committerGitHub <noreply@github.com>2020-08-27 15:45:50 +0300
commit6c2cca012758803802a81d06dccb60c2d2d48b66 (patch)
tree25f9b333f52e0f644a0de14b8f9e4dd697a12d08
parent979d6a4bc3b263bd1dc82ca70430afa88d686750 (diff)
Support custom homepage greeting message (#66)v1.2.0
* Support custom greeting message in homepage Co-authored-by: Emruz Hossain <emruz@appscode.com>
-rw-r--r--README.md2
-rw-r--r--exampleSite/config.yaml2
-rw-r--r--layouts/partials/sections/home.html20
3 files changed, 15 insertions, 9 deletions
diff --git a/README.md b/README.md
index 24b665e..0113569 100644
--- a/README.md
+++ b/README.md
@@ -116,6 +116,8 @@ params:
name: "Jane Doe"
nickname: "Jane"
image: "images/avatar.png"
+ # greeting message before your name. it will default to "Hi! I am" if not provided
+ greeting: "Hi, I am"
# give your some contact information. they will be used in the footer
contactInfo:
email: "janedoe@example.com"
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml
index 47a59cb..a268aed 100644
--- a/exampleSite/config.yaml
+++ b/exampleSite/config.yaml
@@ -66,6 +66,8 @@ params:
name: "Jane Doe"
nickname: "Jane"
image: "images/avatar.png"
+ # greeting message before your name. it will default to "Hi! I am" if not provided
+ greeting: "Hi, I am"
# give your some contact information. they will be used in the footer
contactInfo:
email: "janedoe@example.com"
diff --git a/layouts/partials/sections/home.html b/layouts/partials/sections/home.html
index 2f825a7..549079d 100644
--- a/layouts/partials/sections/home.html
+++ b/layouts/partials/sections/home.html
@@ -1,3 +1,13 @@
+{{ $greeting:="Hi! I am" }}
+{{ if .Site.Params.author.greeting }}
+ {{ $greeting = .Site.Params.author.greeting }}
+{{ end }}
+{{ $name:="Jane Doe" }}
+{{ if .Site.Params.author.nickname }}
+ {{ $name = .Site.Params.author.nickname }}
+{{ else if .Site.Params.author.name }}
+ {{ $name = .Site.Params.author.name }}
+{{ end }}
<div class="container-fluid home" id="home">
<div
class="background container-fluid"
@@ -7,15 +17,7 @@
<img src="{{ if .Site.Params.author.image }}{{ .Site.Params.author.image }}{{ else }}/assets/images/default-avatar.png{{ end }}"
class="rounded-circle mx-auto d-block img-fluid"
/>
- <h1 class="greeting">Hi, I am
- {{ if .Site.Params.author.nickname }}
- {{ .Site.Params.author.nickname }}
- {{ else if .Site.Params.author.name }}
- {{ .Site.Params.author.name }}
- {{ else }}
- Jane Doe
- {{ end }}
- </h1>
+ <h1 class="greeting"> {{ $greeting }} {{ $name }}</h1>
<div class="typing-carousel">
<span id="ityped" class="ityped"></span>
<span class="ityped-cursor"></span>