Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exampleSite/config.toml4
-rw-r--r--exampleSite/content/blog/creating-a-new-theme.md1
-rw-r--r--exampleSite/static/img/twitter-default.pngbin0 -> 304053 bytes
-rw-r--r--layouts/partials/head.html8
4 files changed, 13 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 6653731..3a9f8fd 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -70,6 +70,10 @@ paginate = 10
defaultKeywords = ["devows", "hugo", "go"]
defaultDescription = "Site template made by devcows using hugo"
+ # Twitter
+ twitter = "GoHugoIO"
+ twitterImage = "img/twitter-default.png"
+
# Google Maps API key (if not set will default to not passing a key.)
googleMapsApiKey = "AIzaSyCFhtWLJcE30xOAjcbSFi-0fnoVmQZPb1Y"
diff --git a/exampleSite/content/blog/creating-a-new-theme.md b/exampleSite/content/blog/creating-a-new-theme.md
index 07f0145..799a813 100644
--- a/exampleSite/content/blog/creating-a-new-theme.md
+++ b/exampleSite/content/blog/creating-a-new-theme.md
@@ -3,6 +3,7 @@ title = "Creating a new theme"
date = "2015-06-24T13:50:46+02:00"
tags = ["theme"]
categories = ["starting"]
+description = "This tutorial will show you how to create a simple theme in Hugo. I assume that you are familiar with HTML, the bash command line, and that you are comfortable using Markdown to format content."
banner = "img/banners/banner-1.jpg"
+++
diff --git a/exampleSite/static/img/twitter-default.png b/exampleSite/static/img/twitter-default.png
new file mode 100644
index 0000000..5180bbb
--- /dev/null
+++ b/exampleSite/static/img/twitter-default.png
Binary files differ
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 4f0293a..756bf33 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -58,6 +58,14 @@
<link rel="alternate" href="{{ "/index.xml" | absURL }}" type="application/rss+xml" title="{{ .Site.Title }}">
+ <!-- Twitter Card meta tags -->
+ <meta name="twitter:card" content="summary_large_image">
+ <meta name="twitter:site" content="@{{ .Site.Params.twitter }}">
+ <meta name="twitter:title" content="{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}">
+ {{ if .Params.banner }}<meta name="twitter:image" content="{{ .Params.banner | absURL }}">
+ {{ else }}<meta name="twitter:image" content="{{ .Site.Params.twitterImage | absURL }}">
+ {{ end }}<meta name="twitter:description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.defaultDescription }}{{ end }}">
+
<!-- Facebook OpenGraph tags -->
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:type" content="website" />