Last active
August 13, 2019 23:26
-
-
Save zadrafi/108a4799b72cda105b6e4942cc672b4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{- if eq .Kind "taxonomyTerm" }} | |
{{- range $key, $value := .Data.Terms.ByCount }} | |
{{- $.Scratch.Add "most_used" (slice $value.Name) }} | |
{{- end }} | |
{{- $title := printf "%s" $.Title}} | |
{{- $.Scratch.Set "Title" $title }} | |
{{- else if eq .Kind "taxonomy" }} | |
{{- $description := printf "" .Data.Singular $.Title ( index .Pages 0).Title | truncate 160 }} | |
{{- $.Scratch.Set "Description" $description }} | |
{{- $title := printf "%s" $.Title }} | |
{{- $.Scratch.Set "Title" $title }} | |
{{- else }} | |
{{- $.Scratch.Set "Description" ( .Description | default .Params.subtitle | default .Summary ) }} | |
{{- $.Scratch.Set "Title" ( .Title | default .Site.Title ) }} | |
{{- end }} | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<!-- Site Title, Description, Author, and Favicon --> | |
{{- with ($.Scratch.Get "Title") }} | |
<title>{{ title . }} | {{ $.Site.Title }}</title> | |
<meta property="og:title" content="{{ . }}" /> | |
<meta name="twitter:title" content="{{ . | truncate 70 }}" /> | |
{{- end }} | |
{{- with ($.Scratch.Get "Description") }} | |
<meta name="description" content="{{ . }}"> | |
<meta property="og:description" content="{{ . }}"> | |
<meta name="twitter:description" content="{{ . | truncate 200 }}"> | |
{{- end }} | |
<meta content="{{ delimit .Keywords ", " }}" name="keywords"> | |
{{ if .IsHome -}} | |
<title>{{ .Site.Title }} {{ .Description }}</title> | |
{{- else -}} | |
<title>{{ .Title }} {{ .Description }}</title> | |
{{- end }} | |
{{- with .Site.Author.name }} | |
<meta name="author" content="{{ . }}"/> | |
{{- end }} | |
{{- partial "seo/main.html" . }} | |
{{- with .Site.Params.favicon }} | |
<link href='{{ . | absURL }}' rel='icon' type='image/x-icon'/> | |
{{- end -}} | |
<!--Open Graph Meta Data For Image --> | |
{{ if .Params.og_image }} | |
<meta property="og:image" content="{{ .Params.og_image | relURL }}"/> | |
<meta property="og:image:secure_url" content="{{ .Params.og_image | absURL }}"/> | |
{{ else }} | |
<meta property="og:image" content="{{ .Site.Params.og_image | relURL }}"/> | |
<meta property="og:image:secure_url" content="{{ .Site.Params.og_image | absURL }}"/> | |
{{ end }} | |
<!-- End --> | |
<!-- Social Media Tags --> | |
{{- with .Params.share_img | default .Params.image | default .Site.Params.logo }} | |
<meta property="og:image" content="{{ . | absURL }}" /> | |
<meta name="twitter:image" content="{{ . | absURL }}" /> | |
{{- end }} | |
<meta name="twitter:card" content="summary" /> | |
{{- with .Site.Author.twitter }} | |
<meta name="twitter:site" content="@{{ . }}" /> | |
<meta name="twitter:creator" content="@{{ . }}" /> | |
{{- end }} | |
{{- with .Site.Params.fb_app_id }} | |
<meta property="fb:app_id" content="{{ . }}" /> | |
{{- end }} | |
<meta property="og:url" content="{{ .URL | absLangURL }}" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:site_name" content="{{ .Site.Title }}" /> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment