From: Ralf Jung Date: Sat, 2 Jan 2016 18:54:16 +0000 (+0100) Subject: make category code more readable X-Git-Url: https://git.ralfj.de/web.git/commitdiff_plain/9e7a7c7de4a90cdc636b2800931fb4d664d37fbf?ds=inline;hp=4d9c13e4b5c8fd488ab78ae72db7f095669fcb67 make category code more readable --- diff --git a/personal/_plugins/categories.rb b/personal/_plugins/categories.rb index 65776d7..4d08693 100644 --- a/personal/_plugins/categories.rb +++ b/personal/_plugins/categories.rb @@ -45,11 +45,9 @@ module Jekyll # # 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") "#{category.capitalize}" end