X-Git-Url: https://git.ralfj.de/web.git/blobdiff_plain/860f317515838546fab7f5f47b154192f3b52d9d..79a5dd1fee6c524d75aaed6e38d0e1440320a4b0:/ralf/_plugins/categories.rb?ds=sidebyside diff --git a/ralf/_plugins/categories.rb b/ralf/_plugins/categories.rb index 1da0fe1..83fef6e 100644 --- a/ralf/_plugins/categories.rb +++ b/ralf/_plugins/categories.rb @@ -9,9 +9,9 @@ module Jekyll self.process(@name) self.read_yaml(File.join(base, '_layouts'), layout) - self.data['category'] = category + self.data['category'] = category # this tells the site template to add a link to the RSS feed - category_title_prefix = site.config['blog']['category_title_prefix'] || 'Category: ' + category_title_prefix = site.config['blog']['title'] + ": " self.data['title'] = "#{category_title_prefix}#{category.capitalize}" end end @@ -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