Class: Jekyll::LinkedPosts
- Inherits:
-
Object
- Object
- Jekyll::LinkedPosts
- Defined in:
- lib/jekyll/linked_posts.rb
Overview
Link posts by a field value, ideally an UUID
Constant Summary collapse
- FIELDS =
Default linked fields
%w[lang related].freeze
- INDEXABLE_TYPES =
Value types allowed to index by
[String, Integer].freeze
Instance Attribute Summary collapse
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
-
#initialize(site) ⇒ LinkedPosts
constructor
A new instance of LinkedPosts.
-
#read ⇒ Object
Process all the documents from the site and replace the UUID for the actual post.
Constructor Details
#initialize(site) ⇒ LinkedPosts
Returns a new instance of LinkedPosts.
13 14 15 |
# File 'lib/jekyll/linked_posts.rb', line 13 def initialize(site) @site = site end |
Instance Attribute Details
#site ⇒ Object (readonly)
Returns the value of attribute site.
11 12 13 |
# File 'lib/jekyll/linked_posts.rb', line 11 def site @site end |
Instance Method Details
#read ⇒ Object
Process all the documents from the site and replace the UUID for the actual post.
If it doesn’t find anything it’ll show a warning and replace the value for nil.
22 23 24 25 26 |
# File 'lib/jekyll/linked_posts.rb', line 22 def read indexable_documents.each do |doc| process doc end end |