Merge branch 'master' of github.com:imathis/octopress
Conflicts: plugins/category_generator.rb
This commit is contained in:
commit
2fe9da91f5
27 changed files with 3374 additions and 1572 deletions
|
@ -113,7 +113,17 @@ module Jekyll
|
|||
|
||||
# Throw an exception if the layout couldn't be found.
|
||||
else
|
||||
throw "No 'category_index' layout found."
|
||||
raise <<-ERR
|
||||
|
||||
|
||||
===============================================
|
||||
Error for category_generator.rb plugin
|
||||
-----------------------------------------------
|
||||
No 'category_index.hmtl' in source/_layouts/
|
||||
Perhaps you haven't installed a theme yet.
|
||||
===============================================
|
||||
|
||||
ERR
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -143,10 +153,7 @@ module Jekyll
|
|||
# Returns string
|
||||
#
|
||||
def category_links(categories)
|
||||
dir = @context.registers[:site].config['category_dir']
|
||||
categories = categories.sort!.map do |item|
|
||||
"<a class='category' href='/#{dir}/#{item.to_url}/'>#{item}</a>"
|
||||
end
|
||||
categories = categories.sort!.map { |c| category_link c }
|
||||
|
||||
case categories.length
|
||||
when 0
|
||||
|
@ -158,6 +165,17 @@ module Jekyll
|
|||
end
|
||||
end
|
||||
|
||||
# Outputs a single category as an <a> link.
|
||||
#
|
||||
# +category+ is a category string to format as an <a> link
|
||||
#
|
||||
# Returns string
|
||||
#
|
||||
def category_link(category)
|
||||
dir = @context.registers[:site].config['category_dir']
|
||||
"<a class='category' href='/#{dir}/#{category.to_url}/'>#{category}</a>"
|
||||
end
|
||||
|
||||
# Outputs the post.date as formatted html, with hooks for CSS styling.
|
||||
#
|
||||
# +date+ is the date object to format as HTML.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue