mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-09 14:59:45 +00:00
Add open Graph meta data
This commit is contained in:
parent
8549e0c94b
commit
8d7109a35f
3 changed files with 12 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
{{ block "head" . }}
|
||||
{{ partial "head/metadata.html" . }}
|
||||
{{ partial "head/openGraph.html" . }}
|
||||
{{ partial "head/favicons.html" . }}
|
||||
{{ partial "head/css.html" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<head>
|
||||
{{ partial "head/metadata.html" . }}
|
||||
{{ partial "head/openGraph.html" . }}
|
||||
{{ partial "head/favicons.html" . }}
|
||||
{{ partial "head/css.html" . }}
|
||||
</head>
|
||||
|
|
10
layouts/partials/head/openGraph.html
Normal file
10
layouts/partials/head/openGraph.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<meta property="og:title" content="{{ .Title }}{{ if ne .Title .Site.Title }} - {{ .Site.Title }}{{ end }}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"/>
|
||||
<meta property="og:url" content="{{ .Permalink }}"/>
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}"/>
|
||||
{{ if .Params.image }}
|
||||
<meta property="og:image" content="{{ .Params.image | absURL }}"/>
|
||||
{{ else }}
|
||||
<meta property="og:image" content="{{ .Site.Params.avatar | absURL }}"/>
|
||||
{{ end }}
|
Loading…
Reference in a new issue