1
0
Fork 0
forked from wezm/wezm.net

Upgrade to nanoc 4

This commit is contained in:
Wesley Moore 2018-08-18 17:49:02 +10:00
parent 758e97d840
commit cac44fba1e
No known key found for this signature in database
GPG key ID: BF67766C0BC2D0EE
14 changed files with 59 additions and 34 deletions

View file

@ -4,7 +4,7 @@ source 'https://rubygems.org'
gem 'rake' gem 'rake'
gem 'mime-types' gem 'mime-types'
gem 'nanoc', '~> 3.0' gem 'nanoc', '~> 4.0'
gem 'bitly' gem 'bitly'
gem 'haml' gem 'haml'
gem 'sass' gem 'sass'

View file

@ -1,6 +1,8 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
adsf (1.4.0) adsf (1.4.0)
rack (>= 1.0.0, < 3.0.0) rack (>= 1.0.0, < 3.0.0)
bitly (1.1.0) bitly (1.1.0)
@ -10,28 +12,38 @@ GEM
builder (3.2.3) builder (3.2.3)
coderay (1.1.2) coderay (1.1.2)
colored (1.2) colored (1.2)
cri (2.9.1) concurrent-ruby (1.0.5)
cri (2.13.0)
colored (~> 1.2) 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) faraday (0.12.2)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
ffi (1.9.18) ffi (1.9.25)
formatador (0.2.5) formatador (0.2.5)
fssm (0.2.10) fssm (0.2.10)
guard (2.14.1) guard (2.14.2)
formatador (>= 0.2.4) formatador (>= 0.2.4)
listen (>= 2.7, < 4.0) listen (>= 2.7, < 4.0)
lumberjack (~> 1.0) lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1) nenv (~> 0.1)
notiffany (~> 0.0) notiffany (~> 0.0)
pry (>= 0.9.12) pry (>= 0.9.12)
shellany (~> 0.0) shellany (~> 0.0)
thor (>= 0.18.1) thor (>= 0.18.1)
guard-nanoc (1.0.3) guard-compat (1.2.1)
guard-nanoc (2.1.3)
guard (~> 2.8) guard (~> 2.8)
nanoc (~> 3.6) guard-compat (~> 1.0)
nanoc (>= 4.3.8, < 5.0)
haml (5.0.3) haml (5.0.3)
temple (>= 0.8.0) temple (>= 0.8.0)
tilt tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
httparty (0.15.6) httparty (0.15.6)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
jwt (1.5.6) jwt (1.5.6)
@ -39,7 +51,7 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2) ruby_dep (~> 1.2)
lumberjack (1.0.12) lumberjack (1.0.13)
method_source (0.9.0) method_source (0.9.0)
mime-types (3.1) mime-types (3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
@ -48,8 +60,17 @@ GEM
multi_json (1.12.2) multi_json (1.12.2)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.0.0) multipart-post (2.0.0)
nanoc (3.8.0) nanoc (4.9.3)
cri (~> 2.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) nenv (0.3.0)
nokogiri (1.8.1) nokogiri (1.8.1)
mini_portile2 (~> 2.3.0) mini_portile2 (~> 2.3.0)
@ -62,17 +83,18 @@ GEM
multi_json (~> 1.3) multi_json (~> 1.3)
multi_xml (~> 0.5) multi_xml (~> 0.5)
rack (>= 1.2, < 3) rack (>= 1.2, < 3)
pry (0.11.1) parallel (1.12.1)
pry (0.11.3)
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.9.0) method_source (~> 0.9.0)
public_suffix (3.0.3)
rack (2.0.3) rack (2.0.3)
rake (12.1.0) rake (12.1.0)
rb-fsevent (0.10.2) rb-fsevent (0.10.3)
rb-inotify (0.9.10) rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2) ffi (>= 0.5.0, < 2)
rb-kqueue (0.2.5)
ffi (>= 0.5.0)
rdiscount (2.2.0.1) rdiscount (2.2.0.1)
ref (2.0.0)
ruby_dep (1.5.0) ruby_dep (1.5.0)
rubypants (0.6.0) rubypants (0.6.0)
sass (3.5.1) sass (3.5.1)
@ -81,10 +103,12 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
shellany (0.0.1) shellany (0.0.1)
slow_enumerator_tools (1.1.0)
systemu (2.6.5) systemu (2.6.5)
temple (0.8.0) temple (0.8.0)
thor (0.20.0) thor (0.20.0)
tilt (2.0.8) tilt (2.0.8)
tomlrb (1.2.7)
PLATFORMS PLATFORMS
ruby ruby
@ -98,10 +122,9 @@ DEPENDENCIES
haml haml
listen listen
mime-types mime-types
nanoc (~> 3.0) nanoc (~> 4.0)
nokogiri nokogiri
rake rake
rb-kqueue (>= 0.2)
rdiscount rdiscount
rubypants rubypants
sass sass

View file

@ -1 +1 @@
require 'nanoc3/tasks' require 'nanoc/tasks'

View file

@ -24,11 +24,13 @@ enable_output_diff: false
# hashes; each array element represents a single data source. By default, # 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 # there is only a single data source that reads data from the “content/” and
# “layout/” directories in the site directory. # “layout/” directories in the site directory.
string_pattern_type: legacy
data_sources: data_sources:
- -
# The type is the identifier of the data source. By default, this will be # The type is the identifier of the data source. By default, this will be
# `filesystem_unified`. # `filesystem_unified`.
type: filesystem_unified type: filesystem_unified
identifier_type: legacy
# The path where items should be mounted (comparable to mount points in # The path where items should be mounted (comparable to mount points in
# Unix-like systems). This is “/” by default, meaning that items will have # Unix-like systems). This is “/” by default, meaning that items will have

View file

@ -1,3 +1,3 @@
User-Agent: * User-Agent: *
Disallow: Disallow:
Sitemap: <%= @site.config[:base_url] %>/sitemap.xml Sitemap: <%= @config[:base_url] %>/sitemap.xml

View file

@ -6,7 +6,7 @@
<span class="year"><%= post_date.year %></span> <span class="year"><%= post_date.year %></span>
</abbr> </abbr>
<p> <p>
<strong><a href="<%= @article.reps.first.path %>"><%=h @article[:title] %></a></strong> <strong><a href="<%= @article.reps[:default].path %>"><%=h @article[:title] %></a></strong>
<%=h @article[:extra] %> <%=h @article[:extra] %>
</p> </p>
</li> </li>

View file

@ -28,7 +28,7 @@
<span class="year"><%= post_date.year %></span> <span class="year"><%= post_date.year %></span>
</abbr> </abbr>
<p> <p>
<strong><a href="<%= article.reps.first.path %>"><%= article[:title] %></a></strong> <strong><a href="<%= article.reps[:default].path %>"><%= article[:title] %></a></strong>
A one sentence summary of this post would go here this one is longer then the other one. A one sentence summary of this post would go here this one is longer then the other one.
</p> </p>
</li> </li>
@ -63,7 +63,7 @@
<span class="year"><%= post_date.year %></span> <span class="year"><%= post_date.year %></span>
</abbr> </abbr>
<p> <p>
<strong><a href="<%= article.reps.first.path %>"><%= article[:title] %></a></strong> <strong><a href="<%= article.reps[:default].path %>"><%= article[:title] %></a></strong>
A one sentence summary of this post would go here.</p> A one sentence summary of this post would go here.</p>
</li> </li>
<% end %> <% end %>

View file

@ -30,7 +30,7 @@
else else
feed = '/feed/' feed = '/feed/'
end end
active = (@item.identifier.sub(%r{page/$}, '') == path) active = (@item.identifier.to_s.sub(%r{page/$}, '') == path)
%> %>
<li> <li>
<a href="<%= feed %>"><img class="feed-icon" src="/images/feed-icon.svg" width="12" height="12" alt="Feed Icon" /></a> <a href="<%= feed %>"><img class="feed-icon" src="/images/feed-icon.svg" width="12" height="12" alt="Feed Icon" /></a>

View file

@ -12,7 +12,7 @@
<body<%= %Q( class="#{@item[:body_class]}") if @item[:body_class] %>> <body<%= %Q( class="#{@item[:body_class]}") if @item[:body_class] %>>
<%= render '_header' %> <%= render '_header' %>
<div id="content"> <div id="content">
<h1><a href="<%= @item.reps.first.path %>"><%=h @item[:title] %></a></h1> <h1><a href="<%= @item.reps[:default].path %>"><%=h @item[:title] %></a></h1>
<%= yield %> <%= yield %>
</div> </div>
<%= render '_footer' %> <%= render '_footer' %>

View file

@ -15,7 +15,7 @@
<img src="<%= @item[:photo] %>" alt="<%= @item[:photo_alt] %>" class="cover-photo" /> <img src="<%= @item[:photo] %>" alt="<%= @item[:photo_alt] %>" class="cover-photo" />
<div id="content"> <div id="content">
<h1><a href="<%= @item.reps.first.path %>"><%=h @item[:title] %></a></h1> <h1><a href="<%= @item.reps[:default].path %>"><%=h @item[:title] %></a></h1>
<%= yield %> <%= yield %>
</div> </div>
<%= render '_footer' %> <%= render '_footer' %>

View file

@ -11,7 +11,7 @@
<body class="weather"> <body class="weather">
<%= render '_header' %> <%= render '_header' %>
<div id="content"> <div id="content">
<h1><a href="<%= @item.reps.first.path %>"><%=h @item[:title] %></a></h1> <h1><a href="<%= @item.reps[:default].path %>"><%=h @item[:title] %></a></h1>
<%= yield %> <%= yield %>
</div> </div>
<%= render '_footer' %> <%= render '_footer' %>

View file

@ -3,8 +3,8 @@
require 'json' require 'json'
include Nanoc3::Helpers::Rendering include Nanoc::Helpers::Rendering
include Nanoc3::Helpers::Blogging include Nanoc::Helpers::Blogging
include Nanoc3::Helpers::XMLSitemap include Nanoc::Helpers::XMLSitemap
include Nanoc3::Helpers::HTMLEscape include Nanoc::Helpers::HTMLEscape
include WezM::Helpers::Articles include WezM::Helpers::Articles

View file

@ -3,13 +3,13 @@
require 'pathname' require 'pathname'
$:.unshift (Pathname(__FILE__).parent.parent + 'lib').to_s $:.unshift (Pathname(__FILE__).parent.parent + 'lib').to_s
require 'nanoc3' require 'nanoc'
require 'articles' require 'articles'
require 'bitly' 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.use_api_version_3
bitly = Bitly.new('wezm', 'R_f2bfdace56c886671086eb0c8acb9ce7') bitly = Bitly.new('wezm', 'R_f2bfdace56c886671086eb0c8acb9ce7')

View file

@ -1,5 +1,5 @@
require 'nokogiri' require 'nokogiri'
require 'nanoc3' require 'nanoc'
require 'uri' require 'uri'
module Importer module Importer
@ -9,7 +9,7 @@ module Importer
def initialize(wordpress_export_path, nanoc_site_path, rewrite_map_path) def initialize(wordpress_export_path, nanoc_site_path, rewrite_map_path)
@export_file = File.open(wordpress_export_path) @export_file = File.open(wordpress_export_path)
@export = Nokogiri::XML(@export_file) @export = Nokogiri::XML(@export_file)
@site = Nanoc3::Site.new(nanoc_site_path) @site = Nanoc::Site.new(nanoc_site_path)
@rewrite_map = [] @rewrite_map = []
@rewrite_map_path = rewrite_map_path @rewrite_map_path = rewrite_map_path