From 944092c2254c344507485b58ff87e5eaeffc80d4 Mon Sep 17 00:00:00 2001 From: Jeffrey C Date: Mon, 4 Mar 2019 08:43:54 -0600 Subject: [PATCH] Add OpenGraph to each page (#147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenGraph Protocol is used by sites like Facebook to display a rich object in a social graph. * Add OpenGraph Protocol to each page Hugo has an internal template for [Open Graph](https://gohugo.io/templates/internal/#open-graph). It takes necessary information from either site's or post's config thus it makes sense to add it to each page. * Add 'series' to posts archetype This taxonomy is used to specify related “see also” pages by placing them in the same series. * Add series taxonomy to exampleSite config. * Add example of series to exampleSite * Add spaz926 to Contributors --- CONTRIBUTORS.md | 3 ++- archetypes/posts.md | 1 + exampleSite/config.toml | 3 +++ exampleSite/content/posts/goisforlovers.md | 1 + exampleSite/content/posts/hugoisforlovers.md | 1 + exampleSite/content/posts/migrate-from-jekyll.md | 1 + layouts/_default/baseof.html | 1 + 7 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 48b5993..733a644 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -29,4 +29,5 @@ - [Piotr Januszewski](https://piojanu.github.io) - [Artem Khvastunov](https://artspb.me) - [Gabriel Nepomuceno] (https://blog.nepomuceno.me) -- [Salvatore Giordano] (https://salvatore-giordano.github.io) \ No newline at end of file +- [Salvatore Giordano] (https://salvatore-giordano.github.io) +- [Jeffrey Carpenter](https://uvolabs.me) \ No newline at end of file diff --git a/archetypes/posts.md b/archetypes/posts.md index 634fa29..afdb40e 100644 --- a/archetypes/posts.md +++ b/archetypes/posts.md @@ -7,4 +7,5 @@ slug = "" tags = [] categories = [] externalLink = "" +series = [] +++ diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 742aea3..63870a2 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -39,6 +39,9 @@ disqusShortname = "yourdiscussshortname" # Custom CSS custom_css = [] +[taxonomies] + series = "series" + [[params.social]] name = "Github" icon = "fab fa-github" diff --git a/exampleSite/content/posts/goisforlovers.md b/exampleSite/content/posts/goisforlovers.md index 7a9a4fe..a06ea5f 100644 --- a/exampleSite/content/posts/goisforlovers.md +++ b/exampleSite/content/posts/goisforlovers.md @@ -13,6 +13,7 @@ categories = [ "Development", "golang", ] +series = ["Getting Started"] +++ Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for diff --git a/exampleSite/content/posts/hugoisforlovers.md b/exampleSite/content/posts/hugoisforlovers.md index d45b5d0..39de754 100644 --- a/exampleSite/content/posts/hugoisforlovers.md +++ b/exampleSite/content/posts/hugoisforlovers.md @@ -11,6 +11,7 @@ categories = [ "Development", "golang", ] +series = ["Getting Started"] +++ ## Step 1. Install Hugo diff --git a/exampleSite/content/posts/migrate-from-jekyll.md b/exampleSite/content/posts/migrate-from-jekyll.md index 8e23c0f..a2a4196 100644 --- a/exampleSite/content/posts/migrate-from-jekyll.md +++ b/exampleSite/content/posts/migrate-from-jekyll.md @@ -2,6 +2,7 @@ date = "2014-03-10" title = "Migrate to Hugo from Jekyll" description = "The post explains how to migrate from from Jekyll to Hugo." +series = ["Getting Started"] +++ Table of Contents diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index adb1062..819e2b8 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -10,6 +10,7 @@ {{ with .Site.Params.keywords }}{{ end }} {{ template "_internal/twitter_cards.html" . }} + {{ template "_internal/opengraph.html" . }} {{ block "title" . }}{{ .Site.Title }}{{ end }}