Improve SEO content
This commit is contained in:
40
layouts/partials/seo/seo-meta.html
Normal file
40
layouts/partials/seo/seo-meta.html
Normal file
@@ -0,0 +1,40 @@
|
||||
{{- $description := .Description | default .Summary | default .Site.Params.description | default .Site.Title -}}
|
||||
{{- $keywords := delimit (.Keywords | default .Site.Params.keywords | default (slice)) ", " -}}
|
||||
{{- $author := .Params.author | default .Site.Params.author | default .Site.Title -}}
|
||||
{{- $robots := .Params.robots | default "index, follow" -}}
|
||||
{{- $canonical := .Permalink | default .RelPermalink -}}
|
||||
|
||||
<!-- Primary Meta Tags -->
|
||||
<meta name="description" content="{{ $description }}">
|
||||
<meta name="keywords" content="{{ $keywords }}">
|
||||
<meta name="author" content="{{ $author }}">
|
||||
<meta name="robots" content="{{ $robots }}">
|
||||
<meta name="generator" content="Hugo {{ hugo.Version }}">
|
||||
|
||||
<!-- Canonical URL -->
|
||||
<link rel="canonical" href="{{ $canonical }}">
|
||||
|
||||
<!-- Theme Color -->
|
||||
<meta name="theme-color" content="{{ .Site.Params.seo.theme_color | default "#007bff" }}">
|
||||
<meta name="msapplication-TileColor" content="{{ .Site.Params.seo.theme_color | default "#007bff" }}">
|
||||
|
||||
<!-- Additional SEO -->
|
||||
<meta name="rating" content="general">
|
||||
<meta name="language" content="{{ .Site.Language.Lang | default "en" }}">
|
||||
<meta name="revisit-after" content="7 days">
|
||||
<meta name="distribution" content="global">
|
||||
<meta name="web_author" content="{{ .Site.Params.author | default .Site.Title }}">
|
||||
|
||||
<!-- Geo Tags (if location is specified) -->
|
||||
{{ with .Site.Params.seo.geo }}
|
||||
<meta name="geo.region" content="{{ .region }}">
|
||||
<meta name="geo.placename" content="{{ .placename }}">
|
||||
<meta name="geo.position" content="{{ .latitude }};{{ .longitude }}">
|
||||
<meta name="ICBM" content="{{ .latitude }}, {{ .longitude }}">
|
||||
{{ end }}
|
||||
|
||||
<!-- Dublin Core -->
|
||||
<meta name="DC.Title" content="{{ .Title | default .Site.Title }}">
|
||||
<meta name="DC.Creator" content="{{ $author }}">
|
||||
<meta name="DC.Description" content="{{ $description }}">
|
||||
<meta name="DC.Language" content="{{ .Site.Language.Lang | default "en" }}">
|
||||
Reference in New Issue
Block a user