forked from home-assistant/home-assistant.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned out public from repository, updated gitignore, added syntax
highlighting tests, improved syntax highlighting and styling of pre blocks. Overriding dynamic gist styling. Added a plugin for pygments caching which should speed things up terrifically. added ender.js as a lightweight way of scripting the DOM, events, etc. Some general typography and semantic html improvements.
- Loading branch information
Showing
74 changed files
with
6,017 additions
and
1,991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
guard 'livereload', :api_version => '1.6' do | ||
watch(/public\/stylesheets\/(.*)\.css/); | ||
watch(/public\/(.*)\.(js|html|png|jpg|gif|jpeg|ttf|otf|woff|svg)/i); | ||
watch(/public\/\S[css|js|html|png|jpg|gif]/) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
source: source | ||
destination: public | ||
markdown: rdiscount | ||
pygments: false | ||
permalink: pretty | ||
pygments: true | ||
|
||
url: http://yoursite.com | ||
title: My Octopress Blog | ||
author: Your Name | ||
email: [email protected] #Add your email (optional) for the atom feed | ||
simple_search: http://google.com/search | ||
|
||
recent_posts: 10 | ||
recent_posts: 20 | ||
|
||
twitter_user: imathis | ||
tweet_count: 3 | ||
|
@@ -19,9 +18,8 @@ show_replies: false | |
delicious_user: | ||
delicious_count: 3 | ||
|
||
pinboard_user: designenthusiast | ||
pinboard_user: imathis | ||
pinboard_count: 3 | ||
|
||
disqus_short_name: imathis | ||
|
||
#disqus_short_name: designenthusiast | ||
google_analytics_tracking_id: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# | ||
# Author: Josediaz Gonzalez - https://github.com/josegonzalez | ||
# Source URL: https://github.com/josegonzalez/josediazgonzalez.com/blob/master/_plugins/blockquote.rb | ||
# Modified by Brandon Mathis | ||
# | ||
require './_plugins/titlecase.rb' | ||
module Jekyll | ||
|
||
# Outputs a string with a given attribution as a quote | ||
# | ||
# {% blockquote John Paul Jones %} | ||
# Monkeys! | ||
# {% endblockquote %} | ||
# ... | ||
# <blockquote> | ||
# Monkeys! | ||
# <br /> | ||
# John Paul Jones | ||
# </blockquote> | ||
# | ||
class Blockquote < Liquid::Block | ||
FullCiteWithTitle = /([\w\s]+)(https?:\/\/)(\S+\s)([\w\s]+)/i | ||
FullCite = /([\w\s]+)(https?:\/\/)(\S+)/i | ||
Author = /([\w\s]+)/ | ||
|
||
def initialize(tag_name, markup, tokens) | ||
@by = nil | ||
@source = nil | ||
@title = nil | ||
if markup =~ FullCiteWithTitle | ||
@by = $1 | ||
@source = $2 + $3 | ||
@title = $4.titlecase | ||
elsif markup =~ FullCite | ||
@by = $1 | ||
@source = $2 + $3 | ||
elsif markup =~ Author | ||
@by = $1 | ||
end | ||
super | ||
end | ||
|
||
def render(context) | ||
output = super | ||
if @by.nil? | ||
'<blockquote><p>' + output.join + '</p></blockquote>' | ||
elsif !@title.nil? | ||
'<blockquote><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong>' + '<a class="source" href="' + @source + '">' + @title + '</a></cite></p>' | ||
elsif !@source.nil? | ||
'<blockquote><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong>' + '<a class="source" href="' + @source + '">source</a></cite></p>' | ||
else | ||
'<blockquote><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong></cite></p>' | ||
end | ||
end | ||
end | ||
|
||
# Outputs a string with a given attribution as a pullquote | ||
# | ||
# {% blockquote John Paul Jones %} | ||
# Monkeys! | ||
# {% endblockquote %} | ||
# ... | ||
# <blockquote class="pullquote"> | ||
# Monkeys! | ||
# <br /> | ||
# John Paul Jones | ||
# </blockquote> | ||
# | ||
class Pullquote < Liquid::Block | ||
FullCiteWithTitle = /([\w\s]+)(http:\/\/|https:\/\/)(\S+)([\w\s]+)/i | ||
FullCite = /([\w\s]+)(http:\/\/|https:\/\/)(\S+)/i | ||
Author = /([\w\s]+)/ | ||
|
||
def initialize(tag_name, markup, tokens) | ||
@by = nil | ||
@source = nil | ||
@title = nil | ||
if markup =~ FullCiteWithTitle | ||
@by = $1 | ||
@source = $2 + $3 | ||
@title = $4 | ||
elsif markup =~ FullCite | ||
@by = $1 | ||
@source = $2 + $3 | ||
elsif markup =~ Author | ||
@by = $1 | ||
end | ||
super | ||
end | ||
|
||
def render(context) | ||
output = super | ||
if @by.nil? | ||
'<blockquote class="pullquote"><p>' + output.join + '</p></blockquote>' | ||
elsif @title | ||
'<blockquote class="pullquote"><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong>' + ' <a class="source" href="' + @source + '">' + @title + '</a></cite></p>' | ||
elsif @source | ||
'<blockquote class="pullquote"><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong>' + ' <a class="source" href="' + @source + '">source</a></cite></p>' | ||
elsif @by | ||
'<blockquote class="pullquote"><p>' + output.join + '</p></blockquote>' + '<p><cite><strong>' + @by + '</strong></cite></p>' | ||
end | ||
end | ||
end | ||
end | ||
|
||
Liquid::Template.register_tag('blockquote', Jekyll::Blockquote) | ||
Liquid::Template.register_tag('pullquote', Jekyll::Pullquote) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
module Jekyll | ||
|
||
class CategoryIndex < Page | ||
def initialize(site, base, dir, category) | ||
@site = site | ||
@base = base | ||
@dir = dir | ||
@name = 'index.html' | ||
|
||
self.process(@name) | ||
self.read_yaml(File.join(base, '_layouts'), 'category_index.html') | ||
self.data['category'] = category | ||
|
||
category_title_prefix = site.config['category_title_prefix'] || 'Category: ' | ||
self.data['title'] = "#{category_title_prefix}#{category}" | ||
end | ||
end | ||
|
||
class CategoryList < Page | ||
def initialize(site, base, dir, categories) | ||
@site = site | ||
@base = base | ||
@dir = dir | ||
@name = 'index.html' | ||
|
||
self.process(@name) | ||
self.read_yaml(File.join(base, '_layouts'), 'category_list.html') | ||
self.data['categories'] = categories | ||
end | ||
end | ||
|
||
class CategoryGenerator < Generator | ||
safe true | ||
|
||
def generate(site) | ||
if site.layouts.key? 'category_index' | ||
dir = site.config['category_dir'] || 'categories' | ||
site.categories.keys.each do |category| | ||
write_category_index(site, File.join(dir, category.gsub(/\s/, "-").gsub(/[^\w-]/, '').downcase), category) | ||
end | ||
end | ||
|
||
if site.layouts.key? 'category_list' | ||
dir = site.config['category_dir'] || 'categories' | ||
write_category_list(site, dir, site.categories.keys.sort) | ||
end | ||
end | ||
|
||
def write_category_index(site, dir, category) | ||
index = CategoryIndex.new(site, site.source, dir, category) | ||
index.render(site.layouts, site.site_payload) | ||
index.write(site.dest) | ||
site.static_files << index | ||
end | ||
|
||
def write_category_list(site, dir, categories) | ||
index = CategoryList.new(site, site.source, dir, categories) | ||
index.render(site.layouts, site.site_payload) | ||
index.write(site.dest) | ||
site.static_files << index | ||
end | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
## | ||
## Author: Jose Gonzalez - https://github.com/josegonzalez | ||
## Source URL: https://github.com/josegonzalez/josediazgonzalez.com/blob/master/_plugins/iterator.rb | ||
## | ||
|
||
#module Jekyll | ||
#class Site | ||
#alias_method :orig_site_payload, :site_payload | ||
|
||
## Constuct an array of hashes that will allow the user, using Liquid, to | ||
## iterate through the keys of _kv_hash_ and be able to iterate through the | ||
## elements under each key. | ||
## | ||
## Example: | ||
## categories = { 'Ruby' => [<Post>, <Post>] } | ||
## make_iterable(categories, :index => 'name', :items => 'posts') | ||
## Will allow the user to iterate through all categories and then iterate | ||
## though each post in the current category like so: | ||
## {% for category in site.categories %} | ||
## h1. {{ category.name }} | ||
## <ul> | ||
## {% for post in category.posts %} | ||
## <li>{{ post.title }}</li> | ||
## {% endfor %} | ||
## </ul> | ||
## {% endfor %} | ||
## | ||
## Returns [ {<index> => <kv_hash_key>, <items> => kv_hash[<kv_hash_key>]}, ... ] | ||
|
||
#def make_iterable(kv_hash, options) | ||
#options = {:index => 'name', :items => 'items'}.merge(options) | ||
#result = [] | ||
#kv_hash.sort.each do |key, value| | ||
#result << { options[:index] => key, options[:items] => value } | ||
#end | ||
#result | ||
#end | ||
|
||
#def site_payload | ||
#payload = orig_site_payload | ||
#payload['site']['iterable'].merge!({ | ||
#'categories' => make_iterable(self.categories, :index => 'name', :items => 'posts'), | ||
#'tags' => make_iterable(self.tags, :index => 'name', :items => 'posts') | ||
#}) | ||
#payload | ||
#end | ||
|
||
#end | ||
#end |
Oops, something went wrong.