diff options
Diffstat (limited to '')
-rw-r--r-- | .editorconfig | 22 | ||||
-rw-r--r-- | .themes/classic/.editorconfig | 44 | ||||
-rw-r--r-- | .themes/classic/sass/base/_typography.scss | 1 | ||||
-rw-r--r-- | .themes/classic/source/_includes/head.html | 6 | ||||
-rw-r--r-- | .themes/classic/source/javascripts/github.js | 10 | ||||
-rw-r--r-- | .themes/classic/source/javascripts/octopress.js | 1 | ||||
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Gemfile.lock | 10 | ||||
-rw-r--r-- | README.markdown | 2 | ||||
-rw-r--r-- | plugins/category_generator.rb | 6 | ||||
-rw-r--r-- | plugins/gist_tag.rb | 3 | ||||
-rw-r--r-- | plugins/pygments_code.rb | 6 |
12 files changed, 91 insertions, 22 deletions
diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..d359ca6f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://EditorConfig.org + +root = true + +; Use 2 spaces for indentation in all Ruby files + +[*.rb] +indent_style = space +indent_size = 2 + +[Rakefile] +indent_style = space +indent_size = 2 + +[Gemfile*] +indent_style = space +indent_size = 2 + +[config.ru] +indent_style = space +indent_size = 2 diff --git a/.themes/classic/.editorconfig b/.themes/classic/.editorconfig new file mode 100644 index 00000000..940fea3e --- /dev/null +++ b/.themes/classic/.editorconfig @@ -0,0 +1,44 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://EditorConfig.org + + +; Use 2 spaces for indentation in SCSS, JavaScript, HTML, and XML + +[*.scss] +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 + +[*.html] +indent_style = space +indent_size = 2 + +[*.xml] +indent_style = space +indent_size = 2 + + +; Use 4 spaces for indentation in Markdown files + +[*.md] +indent_style = space +indent_size = 4 + +[*.markdown] +indent_style = space +indent_size = 4 + + +; Override default indentation for some library files + +[jwplayer/glow/glow.xml] +indent_style = tab + +[libs/jXHR.js] +indent_style = tab + +[libs/swfobject-dynamic.js] +indent_style = tab diff --git a/.themes/classic/sass/base/_typography.scss b/.themes/classic/sass/base/_typography.scss index b68753fa..e9b6b19a 100644 --- a/.themes/classic/sass/base/_typography.scss +++ b/.themes/classic/sass/base/_typography.scss @@ -73,6 +73,7 @@ ol { list-style-type: decimal; ol { list-style-type: lower-roman; margin-bottom: 0px; }}} ul, ol { &, ul, ol { margin-left: 1.3em; }} +ul, ol { ul, ol { margin-bottom: 0em; }} strong { font-weight: bold; } diff --git a/.themes/classic/source/_includes/head.html b/.themes/classic/source/_includes/head.html index d7abd6fd..8de6679f 100644 --- a/.themes/classic/source/_includes/head.html +++ b/.themes/classic/source/_includes/head.html @@ -16,14 +16,14 @@ <meta name="MobileOptimized" content="320"> <meta name="viewport" content="width=device-width, initial-scale=1"> - {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %} + {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{% if page.url contains site.category_dir %}/{% endif %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %} <link rel="canonical" href="{{ canonical }}"> <link href="{{ root_url }}/favicon.png" rel="icon"> <link href="{{ root_url }}/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css"> + <link href="{{ site.subscribe_rss }}" rel="alternate" title="{{site.title}}" type="application/atom+xml"> + {% include custom/head.html %} <script src="{{ root_url }}/javascripts/modernizr-2.0.js"></script> <script src="{{ root_url }}/javascripts/ender.js"></script> <script src="{{ root_url }}/javascripts/octopress.js" type="text/javascript"></script> - <link href="{{ site.subscribe_rss }}" rel="alternate" title="{{site.title}}" type="application/atom+xml"> - {% include custom/head.html %} {% include google_analytics.html %} </head> diff --git a/.themes/classic/source/javascripts/github.js b/.themes/classic/source/javascripts/github.js index 27a5a235..6cfc0b0b 100644 --- a/.themes/classic/source/javascripts/github.js +++ b/.themes/classic/source/javascripts/github.js @@ -13,7 +13,7 @@ var github = (function(){ return { showRepos: function(options){ $.ajax({ - url: "https://api.github.com/users/"+options.user+"/repos?callback=?" + url: "https://api.github.com/users/"+options.user+"/repos?sort=pushed&callback=?" , type: 'jsonp' , error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); } , success: function(data) { @@ -23,14 +23,6 @@ var github = (function(){ if (options.skip_forks && data.data[i].fork) { continue; } repos.push(data.data[i]); } - repos.sort(function(a, b) { - var aDate = new Date(a.pushed_at).valueOf(), - bDate = new Date(b.pushed_at).valueOf(); - - if (aDate === bDate) { return 0; } - return aDate > bDate ? -1 : 1; - }); - if (options.count) { repos.splice(options.count); } render(options.target, repos); } diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index 379e6630..775fd335 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -11,6 +11,7 @@ function getNav() { mobileNav.children('select').bind('change', function(event) { if (event.target.value) { window.location.href = event.target.value; } }); + mobileNav.children('select').val(''); } function addSidebarToggler() { @@ -15,4 +15,4 @@ group :development do gem 'liquid', '~> 2.3.0' end -gem 'sinatra', '~> 1.3.3' +gem 'sinatra', '~> 1.3.5' diff --git a/Gemfile.lock b/Gemfile.lock index c235b2cb..d5bc6224 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,7 +28,7 @@ GEM pygments.rb (0.3.4) posix-spawn (~> 0.3.6) yajl-ruby (~> 1.1.0) - rack (1.4.1) + rack (1.4.5) rack-protection (1.3.2) rack rake (0.9.2.2) @@ -36,9 +36,9 @@ GEM rdiscount (1.6.8) rubypants (0.2.0) sass (3.1.20) - sinatra (1.3.3) - rack (~> 1.3, >= 1.3.6) - rack-protection (~> 1.2) + sinatra (1.3.5) + rack (~> 1.4) + rack-protection (~> 1.3) tilt (~> 1.3, >= 1.3.3) stringex (1.4.0) syntax (1.0.0) @@ -60,5 +60,5 @@ DEPENDENCIES rb-fsevent (~> 0.9) rdiscount (~> 1.6.8) rubypants (~> 0.2.0) - sinatra (~> 1.3.3) + sinatra (~> 1.3.5) stringex (~> 1.4.0) diff --git a/README.markdown b/README.markdown index 88addfb3..f9289754 100644 --- a/README.markdown +++ b/README.markdown @@ -24,7 +24,7 @@ We love to see people contributing to Octopress, whether it's a bug report, feat ## License (The MIT License) -Copyright © 2009-2011 Brandon Mathis +Copyright © 2009-2013 Brandon Mathis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/plugins/category_generator.rb b/plugins/category_generator.rb index d4840a8d..a49c4296 100644 --- a/plugins/category_generator.rb +++ b/plugins/category_generator.rb @@ -19,6 +19,8 @@ # - category_title_prefix: The string used before the category name in the page title (default is # 'Category: '). +require 'stringex' + module Jekyll # The CategoryIndex class creates a single category page for the specified category. @@ -106,7 +108,7 @@ module Jekyll if self.layouts.key? 'category_index' dir = self.config['category_dir'] || 'categories' self.categories.keys.each do |category| - self.write_category_index(File.join(dir, category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase), category) + self.write_category_index(File.join(dir, category.to_url), category) end # Throw an exception if the layout couldn't be found. @@ -171,7 +173,7 @@ ERR # def category_link(category) dir = @context.registers[:site].config['category_dir'] - "<a class='category' href='/#{dir}/#{category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase}/'>#{category}</a>" + "<a class='category' href='/#{dir}/#{category.to_url}/'>#{category}</a>" end # Outputs the post.date as formatted html, with hooks for CSS styling. diff --git a/plugins/gist_tag.rb b/plugins/gist_tag.rb index 5f590e96..2549ea7a 100644 --- a/plugins/gist_tag.rb +++ b/plugins/gist_tag.rb @@ -84,6 +84,9 @@ module Jekyll https.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new raw_uri.request_uri data = https.request request + if data.code.to_i != 200 + raise RuntimeError, "Gist replied with #{data.code} for #{gist_url}" + end data = data.body cache gist, file, data unless @cache_disabled data diff --git a/plugins/pygments_code.rb b/plugins/pygments_code.rb index 1676a3e0..87d3cd6d 100644 --- a/plugins/pygments_code.rb +++ b/plugins/pygments_code.rb @@ -21,7 +21,11 @@ module HighlightCode if File.exist?(path) highlighted_code = File.read(path) else - highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'}) + begin + highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'}) + rescue MentosError + raise "Pygments can't parse unknown language: #{lang}." + end File.open(path, 'w') {|f| f.print(highlighted_code) } end else |