소스 검색

Allow a shorter 'nickname' for the initial home greeting (#23)

Jason Tipton 5 년 전
부모
커밋
436746b170
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      exampleSite/config.yaml
  2. 8 1
      layouts/partials/home.html

+ 1 - 0
exampleSite/config.yaml

@@ -41,6 +41,7 @@ params:
   # some information about you
   author:
     name: "Jane Doe"
+    nickname: "Jane"
     image: "images/avatar.png"
     # give your some contact information. they will be used in the footer
     contactInfo:

+ 8 - 1
layouts/partials/home.html

@@ -7,7 +7,14 @@
     <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.name }}{{ .Site.Params.author.name }}{{ else }}Jane Doe{{ end }}
+    <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>
     <div class="typing-carousel">
       <span id="ityped" class="ityped"></span>