瀏覽代碼

Show name pronunciation in About widgets (#2489)

Add `name_pronunciation: ...` to an author profile to use.
kazutoiris 3 年之前
父節點
當前提交
87f69f8c26
共有 2 個文件被更改,包括 24 次插入2 次删除
  1. 12 1
      wowchemy/layouts/partials/widgets/about.avatar.html
  2. 12 1
      wowchemy/layouts/partials/widgets/about.html

+ 12 - 1
wowchemy/layouts/partials/widgets/about.avatar.html

@@ -28,7 +28,18 @@
   {{ end }}
 
   <div class="portrait-title">
-    <h2>{{ $person_page.Title }}</h2>
+    
+    <h2>
+      {{- if $person.name_pronunciation -}}
+        <ruby>
+          <rb>{{ $person_page.Title }}</rb>
+          <rt>{{ $person.name_pronunciation }}</rt>
+        </ruby>
+      {{- else -}}
+        {{- $person_page.Title -}}
+      {{- end -}}
+    </h2>
+
     {{ with $person.role }}<h3>{{ . | markdownify | emojify }}</h3>{{ end }}
 
     {{ range $person.organizations }}

+ 12 - 1
wowchemy/layouts/partials/widgets/about.html

@@ -32,7 +32,18 @@
       {{ end }}
 
       <div class="portrait-title">
-        <h2>{{ $person_page.Title }}</h2>
+        
+        <h2>
+          {{- if $person.name_pronunciation -}}
+            <ruby>
+              <rb>{{ $person_page.Title }}</rb>
+              <rt>{{ $person.name_pronunciation }}</rt>
+            </ruby>
+          {{- else -}}
+            {{- $person_page.Title -}}
+          {{- end -}}
+        </h2>
+        
         {{ with $person.role }}<h3>{{ . | markdownify | emojify }}</h3>{{ end }}
 
         {{ range $person.organizations }}