Move categories to _data/

This commit is contained in:
Rico Sta. Cruz 2017-09-04 09:59:06 +08:00
parent 25a20171c6
commit aa84c59dee
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
6 changed files with 10 additions and 49 deletions

View File

@ -1,6 +1,4 @@
#
# Jekyll configuration
#
whitelist:
- jekyll-redirect-from
@ -18,11 +16,8 @@ exclude:
- Gemfile.lock
- CNAME
- vendor
- _deprecated
#
# Markdown
#
highlighter: false
markdown: kramdown
@ -33,9 +28,7 @@ kramdown:
syntax_highlighter_opts:
disable: true
#
# Defaults
#
defaults:
- scope:
@ -54,47 +47,12 @@ defaults:
- elixir
- ruby
#
# Site info
#
url: http://ricostacruz.com/cheatsheets
title: Cheatsheets
#
# Google analytics
#
#
analytics:
hostname: ricostacruz.com
id: "UA-20473929-1"
#
# Categories
#
category_names:
- Ansible
- Apps
- CLI
- CSS
- Devops
- Elixir
- Git
- HTML
- JavaScript
- JavaScript libraries
- Jekyll
- Ledger
- Markup
- Node.js
- Rails
- React
- Ruby
- Ruby libraries
- Vim
- Fitness
- Others
# GitHub metadata
# https://help.github.com/articles/repository-metadata-on-github-pages/
repository: rstacruz/cheatsheets

0
_data/category.yml Normal file
View File

View File

@ -0,0 +1,3 @@
enabled: true
hostname: ricostacruz.com
id: "UA-20473929-1"

View File

@ -75,8 +75,8 @@
{% endif %}
{%comment%}<!-- tags -->{%endcomment%}
{% if page.tags[0] %}
<meta content='{{ page.tags[0] }}' property='article:section'>
{% if page.category %}
<meta content='{{ page.category }}' property='article:section'>
{% endif %}
{% if page.tags %}
{% for tag in page.tags %}
@ -85,7 +85,7 @@
{% 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 %}
{% if site.data.google_analytics.enabled %}<script>if(~location.hostname.indexOf("{{site.data.google_analytics.hostname}}")){var _gaq=_gaq||[];_gaq.push(["_setAccount","{{ site.data.google_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' http-equiv='X-UA-Compatible'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>

View File

@ -43,7 +43,7 @@ type: website
{% endif %}
{% endfor %}
{% for category in site.category_names %}
{% for category in site.data.category.names %}
<h2 class='category item' id='{{ category | downcase | replace: " ", "-" }}' data-js-searchable-header>
<span>{{ category }}</span>
</h2>

View File

@ -4,7 +4,7 @@ html_class: home
{% include head.html %}
{% include site-header.html %}
{% for category in site.category_names %}
{% for category in site.data.category.names %}
<div class='pages-header'>
<h2 id='{{ category | downcase | replace: " ", "-" }}'>{{ category }}</h2>
</div>