diff options
Diffstat (limited to '')
-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/sass/screen.scss | 1 | ||||
-rw-r--r-- | .themes/classic/source/_includes/post/sharing.html | 2 | ||||
-rw-r--r-- | .themes/classic/source/_includes/twitter_sharing.html | 2 | ||||
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | Gemfile | 4 | ||||
-rw-r--r-- | Gemfile.lock | 10 | ||||
-rw-r--r-- | README.markdown | 1 | ||||
-rw-r--r-- | Rakefile | 37 | ||||
-rw-r--r-- | config.rb | 1 | ||||
-rw-r--r-- | plugins/gist_tag.rb | 2 | ||||
-rw-r--r-- | plugins/jsfiddle.rb | 2 | ||||
-rw-r--r-- | plugins/pygments_code.rb | 4 |
15 files changed, 46 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 1a43a03d..20dcd24e 100644 --- a/.themes/classic/sass/base/_theme.scss +++ b/.themes/classic/sass/base/_theme.scss @@ -1,5 +1,5 @@ $noise-bg: image-url('noise.png') top left !default; -$img-border: inline-image('dotted-border.png'); +$img-border: inline-image('dotted-border.png') !default; // Main Link Colors $link-color: lighten(#165b94, 3) !default; diff --git a/.themes/classic/sass/screen.scss b/.themes/classic/sass/screen.scss index 155e81e9..75eac0a2 100644 --- a/.themes/classic/sass/screen.scss +++ b/.themes/classic/sass/screen.scss @@ -1,6 +1,5 @@ @import "compass"; @include global-reset; -@include reset-html5; @import "custom/colors"; @import "custom/fonts"; diff --git a/.themes/classic/source/_includes/post/sharing.html b/.themes/classic/source/_includes/post/sharing.html index e32500d0..d639faa1 100644 --- a/.themes/classic/source/_includes/post/sharing.html +++ b/.themes/classic/source/_includes/post/sharing.html @@ -1,6 +1,6 @@ <div class="sharing"> {% if site.twitter_tweet_button %} - <a href="http://twitter.com/share" class="twitter-share-button" data-url="{{ site.url }}{{ page.url }}" data-via="{{ site.twitter_user }}" data-counturl="{{ site.url }}{{ page.url }}" >Tweet</a> + <a href="//twitter.com/share" class="twitter-share-button" data-url="{{ site.url }}{{ page.url }}" data-via="{{ site.twitter_user }}" data-counturl="{{ site.url }}{{ page.url }}" >Tweet</a> {% endif %} {% if site.google_plus_one %} <div class="g-plusone" data-size="{{ site.google_plus_one_size }}"></div> diff --git a/.themes/classic/source/_includes/twitter_sharing.html b/.themes/classic/source/_includes/twitter_sharing.html index 687e77de..7cd5fbc2 100644 --- a/.themes/classic/source/_includes/twitter_sharing.html +++ b/.themes/classic/source/_includes/twitter_sharing.html @@ -4,7 +4,7 @@ var twitterWidgets = document.createElement('script'); twitterWidgets.type = 'text/javascript'; twitterWidgets.async = true; - twitterWidgets.src = 'http://platform.twitter.com/widgets.js'; + twitterWidgets.src = '//platform.twitter.com/widgets.js'; document.getElementsByTagName('head')[0].appendChild(twitterWidgets); })(); </script> diff --git a/.travis.yml b/.travis.yml index 36f48d8f..b2024911 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: ruby rvm: + - 2.0.0 - 1.9.3 - - 1.9.2 script: bundle exec rake install; bundle exec rake generate @@ -1,4 +1,4 @@ -source "http://rubygems.org" +source "https://rubygems.org" group :development do gem 'rake', '~> 0.9' @@ -8,11 +8,13 @@ group :development do gem 'RedCloth', '~> 4.2.9' gem 'haml', '~> 3.1.7' gem 'compass', '~> 0.12.2' + gem 'sass', '~> 3.2' gem 'sass-globbing', '~> 1.0.0' gem 'rubypants', '~> 0.2.0' 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 82c5dcf9..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) @@ -33,9 +33,9 @@ GEM rack rake (0.9.2.2) rb-fsevent (0.9.1) - rdiscount (1.6.8) + rdiscount (2.0.7.3) rubypants (0.2.0) - sass (3.1.20) + sass (3.2.9) sass-globbing (1.0.0) sass (>= 3.1) sinatra (1.4.2) @@ -53,14 +53,16 @@ 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) pygments.rb (~> 0.3.4) rake (~> 0.9) rb-fsevent (~> 0.9) - rdiscount (~> 1.6.8) + rdiscount (~> 2.0.7) rubypants (~> 0.2.0) + sass (~> 3.2) sass-globbing (~> 1.0.0) sinatra (~> 1.4.2) stringex (~> 1.4.0) diff --git a/README.markdown b/README.markdown index 95b3843f..eea8624e 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 @@ -247,18 +247,21 @@ end desc "deploy public directory to github pages" multitask :push do puts "## Deploying branch to Github Pages " + puts "## Pulling any updates from Github Pages " + cd "#{deploy_dir}" do + system "git pull" + end (Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) } Rake::Task[:copydot].invoke(public_dir, deploy_dir) - puts "\n## copying #{public_dir} to #{deploy_dir}" + puts "\n## Copying #{public_dir} to #{deploy_dir}" cp_r "#{public_dir}/.", deploy_dir cd "#{deploy_dir}" do - system "git add ." - system "git add -u" + system "git add -A" puts "\n## Commiting: Site updated at #{Time.now.utc}" message = "Site updated at #{Time.now.utc}" system "git commit -m \"#{message}\"" puts "\n## Pushing generated #{deploy_dir} website" - system "git push origin #{deploy_branch} --force" + system "git push origin #{deploy_branch}" puts "\n## Github Pages deploy complete" end end @@ -304,10 +307,16 @@ 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 - user = repo_url.match(/:([^\/]+)/)[1] + protocol = (repo_url.match(/(^git)@/).nil?) ? 'https' : 'git' + if protocol == 'git' + user = repo_url.match(/:([^\/]+)/)[1] + else + user = repo_url.match(/github\.com\/([^\/]+)/)[1] + end branch = (repo_url.match(/\/[\w-]+\.github\.(?:io|com)/).nil?) ? 'gh-pages' : 'master' project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : '' unless (`git remote -v` =~ /origin.+?octopress(?:\.git)?/).nil? @@ -328,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 @@ -351,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) @@ -376,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(', ')}" @@ -6,6 +6,7 @@ project_type = :stand_alone # Publishing paths http_path = "/" http_images_path = "/images" +http_generated_images_path = "/images" http_fonts_path = "/fonts" css_dir = "public/stylesheets" diff --git a/plugins/gist_tag.rb b/plugins/gist_tag.rb index 2549ea7a..16203450 100644 --- a/plugins/gist_tag.rb +++ b/plugins/gist_tag.rb @@ -21,7 +21,7 @@ module Jekyll end def render(context) - if parts = @text.match(/([\d]*) (.*)/) + if parts = @text.match(/([a-zA-Z\d]*) (.*)/) gist, file = parts[1].strip, parts[2].strip script_url = script_url_for gist, file code = get_cached_gist(gist, file) || get_gist_from_web(gist, file) diff --git a/plugins/jsfiddle.rb b/plugins/jsfiddle.rb index a80becb3..0046f9b5 100644 --- a/plugins/jsfiddle.rb +++ b/plugins/jsfiddle.rb @@ -18,7 +18,7 @@ module Jekyll class JsFiddle < Liquid::Tag def initialize(tag_name, markup, tokens) - if /(?<fiddle>\w+)(?:\s+(?<sequence>[\w,]+))?(?:\s+(?<skin>\w+))?(?:\s+(?<height>\w+))?(?:\s+(?<width>\w+))?/ =~ markup + if /(?<fiddle>\w+\/?\d?)(?:\s+(?<sequence>[\w,]+))?(?:\s+(?<skin>\w+))?(?:\s+(?<height>\w+))?(?:\s+(?<width>\w+))?/ =~ markup @fiddle = fiddle @sequence = (sequence unless sequence == 'default') || 'js,resources,html,css,result' @skin = (skin unless skin == 'default') || 'light' diff --git a/plugins/pygments_code.rb b/plugins/pygments_code.rb index 87d3cd6d..8b851a3b 100644 --- a/plugins/pygments_code.rb +++ b/plugins/pygments_code.rb @@ -22,14 +22,14 @@ module HighlightCode highlighted_code = File.read(path) else begin - highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'}) + highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8', :startinline => true}) rescue MentosError raise "Pygments can't parse unknown language: #{lang}." end File.open(path, 'w') {|f| f.print(highlighted_code) } end else - highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8'}) + highlighted_code = Pygments.highlight(code, :lexer => lang, :formatter => 'html', :options => {:encoding => 'utf-8', :startinline => true}) end highlighted_code end |