From b637dd5eb118064286b1faa28b0d3fa3552a0b59 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Fri, 14 Oct 2016 23:07:39 -0400 Subject: [PATCH] layouts/partials/head-meta.html: Use Hugo's templates Instead of writing my own logic for metadata and Twitter cards, I should be using Hugo's own. This makes my theme code cleaner, but means I have to adjust some of the configuration conventions that I have been using. An added bonus is that my theme will work with more sites now, as long as they are using Hugo's config conventions. --- layouts/partials/head-meta.html | 37 +++------------------------------ 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/layouts/partials/head-meta.html b/layouts/partials/head-meta.html index 19099f2..bf6905a 100644 --- a/layouts/partials/head-meta.html +++ b/layouts/partials/head-meta.html @@ -1,42 +1,11 @@ -{{ $title := .Title | default .Site.Title }} -{{ $description := .Params.description | default .Site.Params.description }} -{{ $author := .Params.author | default .Site.Params.author }} - {{ "" | safeHTML }} - - - - {{ "" | safeHTML }} - - - - {{ if eq .Section "post" }} - - - - {{ if .Params.image }} - - {{ end }} - {{ else }} - - {{ end }} - - - - {{ "" | safeHTML }} - {{ if and (eq .Section "post") (.Params.image) }} - - - {{ else }} - - {{ end }} - {{ if .Site.Params.social.twitter_username}}{{ end }} - - + {{ template "_internal/opengraph.html" . }} + {{ template "_internal/schema.html" . }} + {{ template "_internal/twitter_cards.html" . }} {{ if .Site.Params.google_verify_meta }}