This commit is contained in:
Alexandre Perrin 2013-09-27 10:53:43 +02:00
commit 8bfd5ef323
15 changed files with 46 additions and 26 deletions

View File

@ -1 +0,0 @@
1.9.3-p194

1
.rvmrc
View File

@ -1 +0,0 @@
rvm use 1.9.3

View File

@ -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;

View File

@ -1,6 +1,5 @@
@import "compass";
@include global-reset;
@include reset-html5;
@import "custom/colors";
@import "custom/fonts";

View File

@ -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>

View File

@ -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>

View File

@ -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

View File

@ -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'

View File

@ -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)

View File

@ -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 &mdash; tested and improved.
**Note**: Octopress requires a minimum Ruby version of `1.9.3-p0`.
## Documentation

View File

@ -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(', ')}"

View File

@ -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"

View File

@ -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)

View File

@ -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'

View File

@ -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