Closed alexellison closed 10 years ago
Going to close this one out as discussed. It may not be a requirement and won't work as we intend because site.tags is a method, not a property. The code snippet below would work, for posterity.
class CollectionTags < Generator
def generate(site)
site.collections.each do |key, collection|
collection.docs.each do |item|
if item.data['tags']
item.data['tags'].each do |tag|
site.tags << tag
end
end
end
end
end
Because we're storing press release and products in collecitons as opposed to keeping them in the
_posts
dir where blogs sit, the tags specified in their frontmatter are not making it into thesite.tags
variable.In order to get the tags specified by collection items (in addition to _posts) added to the site.tags hash I started writing some custom code that, but could not successfully modify the site.tags element.
@levelos check out the
tags-from-collections
branch and see my latest commit (5d06346a038691c149fb5c5a0917c0812857e65f) for the first try at modifyingsite.tags
.