2023-10-12 20:20:41
This commit is contained in:
parent
97071b9de7
commit
c34052ddfc
11 changed files with 44 additions and 32 deletions
|
@ -84,8 +84,7 @@
|
|||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
|
||||
{{ (partial "seo/twitter" .) }}
|
||||
{{ (partial "seo/opengraph" .) }}
|
||||
{{ (partial "seo/common" .) }}
|
||||
{{ (partial "seo/dc" .) }}
|
||||
{{ (partial "seo/schema" .) }}
|
||||
{{ (partial "seo/schema/schema" .) }}
|
||||
<!--[ / seo ]-->
|
||||
|
|
30
layouts/partials/seo/common.html
Normal file
30
layouts/partials/seo/common.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{{ $description := (site.Params.description) }}
|
||||
{{ with (.Summary) }}{{ $description = . }}{{ end }}
|
||||
{{ with (.Description) }}{{ $description = . }}{{ end }}
|
||||
{{ $image := (index (.Param "images") 0) }}
|
||||
|
||||
<meta property="og:locale" content="{{ ((replace (site.LanguageCode) "-" "_") | default "en_US") }}"/>
|
||||
<meta property="og:site_name" content="{{ (site.Title) }}"/>
|
||||
|
||||
{{ if ($.IsPage) }}
|
||||
<meta name="aiturec:title" content="{{ (.Title) }}"/>
|
||||
<meta property="aiturec:description" content="{{ ($description) }}"/>
|
||||
<meta property="aiturec:image" content="{{ ($image) }}"/>
|
||||
<meta property="aiturec:item_id" content="{{ (.Param "uuid") }}"/>
|
||||
<meta property="aiturec:datetime" content="{{ (.Date.Format "2006-01-02T15:04:05Z07:00") }}"/>
|
||||
<meta itemprop="description" content="{{ ($description) }}"/>
|
||||
<meta itemprop="image" content="{{ ($image) }}"/>
|
||||
<meta property="vk:image" content="{{ ($image) }}"/>
|
||||
|
||||
{{ with (.GetTerms "authors") }}
|
||||
{{ range . }}
|
||||
<meta property="article:author" content="{{ (.Title) }}"/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with (.GetTerms "tags") }}
|
||||
{{ range . }}
|
||||
<meta property="article:tag" content="{{ (.Title) }}"/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -1,15 +0,0 @@
|
|||
{{ if ($.IsPage) }}
|
||||
|
||||
{{ with (.GetTerms "authors") }}
|
||||
{{ range . }}
|
||||
<meta property="article:author" content="{{ (.Title) }}"/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with (.GetTerms "tags") }}
|
||||
{{ range . }}
|
||||
<meta property="article:tag" content="{{ (.Title) }}"/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
|
@ -1,8 +0,0 @@
|
|||
{{ (partial "seo/type/website.html" .) }}
|
||||
{{ (partial "seo/type/organization.html" .) }}
|
||||
{{ (partial "seo/type/navigation.html" .) }}
|
||||
|
||||
{{ if ($.IsPage) }}
|
||||
{{ (partial "seo/type/breadcrumbList.html" .) }}
|
||||
{{ (partial "seo/type/article.html" .) }}
|
||||
{{ end }}
|
8
layouts/partials/seo/schema/schema.html
Normal file
8
layouts/partials/seo/schema/schema.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{ (partial "seo/schema/type/website.html" .) }}
|
||||
{{ (partial "seo/schema/type/organization.html" .) }}
|
||||
{{ (partial "seo/schema/type/navigation.html" .) }}
|
||||
|
||||
{{ if ($.IsPage) }}
|
||||
{{ (partial "seo/schema/type/breadcrumbList.html" .) }}
|
||||
{{ (partial "seo/schema/type/article.html" .) }}
|
||||
{{ end }}
|
|
@ -1,7 +1,7 @@
|
|||
{{ $date := ((.Date.UTC.Format "2006-01-02T15:04:05Z07:00") | default "") }}
|
||||
{{ $datePublished := ((.PublishDate.UTC.Format "2006-01-02T15:04:05Z07:00") | default ($date)) }}
|
||||
{{ $dateCreated := ((.PublishDate.UTC.Format "2006-01-02T15:04:05Z07:00") | default ($date)) }}
|
||||
{{ $dateModified := ((.Lastmod.UTC.Format "2006-01-02T15:04:05Z07:00") | default ($date)) }}
|
||||
{{ $date := ((.Date.Format "2006-01-02T15:04:05Z07:00") | default "") }}
|
||||
{{ $datePublished := ((.PublishDate.Format "2006-01-02T15:04:05Z07:00") | default ($date)) }}
|
||||
{{ $dateCreated := ((.PublishDate.Format "2006-01-02T15:04:05Z07:00") | default ($date)) }}
|
||||
{{ $dateModified := ((.Lastmod.Format "2006-01-02T15:04:05Z07:00") | default ($date)) }}
|
||||
|
||||
{{ $description := (site.Params.description) }}
|
||||
{{ with (.Summary) }}{{ $description = . }}{{ end }}
|
|
@ -1,2 +0,0 @@
|
|||
{{ if ($.IsPage) }}
|
||||
{{ end }}
|
Loading…
Reference in a new issue