module Lucky::SpecialtyTags
Direct including types
Defined in:
lucky/tags/specialty_tags.crInstance Method Summary
-
#canonical_link(href : String) : Nil
Generates a canonical link tag to specify the "canonical" or "preferred" version of a page.
-
#css_link(href, **options) : Nil
Generates a link tag for a stylesheet at the path href.
-
#html_doctype : Nil
Generates an HTML5 doctype tag.
-
#js_link(src, **options) : Nil
Generates a script tag for a file at path src.
-
#nbsp(how_many : Int32 = 1) : Nil
Generates an escaped HTML
entity for the number of times specified byhow_many
. -
#raw(string : String) : Nil
Adds string directly to the rendered HTML with no escaping.
-
#responsive_meta_tag(**options) : Nil
Generates a meta tag telling browsers to render the page as wide as the device screen/window and at an initial scale of 1.
-
#utf8_charset : Nil
Generates a meta tag to specify the character encoding as UTF-8.
Instance Method Detail
Generates a canonical link tag to specify the "canonical" or "preferred" version of a page.
Generates a link tag for a stylesheet at the path href.
Additional tag attributes can be passed in keyword arguments via options.
Generates a script tag for a file at path src.
Additional tag attributes can be passed in as keyword arguments via options.
Generates an escaped HTML
entity for the number of times specified
by how_many
. By default it generates 1 non-breaking space character.
link "Home", to: Home::Index
span do
nbsp
text "|"
nbsp
end
link "About", to: About::Index
Would generate <a href="/">Home</a><span> | </span><a href="/about">About</a>
Adds string directly to the rendered HTML with no escaping.
For example,
raw "<hopefully-something-safe>" # Renders "<hopefully-something-safe>"
For custom elements, it's recommended to use the tag
method.
NOTE Should never be used to render unescaped user-generated data, as this can leave one vulnerable to cross-site scripting attacks.
Generates a meta tag telling browsers to render the page as wide as the device screen/window and at an initial scale of 1.
Optional keyword arguments can be used to override these defaults, as well as specify additional properties. Please refer to MDN's documentation on the viewport meta tag for usage details.
Generates a meta tag to specify the character encoding as UTF-8.
It is highly encouraged to specify the character encoding as early in a
page's <head>
as possible as some browsers only look at the first 1024
bytes to determine the encoding.