Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion exampleSite/content/events/2017-ponyville/speakers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
+++
Title = "Speakers for Ponyville"
date = "2016-12-08T20:55:58-06:00"
PublishDate = "2016-12-08T20:55:58-06:00"
type = "speakers"
+++
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ gulp.task('copy-icons', function(){

// Removing the call to responsive-images
gulp.task('default', function (callback) {
runSequence('copy-js', 'copy-css', 'process-html', 'copy-images', 'process-files', 'update-files', 'copy-other-files', 'copy-icons', 'copy-fonts',
runSequence('copy-js', 'copy-css', 'min-html', 'copy-images', 'process-files', 'update-files', 'copy-other-files', 'copy-icons', 'copy-fonts',
callback
)
})
1 change: 1 addition & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{ .Hugo.Generator }}
{{- partial "meta.html" . -}}
{{ partial "head/seo.html" . }}
<title>
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} {{ if eq $url "/" }} {{ .Site.Title }} {{ else }} {{ if .Params.Heading }} {{ .Params.Heading }} {{ else }} {{ .Title }} {{ end }} {{ end }}
</title>
Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/head/seo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{ partial "head/seo/open_graph.html" . }}
{{ partial "head/seo/schema.html" . }}
4 changes: 4 additions & 0 deletions layouts/partials/head/seo/google_news.html
Original file line number Diff line number Diff line change
@@ -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 }}
45 changes: 45 additions & 0 deletions layouts/partials/head/seo/open_graph.html
Original file line number Diff line number Diff line change
@@ -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 }}
15 changes: 15 additions & 0 deletions layouts/partials/head/seo/schema.html
Original file line number Diff line number Diff line change
@@ -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 }}
17 changes: 17 additions & 0 deletions layouts/partials/head/seo/twitter_cards.html
Original file line number Diff line number Diff line change
@@ -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 }}