Class: Jekyll::AgentMarkdown::DocumentExporter
- Inherits:
-
Object
- Object
- Jekyll::AgentMarkdown::DocumentExporter
- Includes:
- Filters::URLFilters
- Defined in:
- lib/jekyll/agent_markdown/document_exporter.rb
Defined Under Namespace
Classes: Contents
Instance Method Summary collapse
- #export(document, source_kind:, collection_name: nil) ⇒ Object
-
#initialize(site, settings, destination_claims, content_for_post:) ⇒ DocumentExporter
constructor
A new instance of DocumentExporter.
Constructor Details
#initialize(site, settings, destination_claims, content_for_post:) ⇒ DocumentExporter
Returns a new instance of DocumentExporter.
22 23 24 25 26 27 28 29 |
# File 'lib/jekyll/agent_markdown/document_exporter.rb', line 22 def initialize(site, settings, destination_claims, content_for_post:) @site = site @settings = settings @destination_claims = destination_claims @content_for_post = content_for_post @context = Liquid::Context.new({}, {}, { site: site }) @header = DocumentHeader.new(site, method(:relative_url)) end |
Instance Method Details
#export(document, source_kind:, collection_name: nil) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/jekyll/agent_markdown/document_exporter.rb', line 31 def export(document, source_kind:, collection_name: nil) # Opted-out and collided documents must not keep a stale or authored # value: the alternate-link tag reads it as proof of publication. document.data.delete("agent_markdown_url") document_settings = DocumentSettings.new( document, settings, source_kind: source_kind, collection_name: collection_name ) return unless document_settings.export? claim_export(document, source_kind, document_settings) end |