Class: Jekyll::SeoTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::SeoTag
- Defined in:
- lib/jekyll-seo-tag.rb,
lib/jekyll-seo-tag/drop.rb,
lib/jekyll-seo-tag/filters.rb,
lib/jekyll-seo-tag/json_ld.rb,
lib/jekyll-seo-tag/version.rb,
lib/jekyll-seo-tag/image_drop.rb,
lib/jekyll-seo-tag/url_helper.rb,
lib/jekyll-seo-tag/author_drop.rb,
lib/jekyll-seo-tag/json_ld_drop.rb
Defined Under Namespace
Modules: JSONLD, 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 begining
%r!(?<=[{}]|[>,]\n)\s+(?\!-)!.freeze
- VERSION =
"2.8.0"
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.
29 30 31 32 |
# File 'lib/jekyll-seo-tag.rb', line 29 def initialize(_tag_name, text, _tokens) super @text = text end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
16 17 18 |
# File 'lib/jekyll-seo-tag.rb', line 16 def context @context end |
Class Method Details
.template ⇒ Object
73 74 75 |
# File 'lib/jekyll-seo-tag.rb', line 73 def template @template ||= Liquid::Template.parse template_contents end |