Merge pull request #50 from prodingerd/patch-1
Add support for Google Analytics and SEO
This commit is contained in:
commit
5ba410e27a
5 changed files with 18 additions and 11 deletions
|
@ -4,6 +4,9 @@ description: "Minimal Jekyll theme for storytellers"
|
||||||
baseurl: "/tale"
|
baseurl: "/tale"
|
||||||
url: "https://chesterhow.github.io"
|
url: "https://chesterhow.github.io"
|
||||||
|
|
||||||
|
# Google Analytics
|
||||||
|
google_analytics: UA—XXXXXXXX-X
|
||||||
|
|
||||||
# Author
|
# Author
|
||||||
author:
|
author:
|
||||||
name: Chester How
|
name: Chester How
|
||||||
|
@ -24,6 +27,7 @@ sass:
|
||||||
plugins:
|
plugins:
|
||||||
- jekyll-feed
|
- jekyll-feed
|
||||||
- jekyll-paginate
|
- jekyll-paginate
|
||||||
|
- jekyll-seo-tag
|
||||||
# - jemoji #Uncomment this to allow emoji in your post
|
# - jemoji #Uncomment this to allow emoji in your post
|
||||||
|
|
||||||
# Permalinks
|
# Permalinks
|
||||||
|
|
6
_includes/analytics.html
Normal file
6
_includes/analytics.html
Normal file
|
@ -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>
|
|
@ -1,17 +1,8 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
{% if page.title == "Home" %}
|
|
||||||
<meta name="description" content="{{ site.description }}">
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<title>
|
{% seo %}
|
||||||
{% if page.title == "Home" %}
|
|
||||||
{{ site.title }}
|
|
||||||
{% else %}
|
|
||||||
{{ page.title }} · {{ site.title }}
|
|
||||||
{% endif %}
|
|
||||||
</title>
|
|
||||||
|
|
||||||
<!-- CSS -->
|
<!-- CSS -->
|
||||||
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
|
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
|
||||||
|
@ -24,4 +15,9 @@
|
||||||
|
|
||||||
<!-- RSS -->
|
<!-- RSS -->
|
||||||
{% feed_meta %}
|
{% feed_meta %}
|
||||||
|
|
||||||
|
<!-- Google Analytics-->
|
||||||
|
{% if site.google_analytics and jekyll.environment == 'production' %}
|
||||||
|
{% include analytics.html %}
|
||||||
|
{% endif %}
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
|
||||||
spec.add_runtime_dependency "jekyll", "~> 3.6"
|
spec.add_runtime_dependency "jekyll", "~> 3.6"
|
||||||
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
|
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
|
||||||
spec.add_runtime_dependency "jekyll-feed", "~> 0.10.0"
|
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 "bundler", "~> 1.12"
|
||||||
spec.add_development_dependency "rake", "~> 10.0"
|
spec.add_development_dependency "rake", "~> 10.0"
|
||||||
|
|
Loading…
Reference in a new issue