Redo all our callouts with the custom callout plugin
- Replaces manual use of .bd-callout with {% callout [type] %}
- Rearranged some callouts for proximity to others
- Turned long lists of callouts--like those on tooltips, plugings, etc--into a list because holy shit that's overwhelming
This commit is contained in:
parent
801d49fb32
commit
466d36e541
24 changed files with 367 additions and 296 deletions
29
docs/_plugins/callout.rb
Normal file
29
docs/_plugins/callout.rb
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Source: http://stackoverflow.com/questions/19169849/how-to-get-markdown-processed-content-in-jekyll-tag-plugin
|
||||
|
||||
module Jekyll
|
||||
module Tags
|
||||
class CalloutTag < Liquid::Block
|
||||
|
||||
def initialize(tag_name, type, tokens)
|
||||
super
|
||||
@type = type
|
||||
if type == "danger"
|
||||
@type = "danger"
|
||||
elsif type == "warning"
|
||||
@type = "warning"
|
||||
elsif type == "info"
|
||||
@type = "info"
|
||||
end
|
||||
end
|
||||
|
||||
def render(context)
|
||||
site = context.registers[:site]
|
||||
converter = site.getConverterImpl(::Jekyll::Converters::Markdown)
|
||||
output = converter.convert(super(context))
|
||||
"<div class=\"bd-callout bd-callout-#{@type}\">#{output}</div>"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('callout', Jekyll::Tags::CalloutTag)
|
||||
Loading…
Add table
Add a link
Reference in a new issue