Class: Jekyll::SeoTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::SeoTag
- Defined in:
- lib/starter_web/_plugins/seo/j1-seo-tags.rb,
lib/starter_web/_plugins/seo/j1-seo-tags.rb,
lib/starter_web/_plugins/seo/j1-seo-tags.rb,
lib/starter_web/_plugins/seo/j1-seo-tags.rb,
lib/starter_web/_plugins/seo/j1-seo-tags.rb,
lib/starter_web/_plugins/seo/j1-seo-tags.rb
Defined Under Namespace
Modules: UrlHelper Classes: AuthorDrop, Drop, Filters, ImageDrop, JSONLDDrop
Constant Summary collapse
- MINIFY_REGEX =
Matches all whitespace that follows either
1. A '}', which closes a Liquid tag 2. A '{', which opens a JSON block 3. A '>' followed by a newline, which closes an XML tag or 4. A ',' followed by a newline, which ends a JSON line
We will strip all of this whitespace to minify the template We will not strip any whitespace if the next character is a ‘-’
so that we do not interfere with the HTML comment at the very beginning
%r!(?<=[{}]|[>,]\n)\s+(?\!-)!.freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(_tag_name, text, _tokens) ⇒ SeoTag
constructor
A new instance of SeoTag.
- #render(context) ⇒ Object
Constructor Details
#initialize(_tag_name, text, _tokens) ⇒ SeoTag
Returns a new instance of SeoTag.
97 98 99 100 |
# File 'lib/starter_web/_plugins/seo/j1-seo-tags.rb', line 97 def initialize(_tag_name, text, _tokens) super @text = text end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
73 74 75 |
# File 'lib/starter_web/_plugins/seo/j1-seo-tags.rb', line 73 def context @context end |
Class Method Details
.template ⇒ Object
140 141 142 |
# File 'lib/starter_web/_plugins/seo/j1-seo-tags.rb', line 140 def template @template ||= Liquid::Template.parse template_contents end |