From 57bd7609c064ba72540202a05710021b43460dd7 Mon Sep 17 00:00:00 2001 From: Matt Stratton Date: Thu, 19 Jan 2017 20:00:48 -0600 Subject: [PATCH 1/2] Add basic social metadata --- .../content/events/2017-ponyville/speakers.md | 1 - layouts/partials/head.html | 1 + layouts/partials/head/seo.html | 2 + layouts/partials/head/seo/google_news.html | 4 ++ layouts/partials/head/seo/open_graph.html | 45 +++++++++++++++++++ layouts/partials/head/seo/schema.html | 15 +++++++ layouts/partials/head/seo/twitter_cards.html | 17 +++++++ 7 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/head/seo.html create mode 100644 layouts/partials/head/seo/google_news.html create mode 100644 layouts/partials/head/seo/open_graph.html create mode 100644 layouts/partials/head/seo/schema.html create mode 100644 layouts/partials/head/seo/twitter_cards.html diff --git a/exampleSite/content/events/2017-ponyville/speakers.md b/exampleSite/content/events/2017-ponyville/speakers.md index e536e7b60..0656f29b7 100644 --- a/exampleSite/content/events/2017-ponyville/speakers.md +++ b/exampleSite/content/events/2017-ponyville/speakers.md @@ -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" +++ diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 92292208c..23c7775ae 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -2,6 +2,7 @@ {{ .Hugo.Generator }} {{- partial "meta.html" . -}} +{{ partial "head/seo.html" . }} {{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} {{ if eq $url "/" }} {{ .Site.Title }} {{ else }} {{ if .Params.Heading }} {{ .Params.Heading }} {{ else }} {{ .Title }} {{ end }} {{ end }} diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html new file mode 100644 index 000000000..4e3ae562a --- /dev/null +++ b/layouts/partials/head/seo.html @@ -0,0 +1,2 @@ +{{ partial "head/seo/open_graph.html" . }} +{{ partial "head/seo/schema.html" . }} diff --git a/layouts/partials/head/seo/google_news.html b/layouts/partials/head/seo/google_news.html new file mode 100644 index 000000000..f6ba6028f --- /dev/null +++ b/layouts/partials/head/seo/google_news.html @@ -0,0 +1,4 @@ + +{{ with .Params.news_keywords }} + +{{ 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 000000000..3d63152cf --- /dev/null +++ b/layouts/partials/head/seo/open_graph.html @@ -0,0 +1,45 @@ + + + + + +{{ with .Params.images }}{{ range first 1 . }} + +{{ end }}{{ end }} + + + +{{ with .Params.audio }}{{ end }} +{{ with .Params.locale }}{{ end }} +{{ with .Site.Params.title }}{{ end }} +{{ with .Params.videos }}{{ range . }} + +{{ end }}{{ end }} + + +{{ $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 }}{{ end }} + {{ end }} +{{ end }}{{ end }} + +{{ if and (isset .Site.Params "authors") (isset .Params "author") }} + +{{ $author := index .Site.Params.authors .Params.author }} + +{{ end }} + +{{if .IsPage}} + +{{ end }} + + +{{ with .Params.tags }}{{ range first 6 . }} + +{{ end }}{{ end }} + + +{{ with .Site.Params.social.facebook_admin }}{{ end }} diff --git a/layouts/partials/head/seo/schema.html b/layouts/partials/head/seo/schema.html new file mode 100644 index 000000000..e34883417 --- /dev/null +++ b/layouts/partials/head/seo/schema.html @@ -0,0 +1,15 @@ + + + + + +{{ with .Params.images }}{{ range first 6 . }} + +{{ end }}{{ end }} + + + + +{{if .IsPage}} + +{{ 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 000000000..876f5836c --- /dev/null +++ b/layouts/partials/head/seo/twitter_cards.html @@ -0,0 +1,17 @@ +{{ with .Params.images }} + + + +{{ else }} + +{{ end }} + + + + +{{ with .Site.Params.social.twitter }}{{ end }} +{{ with .Site.Params.social.twitter_domain }}{{ end }} +{{ if isset .Params "author" }} + {{ $author := index .Site.Params.authors .Params.author }} + {{ with $author.twitter }}{{ end }} +{{ end }} \ No newline at end of file From 19d82323d3dc3798299a4c6b71254ada3fc362be Mon Sep 17 00:00:00 2001 From: Matt Stratton Date: Thu, 19 Jan 2017 20:03:27 -0600 Subject: [PATCH 2/2] remove critical css gulp task --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 8b5467860..21c0280c8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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 ) })