Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mattstratton/castanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Stratton <matt.stratton@gmail.com>2016-09-21 20:53:40 +0300
committerMatt Stratton <matt.stratton@gmail.com>2016-09-21 20:53:40 +0300
commitc9ecaa384a2112374d798be45a37bb7ffedef6cb (patch)
treef7ee18e641a0ef8f16a2f115ce8142d3bd698f0f /layouts/partials
parent131dfbeb99d9c26d32cd65ddd14bc1e47e4faabd (diff)
Add bare minimum for partials
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/footer.html4
-rw-r--r--layouts/partials/head/seo.html4
-rw-r--r--layouts/partials/head/seo/google_news.html4
-rw-r--r--layouts/partials/head/seo/open_graph.html45
-rw-r--r--layouts/partials/head/seo/schema.html15
-rw-r--r--layouts/partials/head/seo/twitter_cards.html17
-rw-r--r--layouts/partials/header.html5
-rw-r--r--layouts/partials/meta.html11
8 files changed, 105 insertions, 0 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index e69de29..7ad7717 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -0,0 +1,4 @@
+{{ partial "footer_scripts" . }}
+
+</body>
+</html>
diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html
new file mode 100644
index 0000000..30882ac
--- /dev/null
+++ b/layouts/partials/head/seo.html
@@ -0,0 +1,4 @@
+{{ partial "head/seo/open_graph.html" . }}
+{{ partial "head/seo/schema.html" . }}
+{{ partial "head/seo/twitter_cards.html" . }}
+{{ partial "head/seo/google_news.html" . }} \ No newline at end of file
diff --git a/layouts/partials/head/seo/google_news.html b/layouts/partials/head/seo/google_news.html
new file mode 100644
index 0000000..f6ba602
--- /dev/null
+++ b/layouts/partials/head/seo/google_news.html
@@ -0,0 +1,4 @@
+<!-- Output news_keywords taxonomy as Google news_keywords -->
+{{ with .Params.news_keywords }}
+ <meta name="news_keywords" content="{{ range $i, $kw := first 10 . }}{{ if $i }},{{ end }}{{ $kw }}{{ end }}" />
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/head/seo/open_graph.html b/layouts/partials/head/seo/open_graph.html
new file mode 100644
index 0000000..3d63152
--- /dev/null
+++ b/layouts/partials/head/seo/open_graph.html
@@ -0,0 +1,45 @@
+<!-- Required Open Graph Info -->
+<meta property="og:title" content="{{ title .Title }}" />
+<meta property="og:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}" />
+<meta property="og:type" content="{{ if .Params.type }}{{ .Params.type }}{{ else }}website{{ end }}" />
+<meta property="og:url" content="{{ .Permalink }}" />
+{{ with .Params.images }}{{ range first 1 . }}
+ <meta property="og:image" content="{{ . }}" />
+{{ end }}{{ end }}
+
+<!-- Optional Open Graph Markup -->
+<meta property="og:updated_time" content="{{ .Date }}"/>
+{{ with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
+{{ with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
+{{ with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
+{{ with .Params.videos }}{{ range . }}
+ <meta property="og:video" content="{{ . }}" />
+{{ end }}{{ end }}
+
+<!-- If it is part of a series, link to related articles -->
+{{ $permalink := .Permalink }}
+{{ $siteSeries := .Site.Taxonomies.series }}
+{{ with .Params.series }}{{ range $name := . }}
+ {{ $series := index $siteSeries $name }}
+ {{ range $page := first 6 $series.Pages }}
+ {{ if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
+ {{ end }}
+{{ end }}{{ end }}
+
+{{ if and (isset .Site.Params "authors") (isset .Params "author") }}
+<!-- Article Specific Open Graph Markup -->
+{{ $author := index .Site.Params.authors .Params.author }}
+<meta property="article:author" content="https://www.facebook.com/{{ $author.social.facebook }}" />
+{{ end }}
+<meta property="article:publisher" content="https://www.facebook.com/{{ .Site.Params.social.facebook }}" />
+{{if .IsPage}}
+<meta property="article:published_time" content="{{ .PublishDate }}" />
+{{ end }}
+<meta property="article:modified_time" content="{{ .Date }}" />
+<meta property="article:section" content="{{ .Section }}" />
+{{ with .Params.tags }}{{ range first 6 . }}
+ <meta property="article:tag" content="{{ . }}" />
+{{ end }}{{ end }}
+
+<!-- Facebook Page Admin ID for Domain Insights -->
+{{ with .Site.Params.social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
diff --git a/layouts/partials/head/seo/schema.html b/layouts/partials/head/seo/schema.html
new file mode 100644
index 0000000..e348834
--- /dev/null
+++ b/layouts/partials/head/seo/schema.html
@@ -0,0 +1,15 @@
+<!-- Schema.org markup -->
+<meta itemprop="name" content="{{ .Title }}">
+<meta itemprop="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}">
+
+<!-- Output images -->
+{{ with .Params.images }}{{ range first 6 . }}
+ <meta itemprop="image" content="{{ . }}">
+{{ end }}{{ end }}
+
+<!-- Output all taxonomies as schema.org keywords -->
+<meta itemprop="keywords" content="{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}" />
+
+{{if .IsPage}}
+<meta itemprop="wordCount" content="{{ .WordCount }}">
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/head/seo/twitter_cards.html b/layouts/partials/head/seo/twitter_cards.html
new file mode 100644
index 0000000..876f583
--- /dev/null
+++ b/layouts/partials/head/seo/twitter_cards.html
@@ -0,0 +1,17 @@
+{{ with .Params.images }}
+<!-- Twitter summary card with large image must be at least 280x150px -->
+ <meta name="twitter:card" content="summary_large_image"/>
+ <meta name="twitter:image:src" content="{{ index . 0 }}"/>
+{{ else }}
+ <meta name="twitter:card" content="summary"/>
+{{ end }}
+
+<!-- Twitter Card data -->
+<meta name="twitter:title" content="{{ .Title }}"/>
+<meta name="twitter:description" content="{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}"/>
+{{ with .Site.Params.social.twitter }}<meta name="twitter:site" content="@{{ . }}"/>{{ end }}
+{{ with .Site.Params.social.twitter_domain }}<meta name="twitter:domain" content="{{ . }}"/>{{ end }}
+{{ if isset .Params "author" }}
+ {{ $author := index .Site.Params.authors .Params.author }}
+ {{ with $author.twitter }}<meta name="twitter:creator" content="@{{ $author.twitter }}"/>{{ end }}
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index e69de29..5acdcdf 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+{{ partial "head.html" . }}
+
+<body lang="{{ .Site.Params.Lang }}">
diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html
index e69de29..da07ef0 100644
--- a/layouts/partials/meta.html
+++ b/layouts/partials/meta.html
@@ -0,0 +1,11 @@
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="chrome=1">
+<meta name="HandheldFriendly" content="True">
+<meta name="MobileOptimized" content="320">
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
+{{ if .Description}}
+ <meta name="description" content="{{ .Description }}">
+{{ else }}
+ {{ if .Site.Params.Description }}<meta name="description" content="{{ .Site.Params.Description }}">
+ {{ end }}
+{{ end }}