Merge branch 'master' of https://github.com/imathis/octopress
This commit is contained in:
commit
8bfd5ef323
@ -1 +0,0 @@
|
|||||||
1.9.3-p194
|
|
@ -1,5 +1,5 @@
|
|||||||
$noise-bg: image-url('noise.png') top left !default;
|
$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
|
// Main Link Colors
|
||||||
$link-color: lighten(#165b94, 3) !default;
|
$link-color: lighten(#165b94, 3) !default;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@import "compass";
|
@import "compass";
|
||||||
@include global-reset;
|
@include global-reset;
|
||||||
@include reset-html5;
|
|
||||||
|
|
||||||
@import "custom/colors";
|
@import "custom/colors";
|
||||||
@import "custom/fonts";
|
@import "custom/fonts";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div class="sharing">
|
<div class="sharing">
|
||||||
{% if site.twitter_tweet_button %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% if site.google_plus_one %}
|
{% if site.google_plus_one %}
|
||||||
<div class="g-plusone" data-size="{{ site.google_plus_one_size }}"></div>
|
<div class="g-plusone" data-size="{{ site.google_plus_one_size }}"></div>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
var twitterWidgets = document.createElement('script');
|
var twitterWidgets = document.createElement('script');
|
||||||
twitterWidgets.type = 'text/javascript';
|
twitterWidgets.type = 'text/javascript';
|
||||||
twitterWidgets.async = true;
|
twitterWidgets.async = true;
|
||||||
twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
|
twitterWidgets.src = '//platform.twitter.com/widgets.js';
|
||||||
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
|
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
language: ruby
|
language: ruby
|
||||||
rvm:
|
rvm:
|
||||||
|
- 2.0.0
|
||||||
- 1.9.3
|
- 1.9.3
|
||||||
- 1.9.2
|
|
||||||
script: bundle exec rake install; bundle exec rake generate
|
script: bundle exec rake install; bundle exec rake generate
|
||||||
|
4
Gemfile
4
Gemfile
@ -1,4 +1,4 @@
|
|||||||
source "http://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'rake', '~> 0.9'
|
gem 'rake', '~> 0.9'
|
||||||
@ -8,11 +8,13 @@ group :development do
|
|||||||
gem 'RedCloth', '~> 4.2.9'
|
gem 'RedCloth', '~> 4.2.9'
|
||||||
gem 'haml', '~> 3.1.7'
|
gem 'haml', '~> 3.1.7'
|
||||||
gem 'compass', '~> 0.12.2'
|
gem 'compass', '~> 0.12.2'
|
||||||
|
gem 'sass', '~> 3.2'
|
||||||
gem 'sass-globbing', '~> 1.0.0'
|
gem 'sass-globbing', '~> 1.0.0'
|
||||||
gem 'rubypants', '~> 0.2.0'
|
gem 'rubypants', '~> 0.2.0'
|
||||||
gem 'rb-fsevent', '~> 0.9'
|
gem 'rb-fsevent', '~> 0.9'
|
||||||
gem 'stringex', '~> 1.4.0'
|
gem 'stringex', '~> 1.4.0'
|
||||||
gem 'liquid', '~> 2.3.0'
|
gem 'liquid', '~> 2.3.0'
|
||||||
|
gem 'directory_watcher', '1.4.1'
|
||||||
end
|
end
|
||||||
|
|
||||||
gem 'sinatra', '~> 1.4.2'
|
gem 'sinatra', '~> 1.4.2'
|
||||||
|
10
Gemfile.lock
10
Gemfile.lock
@ -1,5 +1,5 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
RedCloth (4.2.9)
|
RedCloth (4.2.9)
|
||||||
chunky_png (1.2.5)
|
chunky_png (1.2.5)
|
||||||
@ -33,9 +33,9 @@ GEM
|
|||||||
rack
|
rack
|
||||||
rake (0.9.2.2)
|
rake (0.9.2.2)
|
||||||
rb-fsevent (0.9.1)
|
rb-fsevent (0.9.1)
|
||||||
rdiscount (1.6.8)
|
rdiscount (2.0.7.3)
|
||||||
rubypants (0.2.0)
|
rubypants (0.2.0)
|
||||||
sass (3.1.20)
|
sass (3.2.9)
|
||||||
sass-globbing (1.0.0)
|
sass-globbing (1.0.0)
|
||||||
sass (>= 3.1)
|
sass (>= 3.1)
|
||||||
sinatra (1.4.2)
|
sinatra (1.4.2)
|
||||||
@ -53,14 +53,16 @@ PLATFORMS
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
RedCloth (~> 4.2.9)
|
RedCloth (~> 4.2.9)
|
||||||
compass (~> 0.12.2)
|
compass (~> 0.12.2)
|
||||||
|
directory_watcher (= 1.4.1)
|
||||||
haml (~> 3.1.7)
|
haml (~> 3.1.7)
|
||||||
jekyll (~> 0.12)
|
jekyll (~> 0.12)
|
||||||
liquid (~> 2.3.0)
|
liquid (~> 2.3.0)
|
||||||
pygments.rb (~> 0.3.4)
|
pygments.rb (~> 0.3.4)
|
||||||
rake (~> 0.9)
|
rake (~> 0.9)
|
||||||
rb-fsevent (~> 0.9)
|
rb-fsevent (~> 0.9)
|
||||||
rdiscount (~> 1.6.8)
|
rdiscount (~> 2.0.7)
|
||||||
rubypants (~> 0.2.0)
|
rubypants (~> 0.2.0)
|
||||||
|
sass (~> 3.2)
|
||||||
sass-globbing (~> 1.0.0)
|
sass-globbing (~> 1.0.0)
|
||||||
sinatra (~> 1.4.2)
|
sinatra (~> 1.4.2)
|
||||||
stringex (~> 1.4.0)
|
stringex (~> 1.4.0)
|
||||||
|
@ -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.
|
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.
|
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
|
## Documentation
|
||||||
|
|
||||||
|
37
Rakefile
37
Rakefile
@ -247,18 +247,21 @@ end
|
|||||||
desc "deploy public directory to github pages"
|
desc "deploy public directory to github pages"
|
||||||
multitask :push do
|
multitask :push do
|
||||||
puts "## Deploying branch to Github Pages "
|
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) }
|
(Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) }
|
||||||
Rake::Task[:copydot].invoke(public_dir, deploy_dir)
|
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
|
cp_r "#{public_dir}/.", deploy_dir
|
||||||
cd "#{deploy_dir}" do
|
cd "#{deploy_dir}" do
|
||||||
system "git add ."
|
system "git add -A"
|
||||||
system "git add -u"
|
|
||||||
puts "\n## Commiting: Site updated at #{Time.now.utc}"
|
puts "\n## Commiting: Site updated at #{Time.now.utc}"
|
||||||
message = "Site updated at #{Time.now.utc}"
|
message = "Site updated at #{Time.now.utc}"
|
||||||
system "git commit -m \"#{message}\""
|
system "git commit -m \"#{message}\""
|
||||||
puts "\n## Pushing generated #{deploy_dir} website"
|
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"
|
puts "\n## Github Pages deploy complete"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -304,10 +307,16 @@ task :setup_github_pages, :repo do |t, args|
|
|||||||
repo_url = args.repo
|
repo_url = args.repo
|
||||||
else
|
else
|
||||||
puts "Enter the read/write url for your repository"
|
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: ")
|
repo_url = get_stdin("Repository url: ")
|
||||||
end
|
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'
|
branch = (repo_url.match(/\/[\w-]+\.github\.(?:io|com)/).nil?) ? 'gh-pages' : 'master'
|
||||||
project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : ''
|
project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : ''
|
||||||
unless (`git remote -v` =~ /origin.+?octopress(?:\.git)?/).nil?
|
unless (`git remote -v` =~ /origin.+?octopress(?:\.git)?/).nil?
|
||||||
@ -328,10 +337,8 @@ task :setup_github_pages, :repo do |t, args|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
url = "http://#{user}.github.io"
|
|
||||||
url += "/#{project}" unless project == ''
|
|
||||||
jekyll_config = IO.read('_config.yml')
|
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|
|
File.open('_config.yml', 'w') do |f|
|
||||||
f.write jekyll_config
|
f.write jekyll_config
|
||||||
end
|
end
|
||||||
@ -351,7 +358,7 @@ task :setup_github_pages, :repo do |t, args|
|
|||||||
f.write rakefile
|
f.write rakefile
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
def ok_failed(condition)
|
def ok_failed(condition)
|
||||||
@ -376,6 +383,16 @@ def ask(message, valid_options)
|
|||||||
answer
|
answer
|
||||||
end
|
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"
|
desc "list tasks"
|
||||||
task :list do
|
task :list do
|
||||||
puts "Tasks: #{(Rake::Task.tasks - [Rake::Task[:list]]).join(', ')}"
|
puts "Tasks: #{(Rake::Task.tasks - [Rake::Task[:list]]).join(', ')}"
|
||||||
|
@ -6,6 +6,7 @@ project_type = :stand_alone
|
|||||||
# Publishing paths
|
# Publishing paths
|
||||||
http_path = "/"
|
http_path = "/"
|
||||||
http_images_path = "/images"
|
http_images_path = "/images"
|
||||||
|
http_generated_images_path = "/images"
|
||||||
http_fonts_path = "/fonts"
|
http_fonts_path = "/fonts"
|
||||||
css_dir = "public/stylesheets"
|
css_dir = "public/stylesheets"
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ module Jekyll
|
|||||||
end
|
end
|
||||||
|
|
||||||
def render(context)
|
def render(context)
|
||||||
if parts = @text.match(/([\d]*) (.*)/)
|
if parts = @text.match(/([a-zA-Z\d]*) (.*)/)
|
||||||
gist, file = parts[1].strip, parts[2].strip
|
gist, file = parts[1].strip, parts[2].strip
|
||||||
script_url = script_url_for gist, file
|
script_url = script_url_for gist, file
|
||||||
code = get_cached_gist(gist, file) || get_gist_from_web(gist, file)
|
code = get_cached_gist(gist, file) || get_gist_from_web(gist, file)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
module Jekyll
|
module Jekyll
|
||||||
class JsFiddle < Liquid::Tag
|
class JsFiddle < Liquid::Tag
|
||||||
def initialize(tag_name, markup, tokens)
|
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
|
@fiddle = fiddle
|
||||||
@sequence = (sequence unless sequence == 'default') || 'js,resources,html,css,result'
|
@sequence = (sequence unless sequence == 'default') || 'js,resources,html,css,result'
|
||||||
@skin = (skin unless skin == 'default') || 'light'
|
@skin = (skin unless skin == 'default') || 'light'
|
||||||
|
@ -22,14 +22,14 @@ module HighlightCode
|
|||||||
highlighted_code = File.read(path)
|
highlighted_code = File.read(path)
|
||||||
else
|
else
|
||||||
begin
|
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
|
rescue MentosError
|
||||||
raise "Pygments can't parse unknown language: #{lang}."
|
raise "Pygments can't parse unknown language: #{lang}."
|
||||||
end
|
end
|
||||||
File.open(path, 'w') {|f| f.print(highlighted_code) }
|
File.open(path, 'w') {|f| f.print(highlighted_code) }
|
||||||
end
|
end
|
||||||
else
|
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
|
end
|
||||||
highlighted_code
|
highlighted_code
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user