Skip to content

Commit

Permalink
Be more abstract in what we ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
cdchapman committed Oct 22, 2016
1 parent 93f75b5 commit 8d8430c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Things to ignore globally
ignore '/**/_*'
ignore '/project/**/*'
ignore '/_*/**/*'
ignore '/**/README.md'

include_rules 'rules/javascripts'
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers/history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions lib/helpers/tagging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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}'" },
Expand Down
4 changes: 2 additions & 2 deletions lib/helpers/vocabulary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions nanoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down

0 comments on commit 8d8430c

Please sign in to comment.