mirror of https://github.com/luizdepra/hugo-coder.git

Artem Khvastunov
07.26.2019 3d4335a7879180b12ea34dfc9fba0d76fd5700ae
Add Twitter Cards to each page (#133)

* Add Twitter Cards to each page

Hugo has an internal template for [Twitter Cards](https://gohugo.io/templates/internal/#twitter-cards). It takes necessary information from either site's or post's config thus it makes sense to add it to each page.

* Add 'description' to posts archetype

This optional field is used by Twitter Cards.

* Add example usage of Twitter Cards

* Add artspb to contributors
5 files modified
7 ■■■■■ changed files
CONTRIBUTORS.md 1 ●●●● patch | view | raw | blame | history
archetypes/posts.md 1 ●●●● patch | view | raw | blame | history
exampleSite/content/posts/migrate-from-jekyll.md 1 ●●●● patch | view | raw | blame | history
exampleSite/content/posts/theme-demo.md 2 ●●●●● patch | view | raw | blame | history
layouts/_default/baseof.html 2 ●●●●● patch | view | raw | blame | history
CONTRIBUTORS.md
@@ -26,3 +26,4 @@
- [Martin Kiesel](https://github.com/Kyslik)
- [John Tobin](https://www.johntobin.ie/)
- [Thomas Nys](https://thomasnys.com)
- [Artem Khvastunov](https://artspb.me)
archetypes/posts.md
@@ -2,6 +2,7 @@
draft = true
date = {{ .Date }}
title = ""
description = ""
slug = "" 
tags = []
categories = []
exampleSite/content/posts/migrate-from-jekyll.md
@@ -1,6 +1,7 @@
+++ 
date = "2014-03-10"
title = "Migrate to Hugo from Jekyll"
description = "The post explains how to migrate from from Jekyll to Hugo."
+++
Table of Contents
exampleSite/content/posts/theme-demo.md
@@ -1,6 +1,8 @@
+++
date = "2017-01-08"
title = "Theme Demo"
description = "The post demonstrates features of the coder theme."
images = ["/images/N90.jpg"]
math = "true"
+++
layouts/_default/baseof.html
@@ -9,6 +9,8 @@
    {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
    {{ with .Site.Params.keywords }}<meta name="keywords" content="{{ . }}">{{ end }}
    {{ template "_internal/twitter_cards.html" . }}
    <base href="{{ .Permalink }}">
    <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>