瀏覽代碼

Add meta description to header

Based on hugo docs: https://gohugo.io/variables/site/#example-site-params
And developers.google recommendations: https://developers.google.com/web/tools/lighthouse/audits/description?utm_source=lighthouse&utm_medium=devtools
Artur Zylinski 5 年之前
父節點
當前提交
b6a5534d1b
共有 1 個檔案被更改,包括 1 行新增0 行删除
  1. 1
    0
      layouts/partials/head.html

+ 1
- 0
layouts/partials/head.html 查看文件

@@ -13,6 +13,7 @@
13 13
   {{- else -}}
14 14
   <title>{{ .Title }} &middot; {{ .Site.Title }}</title>
15 15
   {{- end }}
16
+  <meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
16 17
 
17 18
   <!-- CSS -->
18 19
   <link type="text/css" rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print">