projects
/
web.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
77f0d1b
)
make category code more readable
author
Ralf Jung
<post@ralfj.de>
Sat, 2 Jan 2016 18:54:16 +0000
(19:54 +0100)
committer
Ralf Jung
<post@ralfj.de>
Sat, 2 Jan 2016 18:54:16 +0000
(19:54 +0100)
personal/_plugins/categories.rb
patch
|
blob
|
history
diff --git
a/personal/_plugins/categories.rb
b/personal/_plugins/categories.rb
index 65776d72b067790e98677386f8df0f52c70ac1e9..4d08693c9ef574150d198c2f395ff834252ac660 100644
(file)
--- a/
personal/_plugins/categories.rb
+++ b/
personal/_plugins/categories.rb
@@
-45,11
+45,9
@@
module Jekyll
#
# Returns string
def category_links(categories)
#
# 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|
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
"<a class='category' href='#{category_url}'>#{category.capitalize}</a>"
end