Class: JekyllHighlightCards::FreezeArchives::MarkupAnalyzer
- Inherits:
-
Object
- Object
- JekyllHighlightCards::FreezeArchives::MarkupAnalyzer
- Includes:
- ArchiveHelper, ExpressionEvaluator
- Defined in:
- lib/jekyll-highlight-cards/freeze_archives/markup_analyzer.rb
Overview
Classify {% linkcard %} / {% polaroid %} markup for freeze-archives.
A freeze candidate is a tag that has a literal archiveable target URL and
does not already encode an archive (archive: / archive= / none).
Liquid-dynamic targets are skipped (build-time fallback remains).
Instance Method Summary collapse
-
#analyze(tag, markup) ⇒ Hash?
Analyze tag markup for freeze eligibility.
-
#initialize(site: nil) ⇒ MarkupAnalyzer
constructor
A new instance of MarkupAnalyzer.
Methods included from ExpressionEvaluator
#evaluate_expression, #log_debug, #log_error, #log_info, #log_warn, #quote_wrapped?, #strip_outer_quotes, #variable_lookup?
Methods included from ArchiveHelper
#archive_enabled?, #archive_save_enabled?, #archive_url_for, #archive_user_agent
Constructor Details
#initialize(site: nil) ⇒ MarkupAnalyzer
Returns a new instance of MarkupAnalyzer.
15 16 17 |
# File 'lib/jekyll-highlight-cards/freeze_archives/markup_analyzer.rb', line 15 def initialize(site: nil) @site = site end |
Instance Method Details
#analyze(tag, markup) ⇒ Hash?
Analyze tag markup for freeze eligibility
24 25 26 27 28 29 30 31 |
# File 'lib/jekyll-highlight-cards/freeze_archives/markup_analyzer.rb', line 24 def analyze(tag, markup) case tag.to_s when "linkcard" analyze_linkcard(markup) when "polaroid" analyze_polaroid(markup) end end |