Class: CS50::AlertBlock

Inherits:
Block
  • Object
show all
Defined in:
lib/jekyll-theme-cs50.rb

Instance Method Summary collapse

Methods included from Mixins

#initialize

Instance Method Details

#render(context) ⇒ Object



184
185
186
187
188
189
190
# File 'lib/jekyll-theme-cs50.rb', line 184

def render(context)
  html = CS50::convert(super)
  alert = (["primary", "secondary", "success", "danger", "warning", "info", "light", "dark"].include? @args[0]) ? @args[0] : ""
  "<div class='alert' data-alert='#{alert}' role='alert'>" \
    "#{html}" \
  "</div>"
end