Add meta keywords for SEO (#49)

This commit is contained in:
Yash Mehrotra
2021-08-13 23:37:58 +05:30
committed by GitHub
parent 71899d4516
commit 26cdc5b20e
2 changed files with 5 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ pygmentsStyle = "monokai"
avatarSize = "size-m"
customHeadHTML = ""
showPostsOnHomePage = "popular"
metaKeywords = ["blog", "gokarna", "hugo"]
[menu]
[[menu.main]]

View File

@@ -11,10 +11,14 @@
{{ $title := .Title | default .Site.Title }}
{{ $description := .Description | default .Site.Params.Description }}
{{ $image := .Params.image | default .Site.Params.AvatarURL }}
{{ $siteKeywords := .Site.Params.MetaKeywords | default (slice) }}
{{ $postKeywords := .Params.tags | default (slice) }}
{{ $keywords := union $siteKeywords $postKeywords }}
<!-- SEO titles & descriptions -->
<title>{{ $title }}</title>
<meta name="description" content="{{ $description }}">
<meta name="keywords" content='{{ delimit $keywords ", "}}'>
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:type" content="website">