summaryrefslogtreecommitdiff
path: root/_plugins/sidebar.rb
blob: 9f652cb2dfac02f803bd84c98934f2f0e52725f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Liquid
  class SidebarBlock < Liquid::Block
    alias :super_render :render

    def initialize(tag_name, identifier, tokens)
      super
    end

    def render(context)
      context.environments.first["page"]["sidebar"] = super_render(context)
      ''
    end
  end
end
puts "registering new sidebar template"
Liquid::Template.register_tag('sidebar', Liquid::SidebarBlock)