1
0
mirror of https://github.com/bitwarden/help synced 2025-12-10 21:33:18 +00:00
Files
help/_plugins/callout.rb
David Choi 80a0b17ac6 Staging (#294)
* jekyll redirect from

* Organizations rev (#262)

* Organizations revisions initial commit.

* API doc updates

* Fix absolute link causing build failure.

* Add import to org article, and downstream order changes.

* Bitwarden 101 videos: 1st steps toward proliferating these throughout /help.

* Added 'Create Your Account' article, which references B101 Videos.

* About SSO redirect & promote importing for orgs up the list

* Create Org FAQs & trim Feature FAQs accordingly.

* Image for Org FAQs

* Move 'About the Business Portal' to Orgs category, and re-order accordingly.

* Final edits.

* Dchoi/bootstrap upgrade (#264)

* bootstrap 4 upgrade and cleanup update gulp tasks

* bootstrap package updates

* renaming file convention

* general outline of help outline

* bitwarden help cleanup

* article cleanup

* article general styling complete

* bootstrap help page upgrades

* sidebar updates

* Dchoi/bootstrap upgrade (#267)

* bootstrap 4 upgrade and cleanup update gulp tasks

* bootstrap package updates

* renaming file convention

* general outline of help outline

* bitwarden help cleanup

* article cleanup

* article general styling complete

* bootstrap help page upgrades

* sidebar updates

* toc dynamic and more updates

* fix callout conditions

* sidebar collapse functionality added

* sidebar header toggle functionality

* sidebar article fixes

* Update sidebar.html

Fix sidebar Release Notes link.

* Update releasenotes.md

Remove unnecessary category tag.

* Delete release-notes.md

Remove unnecessary category.

* Update why-choose-bitwarden-for-your-team.md

Test table image differentiation

* Update why-choose-bitwarden-for-your-team.md

Second image differentiation test

* removed links from category breadcrumb and replaced with badges

Co-authored-by: fred_the_tech_writer <69817454+fschillingeriv@users.noreply.github.com>
2020-11-13 14:23:00 -08:00

42 lines
1.1 KiB
Ruby

# Source: https://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.strip!
if %w(info warning success).include?(type)
@type = type
else
puts "#{type} callout not supported. Defaulting to info"
@type = "info"
end
if @type == 'warning'
@fa = 'warning'
@header = 'Warning'
elsif @type =='success'
@fa = 'lightbulb-o'
@header = 'Tip'
else
@fa = 'info-circle'
@header = 'Note'
end
end
def render(context)
site = context.registers[:site]
converter = site.find_converter_instance(::Jekyll::Converters::Markdown)
output = converter.convert(super(context))
"<div class=\"callout callout-#{@type}\">
<h5><i class=\"fa fa-#{@fa}\"></i> #{@header}</h5>
#{output}
</div>"
end
end
end
end
Liquid::Template.register_tag('callout', Jekyll::Tags::CalloutTag)