Update meta tags
This commit is contained in:
parent
79b208b204
commit
4fc101def2
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
type: article
|
||||
---
|
||||
{% include head.html %}
|
||||
{% include site-header.html %}
|
||||
|
|
|
@ -6,7 +6,7 @@ html_class: home
|
|||
|
||||
<div class='pages-list'>
|
||||
{% for page in site.pages %}
|
||||
<a href=".{{ page.url }}">
|
||||
<a href="{{base}}{{ page.url }}">
|
||||
<span class='title'>{{ page.title }}</span>
|
||||
<span class='date'>{{ page.url }}</span>
|
||||
</a>
|
||||
|
|
16
_config.yml
16
_config.yml
|
@ -11,14 +11,6 @@ kramdown:
|
|||
input: GFM
|
||||
hard_wrap: false
|
||||
parse_block_html: true
|
||||
use_coderay: true
|
||||
|
||||
coderay:
|
||||
coderay_line_numbers: nil
|
||||
coderay_line_numbers_start: 1
|
||||
coderay_tab_width: 4
|
||||
coderay_bold_every: 10
|
||||
coderay_css: class
|
||||
|
||||
defaults:
|
||||
- scope:
|
||||
|
@ -28,13 +20,9 @@ defaults:
|
|||
|
||||
# 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
|
||||
title: Cheatsheets
|
||||
|
||||
# Google analytics
|
||||
analytics:
|
||||
hostname: ricostacruz.com
|
||||
id: "UA-20473929-1"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="about-the-site">
|
||||
<div class="container">
|
||||
<p class='blurb'>
|
||||
<strong><a href="{{ site.url }}">Cheatsheets</a></strong> is a collection of cheatsheets I've written over the years.
|
||||
<strong><a href="{{ base }}">Cheatsheets</a></strong> is a collection of cheatsheets I've written over the years.
|
||||
Suggestions and corrections? <a href='https://github.com/rstacruz/cheatsheets/issues'>Send them in</a>.
|
||||
<i class='fleuron'></i>
|
||||
I'm <a href="http://ricostacruz.com">Rico Sta. Cruz</a>.
|
||||
|
|
|
@ -1,77 +1,9 @@
|
|||
<!doctype html>
|
||||
<html lang='en' class='{{ page.html_class }}'>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
|
||||
{% if page.title %}
|
||||
<title>{{ page.title }} — {{ site.meta.title }}</title>
|
||||
<meta content='{{ page.title }}' property='og:title'>
|
||||
<meta content='{{ page.title }}' property='twitter:title'>
|
||||
<meta content='article' property='og:type'>
|
||||
{% else %}
|
||||
<title>{{ site.meta.title }}</title>
|
||||
<meta content='{{ site.meta.title }}' property='og:title'>
|
||||
<meta content='{{ site.meta.title }}' property='twitter:title'>
|
||||
<meta content='blog' property='og:type'>
|
||||
{% endif %}
|
||||
|
||||
{% 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">
|
||||
{% endif %}
|
||||
|
||||
{% if page.url != '/index.html' %}
|
||||
<link rel="canonical" href="{{ site.meta.url }}{{ page.url }}">
|
||||
<meta name="og:url" content="{{ site.meta.url }}{{ page.url }}">
|
||||
<link rel="prefetch" href="{{ site.meta.url }}">
|
||||
<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 %}
|
||||
|
||||
{% include meta.html %}
|
||||
<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" />
|
||||
<link href="{{base}}/assets/style.css?t={{ site.time | date: "%Y%m%d%H%M%S" }}" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div class='all'>
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
<meta charset='utf-8'>
|
||||
|
||||
{%comment%}<!-- set the base -->{%endcomment%}
|
||||
{% assign base = '' %}
|
||||
{% assign depth = page.url | split: '/' | size | minus: 1 %}
|
||||
{% if depth == 1 %}{% assign base = '.' %}
|
||||
{% elsif depth == 2 %}{% assign base = '..' %}
|
||||
{% elsif depth == 3 %}{% assign base = '../..' %}
|
||||
{% elsif depth == 4 %}{% assign base = '../../..' %}{% endif %}
|
||||
{% assign timestamp = site.time | date: "%Y%m%d%H%M%S" %}
|
||||
|
||||
{%comment%}<!-- title -->{%endcomment%}
|
||||
{% if page.full_title %}
|
||||
<title>{{ page.full_title }}</title>
|
||||
<meta content='{{ page.full_title }}' property='og:title'>
|
||||
<meta content='{{ page.full_title }}' property='twitter:title'>
|
||||
<meta content='article' property='og:type'>
|
||||
{% elsif page.title %}
|
||||
<title>{{ page.title }} — {{ site.title }}</title>
|
||||
<meta content='{{ page.title }}' property='og:title'>
|
||||
<meta content='{{ page.title }}' property='twitter:title'>
|
||||
<meta content='{{ page.type | default: "article" }}' property='og:type'>
|
||||
{% else %}
|
||||
<title>{{ site.title }}</title>
|
||||
<meta content='{{ site.title }}' property='og:title'>
|
||||
<meta content='{{ site.title }}' property='twitter:title'>
|
||||
<meta content='{{ page.type | default: "website" }}' property='og:type'>
|
||||
{% endif %}
|
||||
|
||||
{%comment%}<!-- description -->{%endcomment%}
|
||||
{% if page.description %}
|
||||
<meta content="{{ page.description }}" name="description">
|
||||
<meta content="{{ page.description }}" property="og:description">
|
||||
{% endif %}
|
||||
|
||||
{%comment%}<!-- canonical URL -->{%endcomment%}
|
||||
{% if page.url != '/index.html' %}
|
||||
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
|
||||
<meta name="og:url" content="{{ site.url }}{{ page.url }}">
|
||||
<link rel="prefetch" href="{{ site.url }}">
|
||||
<link rel="prerender" href="{{ site.url }}">
|
||||
{% endif %}
|
||||
|
||||
{%comment%}<!-- author -->{%endcomment%}
|
||||
{% 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 %}
|
||||
|
||||
{%comment%}<!-- site name -->{%endcomment%}
|
||||
{% if site.title %}
|
||||
<meta content='{{ site.title }}' property='og:site_name'>
|
||||
{% endif %}
|
||||
|
||||
{%comment%}<!-- facebook -->{%endcomment%}
|
||||
{% 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 %}
|
||||
|
||||
{%comment%}<!-- page meta -->{%endcomment%}
|
||||
{% 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 %}
|
||||
|
||||
{%comment%}<!-- tags -->{%endcomment%}
|
||||
{% 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 %}
|
||||
|
||||
{%comment%}<!-- google analytics -->{%endcomment%}
|
||||
{% if site.analytics %}<script>if(~location.hostname.indexOf("{{site.analytics.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 %}
|
||||
|
||||
<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
|
||||
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
|
||||
<link href='{{ base }}/assets/favicon.png' rel='shortcut icon'>
|
|
@ -1,6 +1,6 @@
|
|||
<div class='site-header'>
|
||||
<div class='container'>
|
||||
This is <a href="."><em>{{ site.meta.name }}</em></a> — a collection of cheatsheets I've written.
|
||||
This is <a href="."><em>{{ site.title }}</em></a> — a collection of cheatsheets I've written.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
4
index.md
4
index.md
|
@ -1,4 +1,6 @@
|
|||
---
|
||||
title: Cheatsheets
|
||||
full_title: "Cheatsheets — for web development and more"
|
||||
description: "A collection of cheatsheets I've written."
|
||||
layout: home
|
||||
type: website
|
||||
---
|
||||
|
|
Loading…
Reference in New Issue