add tags for SEO
This commit is contained in:
parent
97c892077a
commit
e4e2844c3e
|
@ -22,6 +22,7 @@ style = 'monokailight'
|
||||||
tabWidth = 4
|
tabWidth = 4
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
description = "Example site for hugo-theme-flat"
|
||||||
mainSections = ['posts']
|
mainSections = ['posts']
|
||||||
|
|
||||||
## uncomment belows and set proper values to enable remark42
|
## uncomment belows and set proper values to enable remark42
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>{{ with .Params.Title }}{{ . }} | {{ end }}{{ .Site.Title }}</title>
|
|
||||||
{{ partial "head.html" . }}
|
{{ partial "head.html" . }}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,37 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
|
|
||||||
|
|
||||||
|
{{ $title := .Site.Title -}}
|
||||||
|
{{ if .Params.Title -}}
|
||||||
|
{{ $title = printf "%s | %s" .Params.Title $title -}}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
{{ $description := "" -}}
|
||||||
|
{{ if .IsHome -}}
|
||||||
|
{{ with .Site.Params.description }}{{ $description = . }}{{ end -}}
|
||||||
|
{{ else if .IsPage -}}
|
||||||
|
{{ if .Description -}}
|
||||||
|
{{ $description = .Description -}}
|
||||||
|
{{ else -}}
|
||||||
|
{{ $description = .Summary -}}
|
||||||
|
{{ end -}}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<title>{{ $title }}</title>
|
||||||
|
<link rel="canonical" href="{{ .Permalink }}">
|
||||||
|
{{ if $description -}}
|
||||||
|
<meta name="description" content="{{ $description }}" />
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
<meta property="og:type" content="article" />
|
||||||
|
<meta property="og:title" content="{{ $title }}" />
|
||||||
|
<meta property="og:url" content="{{ .Permalink }}" />
|
||||||
|
{{ if $description -}}
|
||||||
|
<meta property="og:description" content="{{ $description }}" />
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
|
|
||||||
{{ range .AlternativeOutputFormats -}}
|
{{ range .AlternativeOutputFormats -}}
|
||||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
Loading…
Reference in a new issue