浏览代码

fix: add author name to profile page title

Author name now appears in browser tab when visiting an author's profile page.
George Cushen 5 年之前
父节点
当前提交
1990134455
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      layouts/partials/site_head.html

+ 2 - 2
layouts/partials/site_head.html

@@ -175,7 +175,7 @@
   {{ end }}
   {{ end }}
   <meta property="og:site_name" content="{{ site.Title }}">
   <meta property="og:site_name" content="{{ site.Title }}">
   <meta property="og:url" content="{{ .Permalink }}">
   <meta property="og:url" content="{{ .Permalink }}">
-  <meta property="og:title" content="{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}">
+  <meta property="og:title" content="{{ if not .IsHome }}{{ .Params.name | default .Title }} | {{ end }}{{ site.Title }}">
   <meta property="og:description" content="{{ $desc }}">
   <meta property="og:description" content="{{ $desc }}">
   {{- with $og_image -}}
   {{- with $og_image -}}
   <meta property="og:image" content="{{.}}">
   <meta property="og:image" content="{{.}}">
@@ -199,6 +199,6 @@
 
 
   {{ partial "custom_head" . }}
   {{ partial "custom_head" . }}
 
 
-  <title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ site.Title }}</title>
+  <title>{{ if not .IsHome }}{{ .Params.name | default .Title }} | {{ end }}{{ site.Title }}</title>
 
 
 </head>
 </head>