Module: Bootstrap::Generators::CdnTags
- Included in:
- CdnGenerator, LayoutGenerator, StarterGenerator
- Defined in:
- lib/generators/bootstrap/cdn_tags.rb
Overview
Renders the jsDelivr tags from the Introduction page, built from the constants in Twitter::Bootstrap::Rails so no template hardcodes a version or an integrity hash.
Instance Method Summary collapse
- #bundle_tag ⇒ Object
- #css_tag ⇒ Object
- #js_tag ⇒ Object
- #popper_tag ⇒ Object
-
#separate_popper_tags ⇒ Object
Popper and bootstrap.js as the separate pair, in the docs' order.
Instance Method Details
#bundle_tag ⇒ Object
14 15 16 |
# File 'lib/generators/bootstrap/cdn_tags.rb', line 14 def bundle_tag script_tag(:bundle) end |
#css_tag ⇒ Object
9 10 11 12 |
# File 'lib/generators/bootstrap/cdn_tags.rb', line 9 def css_tag entry = cdn(:css) %{<link href="#{entry[:url]}" rel="stylesheet" integrity="#{entry[:integrity]}" crossorigin="anonymous">} end |
#js_tag ⇒ Object
18 19 20 |
# File 'lib/generators/bootstrap/cdn_tags.rb', line 18 def js_tag script_tag(:js) end |
#popper_tag ⇒ Object
22 23 24 |
# File 'lib/generators/bootstrap/cdn_tags.rb', line 22 def popper_tag script_tag(:popper) end |
#separate_popper_tags ⇒ Object
Popper and bootstrap.js as the separate pair, in the docs' order.
27 28 29 |
# File 'lib/generators/bootstrap/cdn_tags.rb', line 27 def [popper_tag, js_tag].join("\n") end |