From 8d8430cf3886ae5b73d95edb1704d2b832c77f31 Mon Sep 17 00:00:00 2001 From: Chris Chapman Date: Sat, 22 Oct 2016 12:33:26 -0600 Subject: [PATCH] Be more abstract in what we ignore --- Rules.rb | 2 +- lib/helpers/history.rb | 2 +- lib/helpers/tagging.rb | 6 +++--- lib/helpers/vocabulary.rb | 4 ++-- nanoc.yaml | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Rules.rb b/Rules.rb index 487040c8..3bdb4ec7 100644 --- a/Rules.rb +++ b/Rules.rb @@ -2,7 +2,7 @@ # Things to ignore globally ignore '/**/_*' -ignore '/project/**/*' +ignore '/_*/**/*' ignore '/**/README.md' include_rules 'rules/javascripts' diff --git a/lib/helpers/history.rb b/lib/helpers/history.rb index 6a10b243..009c3559 100644 --- a/lib/helpers/history.rb +++ b/lib/helpers/history.rb @@ -14,7 +14,7 @@ def fetch_git_tag(exact_match: false) end def sorted_dependencies - @items.find_all('/project/dependencies/*').sort_by(&:identifier) + @items.find_all('/_project/dependencies/*').sort_by(&:identifier) end end diff --git a/lib/helpers/tagging.rb b/lib/helpers/tagging.rb index 11e47d77..865f574f 100644 --- a/lib/helpers/tagging.rb +++ b/lib/helpers/tagging.rb @@ -22,7 +22,7 @@ def tag_set(items = nil) end def tags - blk = -> { @items.find_all('/project/tags/*') } + blk = -> { @items.find_all('/_project/tags/*') } if @items.frozen? @tag_items ||= blk.call else @@ -53,7 +53,7 @@ def items_with_tag(tag, items = nil) # Returns a link to the specified tag. def link_for_tag(tag, rel_tag: true) if tag.is_a?(String) - tag = @items["/project/tags/#{tag.to_slug}"] + tag = @items["/_project/tags/#{tag.to_slug}"] raise ArgumentError, "Tag metadata does not yet exist in `etc/tags.yaml` for the tag '#{tag}'. Please add the tag first and then try again." unless tag end @@ -89,7 +89,7 @@ def parse_abstract(abstract) # Creates in-memory tag pages for a collection of items def generate_tag_pages(items = nil) items = @items if items.nil? - tag_set(items).map { |tag| @items["/project/tags/#{tag.to_slug}"] }.each do |tag| + tag_set(items).map { |tag| @items["/_project/tags/#{tag.to_slug}"] }.each do |tag| @items.create( %[<%= render("/blog/tag.*", tag: @items["#{tag.identifier}"]) %>], { title: "Tag: #{tag.fetch(:label, tag.raw_content)}", kind: "tag-page", is_hidden: true, description: "All posts having to do with the tag '#{tag.raw_content}'" }, diff --git a/lib/helpers/vocabulary.rb b/lib/helpers/vocabulary.rb index e1074221..756eb146 100644 --- a/lib/helpers/vocabulary.rb +++ b/lib/helpers/vocabulary.rb @@ -35,8 +35,8 @@ def prefix_mappings_for(*args) # # @return [Array, Hash] def vocabularies_for(name) - vocabs = @items.find_all("/project/vocabularies/#{name}/*") - vocabs.present? ? vocabs : @items["/project/vocabularies/*/#{name}"] + vocabs = @items.find_all("/_project/vocabularies/#{name}/*") + vocabs.present? ? vocabs : @items["/_project/vocabularies/*/#{name}"] end end diff --git a/nanoc.yaml b/nanoc.yaml index 8427a74e..523d869b 100644 --- a/nanoc.yaml +++ b/nanoc.yaml @@ -10,13 +10,13 @@ data_sources: content_dir: items - type: dependencies - items_root: /project + items_root: /_project - type: tags - items_root: /project + items_root: /_project - type: vocabularies - items_root: /project + items_root: /_project prefixes_used: standard: [ cc, ctag, dc, foaf, owl, prov, rdf, rdfs, schema, sioc, skos, xhv ] business: [ essglobal, fea, rov, vcard ]