소스 검색

If is home then insert meta description

Zachary Betz 6 년 전
부모
커밋
b0c4dc0755
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      layouts/partials/head.html

+ 6 - 0
layouts/partials/head.html

@@ -6,6 +6,12 @@
   {{ .Hugo.Generator }}
   <link rel="canonical" href="{{ .Permalink }}">
 
+  {{ if .IsHome }}
+    {{ with .Site.Params.description }}
+      <meta name="description" content="{{ . | plainify }}">
+    {{ end }}
+  {{ end }}
+
   <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
   <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
   <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">