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
- SCHEMA_LINKED_FIELD_TYPES =
Field types that link to other documents on Sutty schemas.
%w[ locales related_posts belongs_to has_many has_one has_and_belongs_to_many new_belongs_to new_has_many new_has_one new_has_and_belongs_to_many ].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.
20 21 22 |
# File 'lib/jekyll/linked_posts.rb', line 20 def initialize(site) @site = site end |
Instance Attribute Details
#site ⇒ Object (readonly)
Returns the value of attribute site.
18 19 20 |
# File 'lib/jekyll/linked_posts.rb', line 18 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.
29 30 31 32 33 |
# File 'lib/jekyll/linked_posts.rb', line 29 def read indexable_documents.each do |doc| process doc end end |