Class: Jekyll::TocTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll-toc.rb

Instance Method Summary collapse

Instance Method Details

#render(context) ⇒ Object



8
9
10
11
12
# File 'lib/jekyll-toc.rb', line 8

def render(context)
  return unless context.registers[:page]['toc'] == true
  content_html = context.registers[:page].content
  ::Jekyll::TableOfContents::Parser.new(content_html).build_toc
end