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
require 'rubygems' | |
require 'faraday' | |
require 'json' | |
require 'ttfunk' | |
WEBFONTS_URL = 'https://www.googleapis.com/webfonts/v1/webfonts' | |
API_KEY = '' # You need an API key that has the WebFonts API enabled | |
CHARACTER_CODE = 8378 # '₺'.unpack('U*') |
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
--- redirect.rb 2012-04-09 11:58:39.905024214 +0300 | |
+++ redirect-pages.rb 2012-04-09 11:58:10.441025135 +0300 | |
@@ -15,9 +15,9 @@ | |
# find all posts with a redirect property and create a new page for each entry | |
def generate_redirects(site) | |
- site.posts.select{|x| x.data.key? 'redirects' }.each do |p| | |
+ (site.pages + site.posts).select{|x| x.data.key? 'redirects' }.each do |p| | |
p.data['redirects'].each do |r| | |
- redirect = RedirectPage.new(site, site.source, r, p.id) |