Skip to content

Commit

Permalink
add site:attr tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroedin committed Oct 28, 2014
1 parent cfea1e1 commit a9dc19a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions hammer/services/tags/basic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ class Basic < TagContainer
end
end

tag 'site' do |tag|
tag.locals.site ||= tag.globals.site
tag.expand
end

[:id, :name, :domain].each do |attr|
tag "site:#{attr.to_s}" do |tag|
# tag.locals.page.send(attr)
#{"}fix page:#{attr.to_s} tag"
if tag.globals.context.data && tag.globals.context.data['site'] && tag.globals.context.data['site'][attr.to_s]
tag.globals.context.data['site'][attr.to_s]
else
Hammer.error "Add key <em> page:#{attr}</em>"
end
end
end

# Returns the number of sites with the given status. Status can be one of: live, development,
# archived, active, all. Live and development sites are considered 'active'.
tag 'site_count' do |tag|
Expand Down

0 comments on commit a9dc19a

Please sign in to comment.