<%= post[:short_title] || post[:title] %>
@@ -116,7 +116,7 @@About Pentandra
Our Mission
-<%= @items['/company/'][:mission] %>
+<%= @items['/company/index.*'][:mission] %>
diff --git a/.ruby-version b/.ruby-version index f01bc448..5edb1d01 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.1.4 +ruby-2.2 diff --git a/Gemfile b/Gemfile index 7c90bbcd..261bb7ba 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem 'compass', '~>0.12' # for advanced CSS gem 'haml' # for layouts with clean sources gem 'kramdown' # for advanced markdown gem 'nanoc' # for compiling the site -gem 'nokogiri', '1.6.3.1' # for parsing HTML +gem 'nokogiri' # for parsing HTML gem 'rainpress' # for compact CSS gem 'uglifier' # for compact javascript gem 'html5small' @@ -25,6 +25,7 @@ gem 'rest-client', '~> 1.6' gem 'addressable' gem 'rubypants-unicode' gem 'linkeddata' +gem 'jsonlint' group :development do gem 'guard' diff --git a/Gemfile.lock b/Gemfile.lock index 6173bd1f..3d91c1d9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.2.4) + activesupport (4.2.5) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -13,7 +13,7 @@ GEM bcp47 (0.3.3) i18n builder (3.2.2) - chunky_png (1.3.4) + chunky_png (1.3.5) coderay (1.1.0) colored (1.2) command-builder (0.3.2) @@ -26,7 +26,7 @@ GEM colored (~> 1.2) domain_name (0.5.25) unf (>= 0.0.5, < 1.0.0) - ebnf (0.3.9) + ebnf (1.0.0) rdf (~> 1.1) sxp (~> 0.1, >= 0.1.3) em-websocket (0.5.1) @@ -48,13 +48,16 @@ GEM pry (>= 0.9.12) shellany (~> 0.0) thor (>= 0.18.1) - guard-livereload (2.4.0) + guard-compat (1.2.1) + guard-livereload (2.5.1) em-websocket (~> 0.5) guard (~> 2.8) + guard-compat (~> 1.0) multi_json (~> 1.8) - guard-nanoc (1.0.3) + guard-nanoc (2.0.0) guard (~> 2.8) - nanoc (~> 3.6) + guard-compat (~> 1.0) + nanoc (~> 4.0) haml (4.0.7) tilt hash-utils (2.2.0) @@ -76,55 +79,58 @@ GEM ffi (~> 1.0.7) i18n (0.7.0) json (1.8.1) - json-ld (1.1.11) + json-ld (1.99.0) multi_json (~> 1.11) - rdf (~> 1.1, >= 1.1.7) + rdf (~> 1.99) + jsonlint (0.1.0) + oj (~> 2) jwt (0.1.13) multi_json (>= 1.5) kramdown (1.9.0) link_header (0.0.8) - linkeddata (1.1.11) - equivalent-xml (~> 0.5) - json-ld (~> 1.1, >= 1.1.8) + linkeddata (1.99.0) + equivalent-xml (~> 0.6) + json-ld (~> 1.99) nokogiri (~> 1.6) - rdf (~> 1.1, >= 1.1.11) - rdf-aggregate-repo (~> 1.1) - rdf-isomorphic (~> 1.1) + rdf (~> 1.99) + rdf-aggregate-repo (~> 1.99) + rdf-isomorphic (~> 1.99) rdf-json (~> 1.1, >= 1.1.2) - rdf-microdata (~> 2.0, >= 2.0.1) - rdf-n3 (~> 1.1, >= 1.1.3) - rdf-rdfa (~> 1.1, >= 1.1.6) - rdf-rdfxml (~> 1.1, >= 1.1.4) - rdf-reasoner (~> 0.2, >= 0.2.1) - rdf-tabular (~> 0.1, >= 0.1.2) - rdf-trig (~> 1.1, >= 1.1.4) - rdf-trix (~> 1.1) - rdf-turtle (~> 1.1, >= 1.1.6) - rdf-vocab (~> 0.8) - rdf-xsd (~> 1.1, >= 1.1.3) - sparql (~> 1.1, >= 1.1.5) - sparql-client (~> 1.1, >= 1.1.3) - listen (3.0.3) + rdf-microdata (~> 2.0, >= 2.0.2) + rdf-n3 (~> 1.99) + rdf-rdfa (~> 1.99) + rdf-rdfxml (~> 1.1, >= 1.1.5) + rdf-reasoner (~> 0.3) + rdf-tabular (~> 0.3) + rdf-trig (~> 1.99, >= 1.99.0.1) + rdf-trix (~> 1.99) + rdf-turtle (~> 1.99) + rdf-vocab (~> 0.8, >= 0.8.6) + rdf-xsd (~> 1.1, >= 1.1.5) + sparql (~> 1.99) + sparql-client (~> 1.99) + listen (3.0.5) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) lumberjack (1.0.9) method_source (0.8.2) mime-types (2.6.2) - mini_portile (0.6.0) - minitest (5.8.1) - msgpack (0.6.2) + mini_portile (0.6.2) + minitest (5.8.3) + msgpack (0.7.0) multi_json (1.11.2) multi_xml (0.5.5) - nanoc (3.8.0) + nanoc (4.0.0) cri (~> 2.3) nenv (0.2.0) net-http-persistent (2.9.4) - netrc (0.10.3) - nokogiri (1.6.3.1) - mini_portile (= 0.6.0) + netrc (0.11.0) + nokogiri (1.6.6.3) + mini_portile (~> 0.6.0) notiffany (0.0.8) nenv (~> 0.1) shellany (~> 0.0) + oj (2.13.1) optipng (0.2.1) command-builder (>= 0.2.0) unix-whereis (>= 0.1.0) @@ -142,56 +148,57 @@ GEM ffi (>= 1.0.6) msgpack (>= 0.4.3) trollop (>= 1.16.2) - rdf (1.1.17.1) + rdf (1.99.0) link_header (~> 0.0, >= 0.0.8) - rdf-aggregate-repo (1.1.0) - rdf (>= 1.1) - rdf-isomorphic (1.1.0.1) - rdf (~> 1.1, >= 1.1.16.1) - rdf-json (1.1.2) - rdf (~> 1.1) - rdf-microdata (2.0.1) + rdf-aggregate-repo (1.99.0) + rdf (~> 1.99) + rdf-isomorphic (1.99.0) + rdf (~> 1.99) + rdf-json (1.99.0) + rdf (~> 1.99) + rdf-microdata (2.0.2) htmlentities (~> 4.3) nokogiri (~> 1.6) rdf (~> 1.1) rdf-xsd (~> 1.1) - rdf-n3 (1.1.3) - rdf (~> 1.1, >= 1.1.5) - rdf-rdfa (1.1.6) + rdf-n3 (1.99.0) + rdf (~> 1.99) + rdf-rdfa (1.99.0) haml (~> 4.0) htmlentities (~> 4.3) - rdf (~> 1.1, >= 1.1.6) + rdf (~> 1.99) rdf-aggregate-repo (~> 1.1) rdf-xsd (~> 1.1) - rdf-rdfxml (1.1.4) + rdf-rdfxml (1.99.0) htmlentities (~> 4.3) - rdf (~> 1.1, >= 1.1.6) - rdf-rdfa (~> 1.1, >= 1.1.4.1) - rdf-xsd (~> 1.1) - rdf-reasoner (0.2.2) + rdf (~> 1.99) + rdf-rdfa (~> 1.99) + rdf-xsd (~> 1.99) + rdf-reasoner (0.3.0) rdf (~> 1.1, >= 1.1.4.2) rdf-turtle (~> 1.1) rdf-vocab (~> 0.8) rdf-xsd (~> 1.1) - rdf-tabular (0.2.1) + rdf-tabular (0.3.0) addressable (~> 2.3) bcp47 (~> 0.3, >= 0.3.3) json-ld (~> 1.1) rdf (~> 1.1, >= 1.1.7) + rdf-vocab (~> 0.8) rdf-xsd (~> 1.1) - rdf-trig (1.1.5) - ebnf (~> 0.3, >= 0.3.7) - rdf (~> 1.1, >= 1.1.11) - rdf-turtle (~> 1.1, >= 1.1.7) - rdf-trix (1.1.0) - rdf (>= 1.1) - rdf-turtle (1.1.8) - ebnf (~> 0.3, >= 0.3.6) - rdf (~> 1.1, >= 1.1.10) - rdf-vocab (0.8.6) + rdf-trig (1.99.0.1) + ebnf (~> 1.0) + rdf (~> 1.99) + rdf-turtle (~> 1.99) + rdf-trix (1.99.0) + rdf (~> 1.1) + rdf-turtle (1.99.0) + ebnf (~> 1.0) + rdf (~> 1.99) + rdf-vocab (0.8.7.1) rdf (~> 1.1, >= 1.1.10) - rdf-xsd (1.1.4) - rdf (~> 1.1, >= 1.1.9) + rdf-xsd (1.99.0) + rdf (~> 1.99) rest-client (1.8.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) @@ -206,15 +213,15 @@ GEM httparty (= 0.13.0) json (= 1.8.1) slop (3.6.0) - sparql (1.1.9) + sparql (1.99.0) builder (~> 3.2) - ebnf (~> 0.3, >= 0.3.9) - rdf (~> 1.1, >= 1.1.13) - rdf-aggregate-repo (~> 1.1, >= 1.1.0) + ebnf (~> 1.0) + rdf (~> 1.99) + rdf-aggregate-repo (~> 1.99) rdf-xsd (~> 1.1) sparql-client (~> 1.1) sxp (~> 0.1) - sparql-client (1.1.6) + sparql-client (1.99.0) net-http-persistent (~> 2.9) rdf (~> 1.1) sxp (0.1.5) @@ -254,11 +261,12 @@ DEPENDENCIES html5small html_spellchecker json + jsonlint jwt (~> 0.1) kramdown linkeddata nanoc - nokogiri (= 1.6.3.1) + nokogiri optipng rainpress rbtrace diff --git a/Rules b/Rules index c3070d53..0d9f1544 100644 --- a/Rules +++ b/Rules @@ -5,28 +5,15 @@ require './environment' Compass.add_project_configuration 'compass/config.rb' -# A few helpful tips about the Rules file: -# -# * The string given to #compile and #route are matching patterns for -# identifiers--not for paths. Therefore, you can’t match on extension. -# -# * The order of rules is important: for each item, only the first matching -# rule is applied. -# -# * Item identifiers start and end with a slash (e.g. “/about/” for the file -# “content/about.html”). To select all children, grandchildren, … of an -# item, use the pattern “/about/*/”; “/about/*” will also select the parent, -# because “*” matches zero or more characters. - preprocess do # Creates in-memory tag pages from partial: layouts/tag.html def generate_tag_pages tag_set(publishing_articles).each do |tag| - items << Nanoc::Item.new( - "<%= render('tag', { :tag => '#{tag}', :semantic_tag => SEMANTIC_TAGS['#{tag}'] }) %>", + @items.create( + "<%= render('/tag.*', { :tag => '#{tag}', :semantic_tag => SEMANTIC_TAGS['#{tag}'] }) %>", { :title => "Tag: #{tag}", :is_hidden => true, :description => "All posts having to do with the tag '#{tag}'" }, - "/tags/#{tag.to_slug}/", + "/tags/#{tag.to_slug}/index.html", :binary => false ) end @@ -35,10 +22,10 @@ preprocess do # Creates in-memory author pages from partial: layouts/author.html def generate_author_pages authors(publishing_articles).each do |author| - items << Nanoc::Item.new( - "<%= render('author', :author => '#{author}') %>", + @items.create( + "<%= render('/author.*', :author => '#{author}') %>", { :title => "Articles by #{author}", :is_hidden => true }, - "/authors/#{author.to_slug}/", + "/authors/#{author.to_slug}/index.html", :binary => false ) end @@ -49,10 +36,10 @@ preprocess do def generate_blog_archives years = publishing_articles.map { |a| a[:created_at].year }.uniq years.each do |year| - items << Nanoc::Item.new( - "<%= render('blog_archive', :year => #{year}) %>", + @items.create( + "<%= render('/blog_archive.*', :year => #{year}) %>", { :title => "Articles from #{year}", :is_hidden => true }, - "/blog/#{year}/", + "/blog/#{year}/index.html", :binary => false ) end @@ -99,7 +86,7 @@ preprocess do def extract_metadata_from_specification_documents require 'nokogiri' - @items.select { |i| i.identifier.start_with?("/spec/") }.each do |item| + @items.select { |i| i.identifier.to_s.start_with?("/spec/") }.each do |item| case item[:extension] when 'html' doc = Nokogiri::HTML(File.open(item[:filename])) @@ -119,17 +106,12 @@ preprocess do extract_metadata_from_specification_documents end -### Compilation Rules ################################################### +ignore '/css/partials/_*' +ignore '/css/modules/_*' -compile '/css/partials/_*/' do - # don't compile partials -end - -compile '/css/modules/_*/' do - # don't compile modules -end +### Compilation Rules ################################################### -compile '/css/*/' do +compile '/css/*.scss' do filter :sass, Compass.sass_engine_options if $use_minified_css then @@ -137,174 +119,158 @@ compile '/css/*/' do end end -compile '/static/*/' do +compile '/static/**/*' do # don't compile end -compile '/spec/*', :rep => :jsonld do - if item[:extension] == 'ttl' - filter :rdf_distiller, :in => :ttl, :out => :jsonld - end +compile '/spec/**/*.ttl', :rep => :jsonld do + filter :rdf_distiller, :in => :ttl, :out => :jsonld end -compile '/spec/*', :rep => :rdfxml do - if item[:extension] == 'ttl' - filter :rdf_distiller, :in => :ttl, :out => :rdfxml - end +compile '/spec/**/*.ttl', :rep => :rdfxml do + filter :rdf_distiller, :in => :ttl, :out => :rdfxml end -compile '/spec/*' do +compile '/spec/**/*' do # don't compile the rest of spec. This submodule needs to be independent. end -compile '/js/search-data/' do +compile '/js/search-data.js' do filter :erb if $use_minified_js then filter :uglify_js end end -compile '/js/*/' do +compile '/js/**/*.js' do if $use_minified_js then filter :uglify_js end end -compile '/blog/feed_private/' do +compile '/blog/feed_private.xml' do filter :erb end -compile '/sitemap/' do +compile '/sitemap.xml' do filter :erb end -compile '/company/', :rep => :vcard do +compile '/company/index.*', :rep => :vcard do filter :vcard, @config[:vcard] end -compile '/company/', :rep => :qrcode do +compile '/company/index.*', :rep => :qrcode do filter :vcard, @config[:vcard] filter :qrcode, :size => 25, :module_size => 2, :color => "#544233" end -compile '*' do - if item.binary? - # don’t filter binary items - else - filter :erb +compile '/**/*.html' do + filter :erb - if item[:extension] == 'markdown' - filter :kramdown, @config[:kramdown] - end + if $spellcheck then + filter :spellchecker + end - if item[:kind] == 'article' && ($include_drafts or item[:published]) then - filter :absolutify_local_paths - layout 'article' - end + layout '/default.*' - if $spellcheck then - filter :spellchecker - end + filter :rubypantsunicode -# filter :add_links_to_headers + if $use_minified_html then + filter :html5small + end +end - layout 'default' +compile '/**/*.{markdown,md}' do + filter :erb + filter :kramdown, @config[:kramdown] - filter :rubypantsunicode + if item[:kind] == 'article' && ($include_drafts or item[:published]) then + filter :absolutify_local_paths + layout '/article.*' + end - if $use_minified_html then - filter :html5small - end + if $spellcheck then + filter :spellchecker end -end -### Routing Rules ################################################### + layout '/default.*' -route '/static/*' do - # /static/foo.html/ -> /foo.html - item.identifier[7..-2] -end + filter :rubypantsunicode -route '/css/partials/_*/' do - nil + if $use_minified_html then + filter :html5small + end end -route '/css/modules/_*/' do - nil +compile '/**/*' do end -route '/css/*/' do - # don't generate a directory like we do for HTML files - item.identifier.chop + '.css' +### Routing Rules ################################################### + +route '/static/**/*' do + # /static/foo.html/ → /foo.html + item.identifier.to_s.sub(/\A\/static/, '') end -route '/js/*/' do - # don't generate a directory like we do for HTML files - item.identifier.chop + '.js' +route '/css/*.scss' do + item.identifier.without_ext + '.css' end -route '/404/' do +route '/404.*' do '/404.html' end -route '/spec/README/' do +route '/spec/README' do '/spec/README.md' end -route '/spec/LICENSE/' do +route '/spec/LICENSE' do '/spec/LICENSE' end -route '/spec/css/*/' do - # don't generate a directory like we do for HTML files - item.identifier.chop + '.' + item[:extension] +route '/spec/**/*.ttl', :rep => :jsonld do + item.identifier.without_ext + '.jsonld' end -route '/spec/js/*/' do - # don't generate a directory like we do for HTML files - item.identifier.chop + '.js' +route '/spec/**/*.ttl', :rep => :rdfxml do + item.identifier.without_ext + '.rdf' end -route '/spec/*', :rep => :jsonld do - if item[:extension] == 'ttl' - item.identifier.chop + '.jsonld' - end +route '/blog/feed_private.xml' do + item.identifier.without_ext + '/index.atom' end -route '/spec/*', :rep => :rdfxml do - if item[:extension] == 'ttl' - item.identifier.chop + '.rdf' - end +route '/company/index.*', :rep => :vcard do + '/company/pentandra.vcf' end -route '/blog/feed_private/' do - item.identifier + 'index.atom' -end - -route '/sitemap/' do - item.identifier.chop + '.xml' -end - -route '/company/', :rep => :vcard do - item.identifier + 'pentandra.vcf' +route '/company/index.*', :rep => :qrcode do + '/images/pentandra-qrcode.png' end -route '/company/', :rep => :qrcode do - '/images/pentandra-qrcode.png' +route '/**/index.{html,markdown,md}' do + if item[:kind] == 'article' + if $include_drafts or item[:published] then + item.identifier.without_ext + '.html' + end + else + item.identifier.without_ext + '.html' + end end -route '*' do - if item.binary? || item[:extension] == 'ttl' - # Write item with identifier /foo/ to /foo.ext - item.identifier.chop + '.' + item[:extension] - elsif item[:kind] == 'article' +route '/**/*.{html,markdown,md}' do + if item[:kind] == 'article' if $include_drafts or item[:published] then - item.identifier + 'index.html' + item.identifier.without_ext + '/index.html' end else - # Write item with identifier /foo/ to /foo/index.html - item.identifier + 'index.html' + item.identifier.without_ext + '/index.html' end end -layout '*', :erb +route '/**/*' do + item.identifier.to_s +end + +layout '/**/*', :erb diff --git a/content/404.html b/content/404.html index 55485aa9..9453635a 100644 --- a/content/404.html +++ b/content/404.html @@ -111,12 +111,12 @@
<%= @items['/company/'][:mission] %>
+<%= @items['/company/index.*'][:mission] %>