Analytics

This commit is contained in:
Rico Sta. Cruz 2015-03-11 19:01:04 +08:00
parent 1a6ffd5fc3
commit a840e46884
2 changed files with 46 additions and 6 deletions

View File

@ -25,10 +25,16 @@ defaults:
path: ""
values:
layout: "default"
# Site info
url: http://ricostacruz.com/cheatsheets
meta:
name: "Cheatsheets"
title: Cheatsheets
description: "A collection of cheatsheets I've written."
hostname: ricostacruz.com
author: Rico Sta. Cruz
url: http://ricostacruz.com/cheatsheets
# Google analytics
analytics:
id: "UA-20473929-1"

View File

@ -15,9 +15,9 @@
<meta content='blog' property='og:type'>
{% endif %}
{% if page.meta.description %}
<meta content="{{ page.meta.description }}" name="description">
<meta content="{{ page.meta.description }}" property="og:description">
{% if page.description %}
<meta content="{{ page.description }}" name="description">
<meta content="{{ page.description }}" property="og:description">
{% else if page.url == '/index.html' && site.meta.description %}
<meta content="{{ site.meta.description }}" name="description">
<meta content="{{ site.meta.description }}" property="og:description">
@ -30,14 +30,48 @@
<link rel="prerender" href="{{ site.meta.url }}">
{% endif %}
{% if page.author %}
{% for author in site.authors | where: "name", page.author %}
<meta content='{{ author.name }}' name='author'>
{% if author.ogp %}
<meta content='{{ author.ogp }}' property='article:author'>
{% endif %}
{% endfor %}
{% endif %}
{% if site.meta.title %}
<meta content='{{ site.meta.title }}' property='og:site_name'>
{% endif %}
{% if site.facebook.app_id %}
<meta content='{{ site.facebook.app_id }}' property='fb:app_id'>
{% endif %}
{% if site.facebook.admin %}
<meta content='{{ site.facebook.admin }}' property='fb:admins'>
{% endif %}
{% if page.date %}
<meta content='{{ page.date | date: "%Y-%m-%d" }}' property='article:published_date'>
{% endif %}
{% if page.image %}
<meta content='{{ page.image }}' property='og:image'>
<meta content='{{ page.image }}' name='twitter:image'>
{% endif %}
{% if page.tags[0] %}
<meta content='{{ page.tags[0] }}' property='article:section'>
{% endif %}
{% if page.tags %}
{% for tag in page.tags %}
<meta content='{{ tag }}' property='article:tag'>
{% endfor %}
{% endif %}
<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<link href='/favicon.png' rel='shortcut icon'>
{% if site.analytics %}<script>if(~location.hostname.indexOf("{{site.meta.hostname}}")){var _gaq=_gaq||[];_gaq.push(["_setAccount","{{ site.analytics.id }}"]);_gaq.push(["_trackPageview"]);(function(){var ga=document.createElement("script");ga.async=true;ga.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(ga,s)})()}</script>{% endif %}
<link href="http://ricostacruz.com/til/assets/style.css" rel="stylesheet" />
<link href="assets/style.css" rel="stylesheet" />
<link href="http://ricostacruz.com/til/assets/style.css?t={{ site.time | date: "%Y%m%d%H%M%S" }}" rel="stylesheet" />
<link href="assets/style.css?t={{ site.time | date: "%Y%m%d%H%M%S" }}" rel="stylesheet" />
</head>
<body>
<div class='all'>