summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-12-22 23:23:27 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-12-22 23:23:27 -0500
commitdf82c975ee5cb6ff3000bca99b246d90e8be7eec (patch)
tree5cc59d115790af3322865e151e7529b60b684592
parente4de57c4077f74ec027e05d23dfee2d4b842276b (diff)
fix tag names in page titles
-rw-r--r--lib/category.rb2
-rw-r--r--lib/config.rb6
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/category.rb b/lib/category.rb
index e0ed8e0..8f14153 100644
--- a/lib/category.rb
+++ b/lib/category.rb
@@ -9,7 +9,7 @@ class Category
@abbr.downcase
end
def name
- Config::get.category_name(@abbr)
+ Config::get.category_name(abbr)
end
def html
return "<a class=\"tag #{abbr}\" href=\"/tags/#{abbr}.html\">#{name}</a>"
diff --git a/lib/config.rb b/lib/config.rb
index 4690559..57e3b3f 100644
--- a/lib/config.rb
+++ b/lib/config.rb
@@ -42,10 +42,8 @@ class Config
return @data['person_emails'][name]
end
# Categories
- def categories
- return @data['categories'].keys
- end
def category_name(abbr)
- return @data['categories'][abbr]
+ @categories ||= (@data['categories'] || {}).map{|k,v|[k.downcase,v]}.to_h
+ return @categories[abbr.downcase]
end
end