Split up development pages
This commit is contained in:
parent
8bee265142
commit
a4adf87fe3
36 changed files with 372 additions and 286 deletions
19
plugins/active_link.rb
Normal file
19
plugins/active_link.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
require 'pry'
|
||||
|
||||
module Jekyll
|
||||
class ActiveLinkTag < Liquid::Tag
|
||||
def initialize(tag_name, text, token)
|
||||
super
|
||||
parts = text.split(' ', 2)
|
||||
@href = parts[0]
|
||||
@title = parts[1]
|
||||
end
|
||||
|
||||
def render(context)
|
||||
cls = @href == context.registers[:page]["url"] ? "class='active'" : ''
|
||||
"<a #{cls} href='#{@href}'>#{@title}</a>"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('active_link', Jekyll::ActiveLinkTag)
|
Loading…
Add table
Add a link
Reference in a new issue