1
0
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:
Daniel Barber 2016-01-21 17:42:50 +00:00
parent e3bcae6e3f
commit d90eaacf60
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
6 changed files with 74 additions and 192 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
_site
.sass-cache
.deploy
.asset-cache

View File

@ -5,15 +5,16 @@ gem 'rake'
gem 'mini_magick'
gem 'jekyll'
gem 'jekyll-paginate'
gem 'jekyll-assets'
gem 'jekyll-video-tag'
gem 'jekyll-staging'
gem 'octopress', '~> 3.0.0.rc'
gem 'octopress-deploy', '~> 1.0'
gem 'octopress'
gem 'octopress-deploy'
gem 'kramdown', '~> 1.3.3'
gem 'kramdown'
gem 'facets'

View File

@ -1,119 +1,81 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.8)
blankslate (2.1.2.4)
bourbon (4.2.2)
addressable (2.4.0)
bourbon (4.2.6)
sass (~> 3.4)
thor
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)
thor (~> 0.19)
colorator (0.1)
execjs (2.5.2)
concurrent-ruby (1.0.0)
execjs (2.6.0)
facets (3.0.0)
fast-stemmer (1.0.2)
fastimage (1.6.8)
fastimage (1.8.1)
addressable (~> 2.3, >= 2.3.5)
ffi (1.9.8)
hike (1.2.3)
hitimes (1.2.2)
jekyll (2.5.3)
classifier-reborn (~> 2.0)
ffi (1.9.10)
jekyll (3.0.2)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
liquid (~> 3.0)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
rouge (~> 1.7)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-assets (0.14.0)
fastimage (~> 1.6)
jekyll (~> 2.0)
mini_magick (~> 4.1)
sass (~> 3.2)
sprockets (~> 2.10)
sprockets-helpers
sprockets-sass
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-gist (1.2.1)
jekyll-assets (2.1.2)
fastimage (~> 1.8)
jekyll (~> 3.0)
sprockets (~> 3.3)
sprockets-helpers (~> 1.2)
tilt (~> 2.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-sass-converter (1.4.0)
sass (~> 3.4)
jekyll-staging (1.0.6)
jekyll-video-tag (0.1.0)
jekyll-watch (1.2.1)
listen (~> 2.7)
json (1.8.2)
kramdown (1.3.3)
liquid (2.6.2)
listen (2.10.0)
celluloid (~> 0.16.0)
jekyll-watch (1.3.1)
listen (~> 3.0)
json (1.8.3)
kramdown (1.9.0)
liquid (3.0.6)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
mini_magick (4.2.3)
multi_json (1.11.0)
octopress (3.0.0.rc.35)
jekyll (~> 2.5)
mini_magick (4.3.6)
octopress (3.0.12.pre.1)
jekyll (>= 2.0)
mercenary (~> 0.3.2)
octopress-deploy
octopress-escape-code (~> 2.0)
octopress-hooks (~> 2.0)
redcarpet (~> 3.0)
titlecase
octopress-deploy (1.2.1)
octopress-deploy (1.3.0)
colorator
octopress-escape-code (2.0.6)
octopress-hooks (~> 2.0)
octopress-hooks (2.6.0)
jekyll (~> 2.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.11)
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)
octopress-escape-code (2.1.1)
jekyll (~> 3.0)
octopress-hooks (2.6.1)
jekyll (>= 2.0)
rack (1.6.4)
rake (10.5.0)
rb-fsevent (0.9.7)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.2.3)
redcarpet (3.3.4)
rouge (1.10.1)
safe_yaml (1.0.4)
sass (3.4.13)
sprockets (2.12.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-helpers (1.1.0)
sprockets (~> 2.0)
sprockets-sass (1.3.1)
sprockets (~> 2.0)
tilt (~> 1.1)
sass (3.4.21)
sprockets (3.5.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-helpers (1.2.1)
sprockets (>= 2.2)
thor (0.19.1)
tilt (1.4.1)
timers (4.0.1)
hitimes
tilt (2.0.2)
titlecase (0.1.1)
toml (0.1.2)
parslet (~> 1.5.0)
uglifier (2.7.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
yajl-ruby (1.2.1)
PLATFORMS
ruby
@ -123,12 +85,16 @@ DEPENDENCIES
facets
jekyll
jekyll-assets
jekyll-paginate
jekyll-staging
jekyll-video-tag
kramdown (~> 1.3.3)
kramdown
mini_magick
octopress (~> 3.0.0.rc)
octopress-deploy (~> 1.0)
octopress
octopress-deploy
rake
sass
uglifier
BUNDLED WITH
1.10.6

View File

@ -1,11 +1,15 @@
url: http://danbarber.me
title: Dan Barber
author: Dan Barber
markdown: KramdownPygments
markdown: Kramdown
subscribe_rss: '/atom.xml'
gems: ['jekyll_video_tag']
gems:
- jekyll-paginate
- jekyll_video_tag
- jekyll-assets
- bourbon
simple_search: https://duckduckgo.com/
@ -21,16 +25,20 @@ recent_posts: 5
excerpt_link: "Read on &rarr;"
assets:
dirname: assets
baseurl: /assets/
prefix: "/assets"
assets:
- "*.png"
- "bundle.css"
digest: true
sources:
- _assets/css
- _assets/images
- _assets/icons
- _assets/javascripts
- _assets/stylesheets
- _assets/images
- _assets/fonts
- _assets/icons
js_compressor: uglifier
css_compressor: sass
- _assets/img
- _assets/js
picture:
source: "_pictures"

View File

@ -1,2 +0,0 @@
require 'jekyll-assets'
require 'jekyll-assets/bourbon'

View File

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