mirror of
https://github.com/danbee/danbarber.me
synced 2025-03-04 08:59:10 +00:00
Upgrade to Jekyll 3
Removed Kramdown Pygments so we'll have to replace that. Also upgraded jekyll-assets which meant some futzing around with bourbon.
This commit is contained in:
parent
e3bcae6e3f
commit
d90eaacf60
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
_site
|
_site
|
||||||
.sass-cache
|
.sass-cache
|
||||||
.deploy
|
.deploy
|
||||||
|
.asset-cache
|
||||||
|
|||||||
7
Gemfile
7
Gemfile
@ -5,15 +5,16 @@ gem 'rake'
|
|||||||
gem 'mini_magick'
|
gem 'mini_magick'
|
||||||
|
|
||||||
gem 'jekyll'
|
gem 'jekyll'
|
||||||
|
gem 'jekyll-paginate'
|
||||||
gem 'jekyll-assets'
|
gem 'jekyll-assets'
|
||||||
gem 'jekyll-video-tag'
|
gem 'jekyll-video-tag'
|
||||||
|
|
||||||
gem 'jekyll-staging'
|
gem 'jekyll-staging'
|
||||||
|
|
||||||
gem 'octopress', '~> 3.0.0.rc'
|
gem 'octopress'
|
||||||
gem 'octopress-deploy', '~> 1.0'
|
gem 'octopress-deploy'
|
||||||
|
|
||||||
gem 'kramdown', '~> 1.3.3'
|
gem 'kramdown'
|
||||||
|
|
||||||
gem 'facets'
|
gem 'facets'
|
||||||
|
|
||||||
|
|||||||
140
Gemfile.lock
140
Gemfile.lock
@ -1,119 +1,81 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
addressable (2.3.8)
|
addressable (2.4.0)
|
||||||
blankslate (2.1.2.4)
|
bourbon (4.2.6)
|
||||||
bourbon (4.2.2)
|
|
||||||
sass (~> 3.4)
|
sass (~> 3.4)
|
||||||
thor
|
thor (~> 0.19)
|
||||||
celluloid (0.16.0)
|
|
||||||
timers (~> 4.0.0)
|
|
||||||
classifier-reborn (2.0.3)
|
|
||||||
fast-stemmer (~> 1.0)
|
|
||||||
coffee-script (2.4.1)
|
|
||||||
coffee-script-source
|
|
||||||
execjs
|
|
||||||
coffee-script-source (1.9.1.1)
|
|
||||||
colorator (0.1)
|
colorator (0.1)
|
||||||
execjs (2.5.2)
|
concurrent-ruby (1.0.0)
|
||||||
|
execjs (2.6.0)
|
||||||
facets (3.0.0)
|
facets (3.0.0)
|
||||||
fast-stemmer (1.0.2)
|
fastimage (1.8.1)
|
||||||
fastimage (1.6.8)
|
|
||||||
addressable (~> 2.3, >= 2.3.5)
|
addressable (~> 2.3, >= 2.3.5)
|
||||||
ffi (1.9.8)
|
ffi (1.9.10)
|
||||||
hike (1.2.3)
|
jekyll (3.0.2)
|
||||||
hitimes (1.2.2)
|
|
||||||
jekyll (2.5.3)
|
|
||||||
classifier-reborn (~> 2.0)
|
|
||||||
colorator (~> 0.1)
|
colorator (~> 0.1)
|
||||||
jekyll-coffeescript (~> 1.0)
|
|
||||||
jekyll-gist (~> 1.0)
|
|
||||||
jekyll-paginate (~> 1.0)
|
|
||||||
jekyll-sass-converter (~> 1.0)
|
jekyll-sass-converter (~> 1.0)
|
||||||
jekyll-watch (~> 1.1)
|
jekyll-watch (~> 1.1)
|
||||||
kramdown (~> 1.3)
|
kramdown (~> 1.3)
|
||||||
liquid (~> 2.6.1)
|
liquid (~> 3.0)
|
||||||
mercenary (~> 0.3.3)
|
mercenary (~> 0.3.3)
|
||||||
pygments.rb (~> 0.6.0)
|
rouge (~> 1.7)
|
||||||
redcarpet (~> 3.1)
|
|
||||||
safe_yaml (~> 1.0)
|
safe_yaml (~> 1.0)
|
||||||
toml (~> 0.1.0)
|
jekyll-assets (2.1.2)
|
||||||
jekyll-assets (0.14.0)
|
fastimage (~> 1.8)
|
||||||
fastimage (~> 1.6)
|
jekyll (~> 3.0)
|
||||||
jekyll (~> 2.0)
|
sprockets (~> 3.3)
|
||||||
mini_magick (~> 4.1)
|
sprockets-helpers (~> 1.2)
|
||||||
sass (~> 3.2)
|
tilt (~> 2.0)
|
||||||
sprockets (~> 2.10)
|
|
||||||
sprockets-helpers
|
|
||||||
sprockets-sass
|
|
||||||
jekyll-coffeescript (1.0.1)
|
|
||||||
coffee-script (~> 2.2)
|
|
||||||
jekyll-gist (1.2.1)
|
|
||||||
jekyll-paginate (1.1.0)
|
jekyll-paginate (1.1.0)
|
||||||
jekyll-sass-converter (1.3.0)
|
jekyll-sass-converter (1.4.0)
|
||||||
sass (~> 3.2)
|
sass (~> 3.4)
|
||||||
jekyll-staging (1.0.6)
|
jekyll-staging (1.0.6)
|
||||||
jekyll-video-tag (0.1.0)
|
jekyll-video-tag (0.1.0)
|
||||||
jekyll-watch (1.2.1)
|
jekyll-watch (1.3.1)
|
||||||
listen (~> 2.7)
|
listen (~> 3.0)
|
||||||
json (1.8.2)
|
json (1.8.3)
|
||||||
kramdown (1.3.3)
|
kramdown (1.9.0)
|
||||||
liquid (2.6.2)
|
liquid (3.0.6)
|
||||||
listen (2.10.0)
|
listen (3.0.5)
|
||||||
celluloid (~> 0.16.0)
|
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
mercenary (0.3.5)
|
mercenary (0.3.5)
|
||||||
mini_magick (4.2.3)
|
mini_magick (4.3.6)
|
||||||
multi_json (1.11.0)
|
octopress (3.0.12.pre.1)
|
||||||
octopress (3.0.0.rc.35)
|
jekyll (>= 2.0)
|
||||||
jekyll (~> 2.5)
|
|
||||||
mercenary (~> 0.3.2)
|
mercenary (~> 0.3.2)
|
||||||
octopress-deploy
|
octopress-deploy
|
||||||
octopress-escape-code (~> 2.0)
|
octopress-escape-code (~> 2.0)
|
||||||
octopress-hooks (~> 2.0)
|
octopress-hooks (~> 2.0)
|
||||||
|
redcarpet (~> 3.0)
|
||||||
titlecase
|
titlecase
|
||||||
octopress-deploy (1.2.1)
|
octopress-deploy (1.3.0)
|
||||||
colorator
|
colorator
|
||||||
octopress-escape-code (2.0.6)
|
octopress-escape-code (2.1.1)
|
||||||
octopress-hooks (~> 2.0)
|
jekyll (~> 3.0)
|
||||||
octopress-hooks (2.6.0)
|
octopress-hooks (2.6.1)
|
||||||
jekyll (~> 2.0)
|
jekyll (>= 2.0)
|
||||||
parslet (1.5.0)
|
rack (1.6.4)
|
||||||
blankslate (~> 2.0)
|
rake (10.5.0)
|
||||||
posix-spawn (0.3.11)
|
rb-fsevent (0.9.7)
|
||||||
pygments.rb (0.6.3)
|
|
||||||
posix-spawn (~> 0.3.6)
|
|
||||||
yajl-ruby (~> 1.2.0)
|
|
||||||
rack (1.6.0)
|
|
||||||
rake (10.4.2)
|
|
||||||
rb-fsevent (0.9.4)
|
|
||||||
rb-inotify (0.9.5)
|
rb-inotify (0.9.5)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
redcarpet (3.2.3)
|
redcarpet (3.3.4)
|
||||||
|
rouge (1.10.1)
|
||||||
safe_yaml (1.0.4)
|
safe_yaml (1.0.4)
|
||||||
sass (3.4.13)
|
sass (3.4.21)
|
||||||
sprockets (2.12.3)
|
sprockets (3.5.2)
|
||||||
hike (~> 1.2)
|
concurrent-ruby (~> 1.0)
|
||||||
multi_json (~> 1.0)
|
rack (> 1, < 3)
|
||||||
rack (~> 1.0)
|
sprockets-helpers (1.2.1)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
sprockets (>= 2.2)
|
||||||
sprockets-helpers (1.1.0)
|
|
||||||
sprockets (~> 2.0)
|
|
||||||
sprockets-sass (1.3.1)
|
|
||||||
sprockets (~> 2.0)
|
|
||||||
tilt (~> 1.1)
|
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
tilt (1.4.1)
|
tilt (2.0.2)
|
||||||
timers (4.0.1)
|
|
||||||
hitimes
|
|
||||||
titlecase (0.1.1)
|
titlecase (0.1.1)
|
||||||
toml (0.1.2)
|
uglifier (2.7.2)
|
||||||
parslet (~> 1.5.0)
|
|
||||||
uglifier (2.7.1)
|
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
yajl-ruby (1.2.1)
|
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
@ -123,12 +85,16 @@ DEPENDENCIES
|
|||||||
facets
|
facets
|
||||||
jekyll
|
jekyll
|
||||||
jekyll-assets
|
jekyll-assets
|
||||||
|
jekyll-paginate
|
||||||
jekyll-staging
|
jekyll-staging
|
||||||
jekyll-video-tag
|
jekyll-video-tag
|
||||||
kramdown (~> 1.3.3)
|
kramdown
|
||||||
mini_magick
|
mini_magick
|
||||||
octopress (~> 3.0.0.rc)
|
octopress
|
||||||
octopress-deploy (~> 1.0)
|
octopress-deploy
|
||||||
rake
|
rake
|
||||||
sass
|
sass
|
||||||
uglifier
|
uglifier
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.10.6
|
||||||
|
|||||||
24
_config.yml
24
_config.yml
@ -1,11 +1,15 @@
|
|||||||
url: http://danbarber.me
|
url: http://danbarber.me
|
||||||
title: Dan Barber
|
title: Dan Barber
|
||||||
author: Dan Barber
|
author: Dan Barber
|
||||||
markdown: KramdownPygments
|
markdown: Kramdown
|
||||||
|
|
||||||
subscribe_rss: '/atom.xml'
|
subscribe_rss: '/atom.xml'
|
||||||
|
|
||||||
gems: ['jekyll_video_tag']
|
gems:
|
||||||
|
- jekyll-paginate
|
||||||
|
- jekyll_video_tag
|
||||||
|
- jekyll-assets
|
||||||
|
- bourbon
|
||||||
|
|
||||||
simple_search: https://duckduckgo.com/
|
simple_search: https://duckduckgo.com/
|
||||||
|
|
||||||
@ -21,16 +25,20 @@ recent_posts: 5
|
|||||||
excerpt_link: "Read on →"
|
excerpt_link: "Read on →"
|
||||||
|
|
||||||
assets:
|
assets:
|
||||||
dirname: assets
|
prefix: "/assets"
|
||||||
baseurl: /assets/
|
assets:
|
||||||
|
- "*.png"
|
||||||
|
- "bundle.css"
|
||||||
|
digest: true
|
||||||
sources:
|
sources:
|
||||||
|
- _assets/css
|
||||||
|
- _assets/images
|
||||||
|
- _assets/icons
|
||||||
- _assets/javascripts
|
- _assets/javascripts
|
||||||
- _assets/stylesheets
|
- _assets/stylesheets
|
||||||
- _assets/images
|
|
||||||
- _assets/fonts
|
- _assets/fonts
|
||||||
- _assets/icons
|
- _assets/img
|
||||||
js_compressor: uglifier
|
- _assets/js
|
||||||
css_compressor: sass
|
|
||||||
|
|
||||||
picture:
|
picture:
|
||||||
source: "_pictures"
|
source: "_pictures"
|
||||||
|
|||||||
@ -1,2 +0,0 @@
|
|||||||
require 'jekyll-assets'
|
|
||||||
require 'jekyll-assets/bourbon'
|
|
||||||
@ -1,92 +0,0 @@
|
|||||||
# We define the an additional option for the kramdown parser to look for
|
|
||||||
module Kramdown
|
|
||||||
module Options
|
|
||||||
define(:kramdown_default_lang, Symbol, nil, <<EOF)
|
|
||||||
Sets the default language for highlighting code blocks
|
|
||||||
|
|
||||||
If no language is set for a code block, the default language is used
|
|
||||||
instead. The value has to be one of the languages supported by pygments
|
|
||||||
or nil if no default language should be used.
|
|
||||||
|
|
||||||
Default: nil
|
|
||||||
Used by: PygmentsHtml converter
|
|
||||||
EOF
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# This class is a plugin for kramdown, to make it use pygments instead of coderay
|
|
||||||
# It has nothing to do with Jekyll, it is simply used by the custom converter below
|
|
||||||
module Kramdown
|
|
||||||
module Converter
|
|
||||||
class PygmentsHtml < Html
|
|
||||||
|
|
||||||
begin
|
|
||||||
require 'pygments'
|
|
||||||
rescue LoadError
|
|
||||||
STDERR.puts 'You are missing a library required for syntax highlighting. Please run:'
|
|
||||||
STDERR.puts ' $ [sudo] gem install pygments'
|
|
||||||
raise FatalException.new("Missing dependency: Pygments")
|
|
||||||
end
|
|
||||||
|
|
||||||
def convert_codeblock(el, indent)
|
|
||||||
attr = el.attr.dup
|
|
||||||
lang = extract_code_language!(attr) || @options[:kramdown_default_lang]
|
|
||||||
code = pygmentize(el.value, lang)
|
|
||||||
code_attr = {}
|
|
||||||
code_attr['class'] = "language-#{lang}" if lang
|
|
||||||
"#{' '*indent}<div class=\"highlight\"><pre#{html_attributes(attr)}><code#{html_attributes(code_attr)}>#{code}</code></pre></div>\n"
|
|
||||||
end
|
|
||||||
|
|
||||||
def convert_codespan(el, indent)
|
|
||||||
attr = el.attr.dup
|
|
||||||
lang = extract_code_language!(attr) || @options[:kramdown_default_lang]
|
|
||||||
code = pygmentize(el.value, lang)
|
|
||||||
if lang
|
|
||||||
attr['class'] = "highlight"
|
|
||||||
if attr.has_key?('class')
|
|
||||||
attr['class'] += " language-#{lang}"
|
|
||||||
else
|
|
||||||
attr['class'] = "language-#{lang}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
"<code#{html_attributes(attr)}>#{code}</code>"
|
|
||||||
end
|
|
||||||
|
|
||||||
def pygmentize(code, lang)
|
|
||||||
if lang
|
|
||||||
Pygments.highlight(code,
|
|
||||||
:lexer => lang,
|
|
||||||
:options => { :startinline => true, :encoding => 'utf-8', :nowrap => true })
|
|
||||||
else
|
|
||||||
escape_html(code)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# This class is the actual custom Jekyll converter.
|
|
||||||
class Jekyll::Converters::Markdown::KramdownPygments
|
|
||||||
|
|
||||||
def initialize(config)
|
|
||||||
require 'kramdown'
|
|
||||||
@config = config
|
|
||||||
rescue LoadError
|
|
||||||
STDERR.puts 'You are missing a library required for Markdown. Please run:'
|
|
||||||
STDERR.puts ' $ [sudo] gem install kramdown'
|
|
||||||
raise FatalException.new("Missing dependency: kramdown")
|
|
||||||
end
|
|
||||||
|
|
||||||
def convert(content)
|
|
||||||
html = Kramdown::Document.new(content, {
|
|
||||||
:auto_ids => @config['kramdown']['auto_ids'],
|
|
||||||
:footnote_nr => @config['kramdown']['footnote_nr'],
|
|
||||||
:entity_output => @config['kramdown']['entity_output'],
|
|
||||||
:toc_levels => @config['kramdown']['toc_levels'],
|
|
||||||
:smart_quotes => @config['kramdown']['smart_quotes'],
|
|
||||||
:kramdown_default_lang => @config['kramdown']['default_lang'],
|
|
||||||
:input => @config['kramdown']['input']
|
|
||||||
}).to_pygments_html
|
|
||||||
return html;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Loading…
Reference in New Issue
Block a user