First version of the theme
This commit is contained in:
commit
8dd30f6eb8
61 changed files with 1658 additions and 0 deletions
38
layouts/partials/opengraph.html
Normal file
38
layouts/partials/opengraph.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<meta name="twitter:card" content="summary_large_image"/>
|
||||
{{ with .Site.Params.twitterUser }}
|
||||
<meta name="twitter:site" content="@{{ . }}"/>
|
||||
{{ end }}
|
||||
|
||||
<meta name="twitter:title" content="{{ .Title }}"/>
|
||||
{{ if .Description }}
|
||||
<meta name="twitter:description" content="{{ .Description }}"/>
|
||||
{{ else }}
|
||||
<meta name="twitter:description" content="{{ .Site.Params.description }}"/>
|
||||
{{ end }}
|
||||
|
||||
<meta property="og:title" content="{{ .Title }}" />
|
||||
{{ if .Description }}
|
||||
<meta property="og:description" content="{{ .Description }}"/>
|
||||
{{ else }}
|
||||
<meta property="og:description" content="{{ .Site.Params.description }}"/>
|
||||
{{ end }}
|
||||
{{ if eq .Kind "page" }}
|
||||
<meta property="og:type" content="article" />
|
||||
{{ else }}
|
||||
<meta property="og:type" content="website" />
|
||||
{{ end }}
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
{{ $title := .Title }}
|
||||
{{if .Params.images }}
|
||||
{{ $baseUrl := .Permalink }}
|
||||
{{ $altText := i18n "alt_image" }}
|
||||
{{ range first 1 .Params.images }}
|
||||
<meta property="og:image" content="{{ $baseUrl }}{{ . }}"/>
|
||||
<meta property="og:image:alt" content="{{ $altText }} {{ $title }}"/>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<meta property="og:image" content="{{ .Site.BaseURL }}images/avatar.png"/>
|
||||
<meta property="og:image:alt" content="{{ i18n "alt_avatar" . }}"/>
|
||||
{{ end }}
|
||||
<meta property="og:updated_time" content="{{ .Site.LastChange }}" />
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}" />
|
Loading…
Add table
Add a link
Reference in a new issue