diff options
-rw-r--r-- | .rbenv-version | 1 | ||||
-rw-r--r-- | .rvmrc | 1 | ||||
-rw-r--r-- | .themes/classic/sass/base/_theme.scss | 2 | ||||
-rw-r--r-- | .themes/classic/source/_includes/article.html | 3 | ||||
-rw-r--r-- | .themes/classic/source/_includes/disqus.html | 2 | ||||
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | Gemfile.lock | 3 | ||||
-rw-r--r-- | README.markdown | 3 | ||||
-rw-r--r-- | Rakefile | 20 | ||||
-rw-r--r-- | plugins/category_generator.rb | 3 | ||||
-rw-r--r-- | plugins/code_block.rb | 2 | ||||
-rw-r--r-- | plugins/gist_tag.rb | 35 | ||||
-rw-r--r-- | plugins/include_code.rb | 2 |
13 files changed, 52 insertions, 26 deletions
diff --git a/.rbenv-version b/.rbenv-version deleted file mode 100644 index f3a9c9a8..00000000 --- a/.rbenv-version +++ /dev/null @@ -1 +0,0 @@ -1.9.3-p194 diff --git a/.rvmrc b/.rvmrc deleted file mode 100644 index 08dd0a78..00000000 --- a/.rvmrc +++ /dev/null @@ -1 +0,0 @@ -rvm use 1.9.3 diff --git a/.themes/classic/sass/base/_theme.scss b/.themes/classic/sass/base/_theme.scss index 20dcd24e..c35136d5 100644 --- a/.themes/classic/sass/base/_theme.scss +++ b/.themes/classic/sass/base/_theme.scss @@ -36,7 +36,7 @@ $nav-border-right: lighten($nav-bg, 7) !default; /* Sidebar colors */ $sidebar-bg: #f2f2f2 !default; -$sidebar-link-color: $link-color !default; +$sidebar-link-color: $text-color !default; $sidebar-link-color-hover: $link-color-hover !default; $sidebar-link-color-active: $link-color-active !default; $sidebar-color: change-color(mix($text-color, $sidebar-bg, 80), $hue: hue($sidebar-bg), $saturation: saturation($sidebar-bg)/2) !default; diff --git a/.themes/classic/source/_includes/article.html b/.themes/classic/source/_includes/article.html index 23f48844..84279977 100644 --- a/.themes/classic/source/_includes/article.html +++ b/.themes/classic/source/_includes/article.html @@ -9,7 +9,8 @@ <p class="meta"> {% include post/date.html %}{{ time }} {% if site.disqus_short_name and page.comments != false and post.comments != false and site.disqus_show_comment_count == true %} - | <a href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#disqus_thread">Comments</a> + | <a href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#disqus_thread" + data-disqus-identifier="{% if post.meta.disqus_id %}{{ post.meta.disqus_id }}{% else %}{{ site.url }}{{ post.url }}{% endif %}">Comments</a> {% endif %} </p> {% endunless %} diff --git a/.themes/classic/source/_includes/disqus.html b/.themes/classic/source/_includes/disqus.html index eb308779..49c6a29c 100644 --- a/.themes/classic/source/_includes/disqus.html +++ b/.themes/classic/source/_includes/disqus.html @@ -14,7 +14,7 @@ {% endif %} (function () { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script; + dsq.src = '//' + disqus_shortname + '.disqus.com/' + disqus_script; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); }()); </script> @@ -14,6 +14,7 @@ group :development do gem 'rb-fsevent', '~> 0.9' gem 'stringex', '~> 1.4.0' gem 'liquid', '~> 2.3.0' + gem 'directory_watcher', '1.4.1' end gem 'sinatra', '~> 1.4.2' diff --git a/Gemfile.lock b/Gemfile.lock index 3ba43eff..182c30bc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,5 @@ GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: RedCloth (4.2.9) chunky_png (1.2.5) @@ -53,6 +53,7 @@ PLATFORMS DEPENDENCIES RedCloth (~> 4.2.9) compass (~> 0.12.2) + directory_watcher (= 1.4.1) haml (~> 3.1.7) jekyll (~> 0.12) liquid (~> 2.3.0) diff --git a/README.markdown b/README.markdown index 95b3843f..71370a7a 100644 --- a/README.markdown +++ b/README.markdown @@ -8,6 +8,7 @@ Octopress is [Jekyll](https://github.com/mojombo/jekyll) blogging at its finest. 4. **It's easy to use.** A collection of rake tasks simplifies development and makes deploying a cinch. 5. **Ships with great plug-ins** some original and others from the Jekyll community — tested and improved. +**Note**: Octopress requires a minimum Ruby version of `1.9.3-p0`. ## Documentation @@ -18,7 +19,7 @@ Check out [Octopress.org](http://octopress.org/docs) for guides and documentatio [![Build Status](https://travis-ci.org/imathis/octopress.png?branch=master)](https://travis-ci.org/imathis/octopress) -We love to see people contributing to Octopress, whether it's a bug report, feature suggestion or a pull request. At the moment, we try to keep the core slick and lean, focusing on basic blogging needs, so some of your suggestions might not find their way into Octopress. For those ideas, we started a [list of 3rd party plug-ins](https://github.com/imathis/octopress/wiki/3rd-party-plugins), where you can link your own Octopress plug-in repositories. For the future, we're thinking about ways to easier add them them into our main releases. +We love to see people contributing to Octopress, whether it's a bug report, feature suggestion or a pull request. At the moment, we try to keep the core slick and lean, focusing on basic blogging needs, so some of your suggestions might not find their way into Octopress. For those ideas, we started a [list of 3rd party plug-ins](https://github.com/imathis/octopress/wiki/3rd-party-plugins), where you can link your own Octopress plug-in repositories. For the future, we're thinking about ways to easier add them into our main releases. ## License @@ -108,7 +108,7 @@ task :new_post, :title do |t, args| post.puts "---" post.puts "layout: post" post.puts "title: \"#{title.gsub(/&/,'&')}\"" - post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}" + post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M:%S %z')}" post.puts "comments: true" post.puts "categories: " post.puts "---" @@ -307,7 +307,7 @@ task :setup_github_pages, :repo do |t, args| repo_url = args.repo else puts "Enter the read/write url for your repository" - puts "(For example, 'git@github.com:your_username/your_username.github.io)" + puts "(For example, 'git@github.com:your_username/your_username.github.io.git)" puts " or 'https://github.com/your_username/your_username.github.io')" repo_url = get_stdin("Repository url: ") end @@ -337,10 +337,8 @@ task :setup_github_pages, :repo do |t, args| end end end - url = "http://#{user}.github.io" - url += "/#{project}" unless project == '' jekyll_config = IO.read('_config.yml') - jekyll_config.sub!(/^url:.*$/, "url: #{url}") + jekyll_config.sub!(/^url:.*$/, "url: #{blog_url(user, project)}") File.open('_config.yml', 'w') do |f| f.write jekyll_config end @@ -360,7 +358,7 @@ task :setup_github_pages, :repo do |t, args| f.write rakefile end end - puts "\n---\n## Now you can deploy to #{url} with `rake deploy` ##" + puts "\n---\n## Now you can deploy to #{repo_url} with `rake deploy` ##" end def ok_failed(condition) @@ -385,6 +383,16 @@ def ask(message, valid_options) answer end +def blog_url(user, project) + url = if File.exists?('source/CNAME') + "http://#{IO.read('source/CNAME').strip}" + else + "http://#{user}.github.io" + end + url += "/#{project}" unless project == '' + url +end + desc "list tasks" task :list do puts "Tasks: #{(Rake::Task.tasks - [Rake::Task[:list]]).join(', ')}" diff --git a/plugins/category_generator.rb b/plugins/category_generator.rb index a49c4296..c55d62f4 100644 --- a/plugins/category_generator.rb +++ b/plugins/category_generator.rb @@ -119,7 +119,7 @@ module Jekyll =============================================== Error for category_generator.rb plugin ----------------------------------------------- - No 'category_index.hmtl' in source/_layouts/ + No 'category_index.html' in source/_layouts/ Perhaps you haven't installed a theme yet. =============================================== @@ -191,4 +191,3 @@ ERR end end - diff --git a/plugins/code_block.rb b/plugins/code_block.rb index c70e181e..46620d86 100644 --- a/plugins/code_block.rb +++ b/plugins/code_block.rb @@ -79,7 +79,7 @@ module Jekyll source = "<figure class='code'>" source += @caption if @caption if @filetype - source += " #{highlight(code, @filetype)}</figure>" + source += "#{highlight(code, @filetype)}</figure>" else source += "#{tableize_code(code.lstrip.rstrip.gsub(/</,'<'))}</figure>" end diff --git a/plugins/gist_tag.rb b/plugins/gist_tag.rb index 16203450..0828d270 100644 --- a/plugins/gist_tag.rb +++ b/plugins/gist_tag.rb @@ -46,7 +46,7 @@ module Jekyll end def get_gist_url_for(gist, file) - "https://raw.github.com/gist/#{gist}/#{file}" + "https://gist.github.com/raw/#{gist}/#{file}" end def cache(gist, file, data) @@ -71,8 +71,31 @@ module Jekyll end def get_gist_from_web(gist, file) - gist_url = get_gist_url_for gist, file - raw_uri = URI.parse gist_url + gist_url = get_gist_url_for(gist, file) + data = get_web_content(gist_url) + + if data.code.to_i == 302 + data = handle_gist_redirecting(data) + end + + if data.code.to_i != 200 + raise RuntimeError, "Gist replied with #{data.code} for #{gist_url}" + end + + cache(gist, file, data.body) unless @cache_disabled + data.body + end + + def handle_gist_redirecting(data) + redirected_url = data.header['Location'] + if redirected_url.nil? || redirected_url.empty? + raise ArgumentError, "GitHub replied with a 302 but didn't provide a location in the response headers." + end + get_web_content(redirected_url) + end + + def get_web_content(url) + raw_uri = URI.parse url proxy = ENV['http_proxy'] if proxy proxy_uri = URI.parse(proxy) @@ -84,12 +107,6 @@ 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 end end diff --git a/plugins/include_code.rb b/plugins/include_code.rb index 220466b6..41f30337 100644 --- a/plugins/include_code.rb +++ b/plugins/include_code.rb @@ -62,7 +62,7 @@ module Jekyll title = @title ? "#{@title} (#{file.basename})" : file.basename url = "/#{code_dir}/#{@file}" source = "<figure class='code'><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n" - source += " #{highlight(code, @filetype)}</figure>" + source += "#{highlight(code, @filetype)}</figure>" safe_wrap(source) end end |