Permalink
Browse files

Merge pull request #50 from prodingerd/patch-1

Add support for Google Analytics and SEO
  • Loading branch information...
chesterhow committed Oct 7, 2018
2 parents 8a6912e + d1659d0 commit 5ba410e27a2fdf6277b4b6a8c97b3b22e3e88c44
Showing with 18 additions and 11 deletions.
  1. +1 −1 Gemfile
  2. +4 −0 _config.yml
  3. +6 −0 _includes/analytics.html
  4. +6 −10 _includes/head.html
  5. +1 −0 tale.gemspec
View
@@ -1,4 +1,4 @@
# frozen_string_literal: true
source "https://rubygems.org"
gemspec
gemspec
View
@@ -4,6 +4,9 @@ description: "Minimal Jekyll theme for storytellers"
baseurl: "/tale"
url: "https://chesterhow.github.io"
# Google Analytics
google_analytics: UA—XXXXXXXX-X
# Author
author:
name: Chester How
@@ -24,6 +27,7 @@ sass:
plugins:
- jekyll-feed
- jekyll-paginate
- jekyll-seo-tag
# - jemoji #Uncomment this to allow emoji in your post
# Permalinks
View
@@ -0,0 +1,6 @@
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
View
@@ -1,17 +1,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if page.title == "Home" %}
<meta name="description" content="{{ site.description }}">
{% endif %}
<title>
{% if page.title == "Home" %}
{{ site.title }}
{% else %}
{{ page.title }} &middot; {{ site.title }}
{% endif %}
</title>
{% seo %}
<!-- CSS -->
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
@@ -24,4 +15,9 @@
<!-- RSS -->
{% feed_meta %}
<!-- Google Analytics-->
{% if site.google_analytics and jekyll.environment == 'production' %}
{% include analytics.html %}
{% endif %}
</head>
View
@@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "jekyll", "~> 3.6"
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
spec.add_runtime_dependency "jekyll-feed", "~> 0.10.0"
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.5.0"
spec.add_development_dependency "bundler", "~> 1.12"
spec.add_development_dependency "rake", "~> 10.0"

0 comments on commit 5ba410e

Please sign in to comment.