#
# Returns string
def category_links(categories)
- base_dir = @context.registers[:site].config['blog']['category_dir']
+ cat_base_dir = File.join(@context.registers[:site].config['baseurl'], @context.registers[:site].config['blog']['category_dir'])
categories = categories.sort!.map do |category|
- category_url = File.join(base_dir, "#{category}.html")
- # Make sure the category directory begins with a slash.
- category_dir = "/#{category_dir}" unless category_dir =~ /^\//
+ category_url = File.join(cat_base_dir, "#{category}.html")
"<a class='category' href='#{category_url}'>#{category.capitalize}</a>"
end