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

If that didn't work

<% content_for :javascripts do %> - + + @@ -61,7 +61,7 @@

Recent Thoughts

- <% @site.publishing_articles[0, 5].each do |post| %> + <% publishing_articles[0, 5].each do |post| %>

<%= post[:short_title] || post[:title] %>

@@ -116,7 +116,7 @@

About Pentandra

Our Mission

-

<%= @items['/company/'][:mission] %>

+

<%= @items['/company/index.*'][:mission] %>

diff --git a/layouts/tag.html b/layouts/tag.html index b8fbde9a..907ddeb5 100644 --- a/layouts/tag.html +++ b/layouts/tag.html @@ -38,7 +38,7 @@

<%= tag %> Articles

<% items_with_tag(tag, publishing_articles).each do |article| %> -<%= render('header', :article => article) %> +<%= render('/header.*', :article => article) %> <% end %> -<%= render 'blog_meta' %> +<%= render '/blog_meta.*' %> diff --git a/lib/filters/rdfdistiller.rb b/lib/filters/rdfdistiller.rb index f69aa6c3..03317cca 100644 --- a/lib/filters/rdfdistiller.rb +++ b/lib/filters/rdfdistiller.rb @@ -10,13 +10,14 @@ def run(content, params={}) in_format = params[:in] || "turtle" out_format = params[:out] || "turtle" - base_uri = params[:base_uri] || @item[:base_uri] || @site.config[:base_url] + @item.path + base_uri = params[:base_uri] || @item[:base_uri] || @config[:base_url] + @item.path options = { standard_prefixes: true, prefixes: {}, base_uri: base_uri, validate: true, + simple_compact_iris: true, } graph = RDF::Repository.new diff --git a/lib/filters/vcard.rb b/lib/filters/vcard.rb index ad2f00f4..608a48d2 100644 --- a/lib/filters/vcard.rb +++ b/lib/filters/vcard.rb @@ -30,8 +30,8 @@ def run(content, params = {}) vcard.fullname full_name - if @site.config[:base_url] - vcard.source @site.config[:base_url] + @item_rep.path + if @config[:base_url] + vcard.source @config[:base_url] + @item_rep.path end #vcard.kind kind diff --git a/lib/helpers/blogging.rb b/lib/helpers/blogging.rb index 87301d64..e5f26f22 100644 --- a/lib/helpers/blogging.rb +++ b/lib/helpers/blogging.rb @@ -8,7 +8,7 @@ def publishing_articles if $include_drafts then sorted_articles else - sorted_articles.select { |a| a[:published] } + sorted_articles.select { |a| a[:published] } unless sorted_articles.nil? end end @@ -90,4 +90,3 @@ def article_id(article) end end - diff --git a/lib/helpers/link_to.rb b/lib/helpers/link_to.rb index 6165fee5..08ce3425 100644 --- a/lib/helpers/link_to.rb +++ b/lib/helpers/link_to.rb @@ -18,7 +18,7 @@ module LinkTo # @return [String] The absolute path to the target def absolute_path_to(item, target) - if @site.config[:base_url].nil? + if @config[:base_url].nil? raise Nanoc::Errors::GenericTrivial.new('Cannot build absolute path: site configuration has no base_url') end @@ -33,7 +33,7 @@ def absolute_path_to(item, target) end absolute_path = unstack(item.path, path) - absolute_path = @site.config[:base_url] + absolute_path + absolute_path = @config[:base_url] + absolute_path absolute_path end diff --git a/lib/helpers/search.rb b/lib/helpers/search.rb index 35215b83..b5854dff 100644 --- a/lib/helpers/search.rb +++ b/lib/helpers/search.rb @@ -39,7 +39,7 @@ module Search def search_terms_for(item) if item.identifier !~ /^\/(js|css|404)/ - content = item.rep_named(:default).compiled_content + content = item.reps[:default].compiled_content doc = Nokogiri::HTML(content) full_text = doc.css("p, h1, h2, h3, h4, h5, h6").map{|el| el.inner_text}.join(" ") "#{item[:title]} #{item[:meta_description]} #{full_text}".gsub(/[\W\s_]+/m,' ').downcase.split(/\s+/).uniq - STOP_WORDS diff --git a/nanoc.yaml b/nanoc.yaml index 2ea028a2..83bcf0d2 100644 --- a/nanoc.yaml +++ b/nanoc.yaml @@ -1,10 +1,15 @@ # Site version. Used for cache busting as well as for general information. version: 1.19.0 -# A list of file extensions that nanoc will consider to be textual rather than +# The syntax to use for patterns in the Rules file. Can be either `"glob"` +# (default) or `"legacy"`. The former will enable glob patterns, which behave +# like Ruby’s File.fnmatch. The latter will enable Nanoc 3.x-style patterns. +string_pattern_type: glob + +# A list of file extensions that Nanoc will consider to be textual rather than # binary. If an item with an extension not in this list is found, the file # will be considered as binary. -text_extensions: [ 'css', 'erb', 'haml', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'php', 'rb', 'sass', 'scss', 'txt', 'xhtml', 'xml', 'ttl' ] +text_extensions: [ 'coffee', 'css', 'erb', 'haml', 'handlebars', 'hb', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'ms', 'mustache', 'php', 'rb', 'rdoc', 'sass', 'scss', 'slim', 'txt', 'xhtml', 'xml', 'ttl' ] # The path to the directory where all generated files will be written to. This # can be an absolute path starting with a slash, but it can also be path @@ -13,8 +18,8 @@ output_dir: output # A list of index filenames, i.e. names of files that will be served by a web # server when a directory is requested. Usually, index files are named -# “index.hml”, but depending on the web server, this may be something else, -# such as “default.htm”. This list is used by nanoc to generate pretty URLs. +# “index.html”, but depending on the web server, this may be something else, +# such as “default.htm”. This list is used by Nanoc to generate pretty URLs. index_filenames: [ 'index.html' ] # Whether or not to generate a diff of the compiled content when compiling a @@ -22,15 +27,24 @@ index_filenames: [ 'index.html' ] # before and after the last site compilation. enable_output_diff: true -# The data sources where nanoc loads its data from. This is an array of +prune: + # Whether to automatically remove files not managed by Nanoc from the output + # directory. + auto_prune: true + + # Which files and directories you want to exclude from pruning. If you version + # your output directory, you should probably exclude VCS directories such as + # .git, .svn etc. + exclude: [ '.git', '.hg', '.svn', 'CVS' ] + +# The data sources where Nanoc loads its data from. This is an array of # 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. data_sources: - - # The type is the identifier of the data source. By default, this will be - # `filesystem_unified`. - type: filesystem_unified + # The type is the identifier of the data source. + type: filesystem # The path where items should be mounted (comparable to mount points in # Unix-like systems). This is “/” by default, meaning that items will have @@ -43,15 +57,35 @@ data_sources: # same as the items root, but applies to layouts rather than items. layouts_root: / - config: - allow_periods_in_identifiers: true + # The encoding to use for input files. If your input files are not in + # UTF-8 (which they should be!), change this. + encoding: utf-8 + + # The kind of identifier to use for items and layouts. The default is + # “full”, meaning that identifiers include file extensions. This can also + # be “legacy”, primarily used by older Nanoc sites. + identifier_type: full + - - type: static - items_root: /static/ + type: filesystem + items_root: /static + content_dir: 'static' + layouts_dir: null # Base URL, used for the Atom feed base_url: &base_url http://pentandra.com +# Configuration for the “check” command, which run unit tests on the site. +checks: + # Configuration for the “internal_links” checker, which checks whether all + # internal links are valid. + internal_links: + # A list of patterns, specified as regular expressions, to exclude from the check. + # If an internal link matches this pattern, the validity check will be skipped. + # E.g.: + # exclude: ['^/server_status'] + exclude: [] + # Configuration for the “watch” command, which watches a site for changes and # recompiles if necessary. watcher: