From cac44fba1e4d4908ed41e161fc068ef0fcfa1f48 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Sat, 18 Aug 2018 17:49:02 +1000 Subject: [PATCH] Upgrade to nanoc 4 --- Gemfile | 2 +- Gemfile.lock | 53 ++++++++++++++++++++++++++---------- Rakefile | 2 +- config.yaml | 2 ++ content/robots.txt | 2 +- layouts/_article.html | 2 +- layouts/_listing.html | 4 +-- layouts/articles.html | 2 +- layouts/default.html | 2 +- layouts/topphoto.html | 2 +- layouts/weather.html | 2 +- lib/default.rb | 8 +++--- script/bitly | 6 ++-- script/importer/wordpress.rb | 4 +-- 14 files changed, 59 insertions(+), 34 deletions(-) diff --git a/Gemfile b/Gemfile index bd0ef75..9517c46 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' gem 'rake' gem 'mime-types' -gem 'nanoc', '~> 3.0' +gem 'nanoc', '~> 4.0' gem 'bitly' gem 'haml' gem 'sass' diff --git a/Gemfile.lock b/Gemfile.lock index ef05a74..5f5e6b9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,8 @@ GEM remote: https://rubygems.org/ specs: + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) adsf (1.4.0) rack (>= 1.0.0, < 3.0.0) bitly (1.1.0) @@ -10,28 +12,38 @@ GEM builder (3.2.3) coderay (1.1.2) colored (1.2) - cri (2.9.1) + concurrent-ruby (1.0.5) + cri (2.13.0) colored (~> 1.2) + ddmemoize (1.0.0) + ddmetrics (~> 1.0) + ref (~> 2.0) + ddmetrics (1.0.1) + ddplugin (1.0.2) faraday (0.12.2) multipart-post (>= 1.2, < 3) - ffi (1.9.18) + ffi (1.9.25) formatador (0.2.5) fssm (0.2.10) - guard (2.14.1) + guard (2.14.2) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) - lumberjack (~> 1.0) + lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.9.12) shellany (~> 0.0) thor (>= 0.18.1) - guard-nanoc (1.0.3) + guard-compat (1.2.1) + guard-nanoc (2.1.3) guard (~> 2.8) - nanoc (~> 3.6) + guard-compat (~> 1.0) + nanoc (>= 4.3.8, < 5.0) haml (5.0.3) temple (>= 0.8.0) tilt + hamster (3.0.0) + concurrent-ruby (~> 1.0) httparty (0.15.6) multi_xml (>= 0.5.2) jwt (1.5.6) @@ -39,7 +51,7 @@ GEM rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - lumberjack (1.0.12) + lumberjack (1.0.13) method_source (0.9.0) mime-types (3.1) mime-types-data (~> 3.2015) @@ -48,8 +60,17 @@ GEM multi_json (1.12.2) multi_xml (0.6.0) multipart-post (2.0.0) - nanoc (3.8.0) - cri (~> 2.3) + nanoc (4.9.3) + addressable (~> 2.5) + cri (~> 2.8) + ddmemoize (~> 1.0) + ddmetrics (~> 1.0) + ddplugin (~> 1.0) + hamster (~> 3.0) + parallel (~> 1.12) + ref (~> 2.0) + slow_enumerator_tools (~> 1.0) + tomlrb (~> 1.2) nenv (0.3.0) nokogiri (1.8.1) mini_portile2 (~> 2.3.0) @@ -62,17 +83,18 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - pry (0.11.1) + parallel (1.12.1) + pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) + public_suffix (3.0.3) rack (2.0.3) rake (12.1.0) - rb-fsevent (0.10.2) + rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) - rb-kqueue (0.2.5) - ffi (>= 0.5.0) rdiscount (2.2.0.1) + ref (2.0.0) ruby_dep (1.5.0) rubypants (0.6.0) sass (3.5.1) @@ -81,10 +103,12 @@ GEM rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) shellany (0.0.1) + slow_enumerator_tools (1.1.0) systemu (2.6.5) temple (0.8.0) thor (0.20.0) tilt (2.0.8) + tomlrb (1.2.7) PLATFORMS ruby @@ -98,10 +122,9 @@ DEPENDENCIES haml listen mime-types - nanoc (~> 3.0) + nanoc (~> 4.0) nokogiri rake - rb-kqueue (>= 0.2) rdiscount rubypants sass diff --git a/Rakefile b/Rakefile index f484d24..1f926d6 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1 @@ -require 'nanoc3/tasks' \ No newline at end of file +require 'nanoc/tasks' diff --git a/config.yaml b/config.yaml index 13a233e..4a8fc40 100644 --- a/config.yaml +++ b/config.yaml @@ -24,11 +24,13 @@ enable_output_diff: false # hashes; each array element represents a single data source. By default, # there is only a single data source that reads data from the “content/” and # “layout/” directories in the site directory. +string_pattern_type: legacy data_sources: - # The type is the identifier of the data source. By default, this will be # `filesystem_unified`. type: filesystem_unified + identifier_type: legacy # The path where items should be mounted (comparable to mount points in # Unix-like systems). This is “/” by default, meaning that items will have diff --git a/content/robots.txt b/content/robots.txt index 7c131a2..fd8ea93 100644 --- a/content/robots.txt +++ b/content/robots.txt @@ -1,3 +1,3 @@ User-Agent: * Disallow: -Sitemap: <%= @site.config[:base_url] %>/sitemap.xml +Sitemap: <%= @config[:base_url] %>/sitemap.xml diff --git a/layouts/_article.html b/layouts/_article.html index 88b232c..a50f3ca 100644 --- a/layouts/_article.html +++ b/layouts/_article.html @@ -6,7 +6,7 @@ <%= post_date.year %>

- <%=h @article[:title] %> + <%=h @article[:title] %> <%=h @article[:extra] %>

diff --git a/layouts/_listing.html b/layouts/_listing.html index b7ab956..887c214 100644 --- a/layouts/_listing.html +++ b/layouts/_listing.html @@ -28,7 +28,7 @@ <%= post_date.year %>

- <%= article[:title] %> + <%= article[:title] %> A one sentence summary of this post would go here this one is longer then the other one.

@@ -63,7 +63,7 @@ <%= post_date.year %>

- <%= article[:title] %> + <%= article[:title] %> A one sentence summary of this post would go here.

<% end %> diff --git a/layouts/articles.html b/layouts/articles.html index c876c66..73d3d99 100644 --- a/layouts/articles.html +++ b/layouts/articles.html @@ -30,7 +30,7 @@ else feed = '/feed/' end - active = (@item.identifier.sub(%r{page/$}, '') == path) + active = (@item.identifier.to_s.sub(%r{page/$}, '') == path) %>
  • Feed Icon diff --git a/layouts/default.html b/layouts/default.html index 495dd1f..6c4d783 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -12,7 +12,7 @@ > <%= render '_header' %> <%= render '_footer' %> diff --git a/layouts/topphoto.html b/layouts/topphoto.html index 20e3ee9..49b76a1 100644 --- a/layouts/topphoto.html +++ b/layouts/topphoto.html @@ -15,7 +15,7 @@ <%= @item[:photo_alt] %> <%= render '_footer' %> diff --git a/layouts/weather.html b/layouts/weather.html index c8994d8..71a5f80 100644 --- a/layouts/weather.html +++ b/layouts/weather.html @@ -11,7 +11,7 @@ <%= render '_header' %> <%= render '_footer' %> diff --git a/lib/default.rb b/lib/default.rb index ab4f4f4..1a3d129 100644 --- a/lib/default.rb +++ b/lib/default.rb @@ -3,8 +3,8 @@ require 'json' -include Nanoc3::Helpers::Rendering -include Nanoc3::Helpers::Blogging -include Nanoc3::Helpers::XMLSitemap -include Nanoc3::Helpers::HTMLEscape +include Nanoc::Helpers::Rendering +include Nanoc::Helpers::Blogging +include Nanoc::Helpers::XMLSitemap +include Nanoc::Helpers::HTMLEscape include WezM::Helpers::Articles diff --git a/script/bitly b/script/bitly index 98759ed..d4ed6a4 100755 --- a/script/bitly +++ b/script/bitly @@ -3,13 +3,13 @@ require 'pathname' $:.unshift (Pathname(__FILE__).parent.parent + 'lib').to_s -require 'nanoc3' +require 'nanoc' require 'articles' require 'bitly' -include Nanoc3::Helpers::Blogging +include Nanoc::Helpers::Blogging -site = Nanoc3::Site.new(Pathname(__FILE__).parent.parent.to_s) +site = Nanoc::Site.new(Pathname(__FILE__).parent.parent.to_s) Bitly.use_api_version_3 bitly = Bitly.new('wezm', 'R_f2bfdace56c886671086eb0c8acb9ce7') diff --git a/script/importer/wordpress.rb b/script/importer/wordpress.rb index 6577a70..5860e62 100644 --- a/script/importer/wordpress.rb +++ b/script/importer/wordpress.rb @@ -1,5 +1,5 @@ require 'nokogiri' -require 'nanoc3' +require 'nanoc' require 'uri' module Importer @@ -9,7 +9,7 @@ module Importer def initialize(wordpress_export_path, nanoc_site_path, rewrite_map_path) @export_file = File.open(wordpress_export_path) @export = Nokogiri::XML(@export_file) - @site = Nanoc3::Site.new(nanoc_site_path) + @site = Nanoc::Site.new(nanoc_site_path) @rewrite_map = [] @rewrite_map_path = rewrite_map_path