capitalize all required parts
This commit is contained in:
parent
3bda9bc5b2
commit
4b06c40575
2 changed files with 7 additions and 2 deletions
|
@ -18,6 +18,7 @@ module ArchiveHelper
|
||||||
Set.new(items
|
Set.new(items
|
||||||
.find_all('/blog/*/*')
|
.find_all('/blog/*/*')
|
||||||
.flat_map { |i| i[:tags] || [] })
|
.flat_map { |i| i[:tags] || [] })
|
||||||
|
.map{ |y| y.split.map(&:capitalize).join(' ') }
|
||||||
.to_a
|
.to_a
|
||||||
.sort
|
.sort
|
||||||
.uniq.map { |y| [y, items["/blog/#{y.gsub(' ', '_')}.html"]]}
|
.uniq.map { |y| [y, items["/blog/#{y.gsub(' ', '_')}.html"]]}
|
||||||
|
@ -35,7 +36,7 @@ module ArchiveHelper
|
||||||
def posts_with_tag(tag)
|
def posts_with_tag(tag)
|
||||||
items
|
items
|
||||||
.find_all('/blog/*/*')
|
.find_all('/blog/*/*')
|
||||||
.filter{|i| (i[:tags] || []).include? tag }
|
.filter{|i| (i[:tags] || []).map{ |t| t.split.map(&:capitalize).join(' ') }.include? tag }
|
||||||
end
|
end
|
||||||
|
|
||||||
def posts_in_year_or_with_tag(item)
|
def posts_in_year_or_with_tag(item)
|
||||||
|
|
|
@ -17,6 +17,7 @@ module EventsHelper
|
||||||
Set.new(items
|
Set.new(items
|
||||||
.find_all('/events/*/*')
|
.find_all('/events/*/*')
|
||||||
.flat_map { |i| i[:tags] || [] })
|
.flat_map { |i| i[:tags] || [] })
|
||||||
|
.map{ |y| y.split.map(&:capitalize).join(' ') }
|
||||||
.to_a
|
.to_a
|
||||||
.sort
|
.sort
|
||||||
.uniq.map { |y| [y, items["/events/#{y.gsub(' ', '_')}.html"]]}
|
.uniq.map { |y| [y, items["/events/#{y.gsub(' ', '_')}.html"]]}
|
||||||
|
@ -24,7 +25,10 @@ module EventsHelper
|
||||||
|
|
||||||
def all_events_by_tag(tag = nil, soon = nil)
|
def all_events_by_tag(tag = nil, soon = nil)
|
||||||
@items.find_all('/events/*/*.md')
|
@items.find_all('/events/*/*.md')
|
||||||
.filter{|i| (i[:tags] || []).include? tag }
|
.filter { |i|
|
||||||
|
(i[:tags] || [])
|
||||||
|
.map{ |t| t.split.map(&:capitalize).join(' ') }
|
||||||
|
.include? tag }
|
||||||
.select { |x| x[:soon] == soon }
|
.select { |x| x[:soon] == soon }
|
||||||
.sort_by { |x| x[:time] }
|
.sort_by { |x| x[:time] }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue