diff --git a/.ruby-version b/.ruby-version index 2bf1c1c..aedc15b 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.1 +2.5.3 diff --git a/Gemfile b/Gemfile index cd7d8f6..42fde16 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,12 @@ source 'http://rubygems.org' -gem 'github-pages', group: :jekyll_plugins +gem 'jekyll' gem 'html-proofer' gem 'bourbon' gem 'neat' + +group :jekyll_plugins do + gem 'jekyll-compose' + gem 'jekyll-gist' +end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 64b8835..e918ee6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,150 +1,115 @@ GEM remote: http://rubygems.org/ specs: - activesupport (4.2.5) + activesupport (4.2.10) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.4.0) - bourbon (4.2.6) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + bourbon (5.1.0) sass (~> 3.4) thor (~> 0.19) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) - colorator (0.1) - colored (1.2) - ethon (0.8.0) + colorator (1.1.0) + colorize (0.8.1) + concurrent-ruby (1.0.5) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + ethon (0.11.0) ffi (>= 1.3.0) - execjs (2.7.0) - faraday (0.9.2) + eventmachine (1.2.7) + faraday (0.15.3) multipart-post (>= 1.2, < 3) - ffi (1.9.10) - gemoji (2.1.0) - github-pages (87) - github-pages-health-check (= 1.1.0) - jekyll (= 3.1.6) - jekyll-coffeescript (= 1.0.1) - jekyll-feed (= 0.5.1) - jekyll-gist (= 1.4.0) - jekyll-github-metadata (= 2.0.2) - jekyll-mentions (= 1.1.3) - jekyll-paginate (= 1.1.0) - jekyll-redirect-from (= 0.11.0) - jekyll-sass-converter (= 1.3.0) - jekyll-seo-tag (= 2.0.0) - jekyll-sitemap (= 0.10.0) - jemoji (= 0.6.2) - kramdown (= 1.11.1) - liquid (= 3.0.6) - listen (= 3.0.6) - mercenary (~> 0.3) - rouge (= 1.11.1) - terminal-table (~> 1.4) - github-pages-health-check (1.1.0) + ffi (1.9.25) + forwardable-extended (2.6.0) + html-proofer (3.9.2) + activesupport (>= 4.2, < 6.0) addressable (~> 2.3) - net-dns (~> 0.8) - octokit (~> 4.0) - public_suffix (~> 1.4) - typhoeus (~> 0.7) - html-pipeline (2.4.2) - activesupport (>= 2) - nokogiri (>= 1.4) - html-proofer (2.6.1) - activesupport (~> 4.2) - addressable (~> 2.3) - colored (~> 1.2) + colorize (~> 0.8) mercenary (~> 0.3.2) - nokogiri (~> 1.5) + nokogiri (~> 1.8.1) parallel (~> 1.3) - typhoeus (~> 0.7) + typhoeus (~> 1.3) yell (~> 2.0) - i18n (0.7.0) - jekyll (3.1.6) - colorator (~> 0.1) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.7.4) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) + jekyll-watch (~> 2.0) + kramdown (~> 1.14) + liquid (~> 4.0) mercenary (~> 0.3.3) - rouge (~> 1.7) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) safe_yaml (~> 1.0) - jekyll-coffeescript (1.0.1) - coffee-script (~> 2.2) - jekyll-feed (0.5.1) - jekyll-gist (1.4.0) - octokit (~> 4.2) - jekyll-github-metadata (2.0.2) - jekyll (~> 3.1) - octokit (~> 4.0) - jekyll-mentions (1.1.3) - html-pipeline (~> 2.3) + jekyll-compose (0.8.0) jekyll (~> 3.0) - jekyll-paginate (1.1.0) - jekyll-redirect-from (0.11.0) - jekyll (>= 2.0) - jekyll-sass-converter (1.3.0) - sass (~> 3.2) - jekyll-seo-tag (2.0.0) - jekyll (~> 3.1) - jekyll-sitemap (0.10.0) - jekyll-watch (1.5.0) - listen (~> 3.0, < 3.1) - jemoji (0.6.2) - gemoji (~> 2.0) - html-pipeline (~> 2.2) - jekyll (>= 3.0) - json (1.8.3) - kramdown (1.11.1) - liquid (3.0.6) - listen (3.0.6) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) - mercenary (0.3.5) - mini_portile2 (2.0.0) - minitest (5.8.3) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-watch (2.1.2) + listen (~> 3.0) + kramdown (1.17.0) + liquid (4.0.0) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + mercenary (0.3.6) + mini_portile2 (2.3.0) + minitest (5.11.3) multipart-post (2.0.0) - neat (1.7.2) - bourbon (>= 4.0) - sass (>= 3.3) - net-dns (0.8.0) - nokogiri (1.6.7.1) - mini_portile2 (~> 2.0.0.rc2) - octokit (4.4.0) - sawyer (~> 0.7.0, >= 0.5.3) - parallel (1.6.1) - public_suffix (1.5.3) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rouge (1.11.1) + neat (3.0.0) + sass (~> 3.4) + thor (~> 0.19) + nokogiri (1.8.5) + mini_portile2 (~> 2.3.0) + octokit (4.13.0) + sawyer (~> 0.8.0, >= 0.5.3) + parallel (1.12.1) + pathutil (0.16.1) + forwardable-extended (~> 2.6) + public_suffix (2.0.5) + rb-fsevent (0.10.3) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + rouge (2.2.1) + ruby_dep (1.5.0) safe_yaml (1.0.4) - sass (3.4.20) - sawyer (0.7.0) - addressable (>= 2.3.5, < 2.5) - faraday (~> 0.8, < 0.10) - terminal-table (1.7.3) - unicode-display_width (~> 1.1.1) - thor (0.19.1) - thread_safe (0.3.5) - typhoeus (0.8.0) - ethon (>= 0.8.0) - tzinfo (1.2.2) + sass (3.6.0) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.8.1) + addressable (>= 2.3.5, < 2.6) + faraday (~> 0.8, < 1.0) + thor (0.20.0) + thread_safe (0.3.6) + typhoeus (1.3.0) + ethon (>= 0.9.0) + tzinfo (1.2.5) thread_safe (~> 0.1) - unicode-display_width (1.1.1) - yell (2.0.5) + yell (2.0.7) PLATFORMS ruby DEPENDENCIES bourbon - github-pages html-proofer + jekyll + jekyll-compose + jekyll-gist neat BUNDLED WITH - 1.13.2 + 1.17.1 diff --git a/_config.yml b/_config.yml index 8ef4298..f1f8c89 100644 --- a/_config.yml +++ b/_config.yml @@ -6,9 +6,11 @@ url: http://walkah.net markdown: kramdown permalink: blog/:title/ exclude: [Gemfile, Gemfile.lock, vendor] -gems: [bourbon, neat] + sass: style: compressed -gems: +plugins: + - bourbon + - neat - jekyll-gist diff --git a/_includes/meta.html b/_includes/meta.html index e7a1ed2..0432441 100644 --- a/_includes/meta.html +++ b/_includes/meta.html @@ -20,3 +20,5 @@ {% if page.summary %}{% endif %} {% if page.image %}{% endif %} + + \ No newline at end of file diff --git a/_includes/vcard.html b/_includes/vcard.html index c87cd3a..3c65d1e 100644 --- a/_includes/vcard.html +++ b/_includes/vcard.html @@ -1,5 +1,5 @@
- James Walker -

James Walker (a.k.a. walkah) is an independent developer and hacker. He is a long time Drupal developer, but these days spends more time in Python, Ruby and Javascript.

+ James Walker +

James Walker (a.k.a. walkah) is an independent developer and hacker. He is a long time Drupal developer, but these days spends more time in Python, Ruby and Javascript.

You can follow him on twitter or github.

diff --git a/_layouts/default.html b/_layouts/default.html index 60ddb3e..e4dbac5 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -5,10 +5,9 @@ {% include meta.html %} - + - diff --git a/_layouts/tag_index.html b/_layouts/tag_index.html index 9ec1947..415411b 100644 --- a/_layouts/tag_index.html +++ b/_layouts/tag_index.html @@ -2,12 +2,12 @@ layout: page title: Posts tagged "{{ page.tag }}" --- -{% for post in site.tags[page.tag] reverse %} -{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} -{% unless year == this_year %} -{% assign year = this_year %} -

{{ year }}

-{% endunless %} -{% include article_list.html %} +{% for post in site.tags[page.tag] %} + {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} + {% unless year == this_year %} + {% assign year = this_year %} +

{{ year }}

+ {% endunless %} + {% include article_list.html %} {% endfor %}

Subscribe

diff --git a/_plugins/tag_index.rb b/_plugins/tag_index.rb new file mode 100644 index 0000000..d825cb4 --- /dev/null +++ b/_plugins/tag_index.rb @@ -0,0 +1,85 @@ +module Jekyll + class TagIndex < Page + def initialize(site, base, dir, tag) + @site = site + @base = base + @dir = dir + @name = 'index.html' + self.process(@name) + self.read_yaml(File.join(base, '_layouts'), 'tag_index.html') + self.data['tag'] = tag + tag_title_prefix = site.config['tag_title_prefix'] || 'Posts Tagged “' + tag_title_suffix = site.config['tag_title_suffix'] || '”' + self.data['title'] = "#{tag_title_prefix}#{tag}#{tag_title_suffix}" + end + end + + class TagFeed < Page + def initialize(site, base, tag_dir, tag) + @site = site + @base = base + @dir = tag_dir + @name = 'atom.xml' + self.process(@name) + # Read the YAML data from the layout page. + self.read_yaml(File.join(base, '_layouts'), 'tag_feed.xml') + self.data['tag'] = tag + # Set the title for this page. + tag_title_prefix = site.config['tag_title_prefix'] || 'Posts Tagged “' + tag_title_suffix = site.config['tag_title_suffix'] || '”' + self.data['title'] = "#{tag_title_prefix}#{tag}#{tag_title_suffix}" + # Set the meta-description for this page. + + # Set the correct feed URL. + self.data['feed_url'] = "#{tag_dir}/#{name}" + end + end + + class TagGenerator < Generator + safe true + def generate(site) + if site.layouts.key? 'tag_index' + dir = site.config['tag_dir'] || 'tag' + site.tags.keys.each do |tag| + dest_dir = File.join(dir, tag.tr(' ', '-')) + write_tag_index(site, dest_dir, tag) + write_tag_feed(site, dest_dir, tag) + end + end + end + + def write_tag_index(site, dir, tag) + index = TagIndex.new(site, site.source, dir, tag) + index.render(site.layouts, site.site_payload) + index.write(site.dest) + site.pages << index + end + + def write_tag_feed(site, dir, tag) + feed = TagFeed.new(site, site.source, dir, tag) + feed.render(site.layouts, site.site_payload) + feed.write(site.dest) + site.pages << feed + end + end + + # Adds some extra filters used during the category creation process. + module TagFilter + # Outputs a list of categories as comma-separated links. This is used + # to output the category list for each post on a category page. + # + # +categories+ is the list of categories to format. + # + # Returns string + # + def tag_links(tags) + tags = tags.sort!.map do |item| + item.tr!(' ', '-') + "#{item}" + end + tags.join(', ') + end + end +end + +Liquid::Template.register_filter(Jekyll::TagFilter) diff --git a/blog/index.html b/blog/index.html index 83a11ed..0026aa8 100644 --- a/blog/index.html +++ b/blog/index.html @@ -2,11 +2,11 @@ layout: page title: Blog Archive --- -{% for post in site.posts reverse %} -{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} -{% unless year == this_year %} - {% assign year = this_year %} -

{{ year }}

-{% endunless %} -{% include article_list.html %} +{% for post in site.posts %} + {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} + {% unless year == this_year %} + {% assign year = this_year %} +

{{ year }}

+ {% endunless %} + {% include article_list.html %} {% endfor %} diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index 51f67c3..0000000 Binary files a/favicon.ico and /dev/null differ