Class: Jekyll::Llms::Entry
- Inherits:
-
Object
- Object
- Jekyll::Llms::Entry
- Defined in:
- lib/jekyll/llms/entry.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#section ⇒ Object
readonly
Returns the value of attribute section.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #description ⇒ Object
- #enabled? ⇒ Boolean
- #excluded_by?(patterns) ⇒ Boolean
-
#initialize(site:, item:, section:) ⇒ Entry
constructor
A new instance of Entry.
- #markdown_source? ⇒ Boolean
- #title ⇒ Object
Constructor Details
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
6 7 8 |
# File 'lib/jekyll/llms/entry.rb', line 6 def item @item end |
#section ⇒ Object (readonly)
Returns the value of attribute section.
6 7 8 |
# File 'lib/jekyll/llms/entry.rb', line 6 def section @section end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/jekyll/llms/entry.rb', line 6 def url @url end |
Instance Method Details
#description ⇒ Object
15 16 17 |
# File 'lib/jekyll/llms/entry.rb', line 15 def description item.data.fetch("description", "").strip end |
#enabled? ⇒ Boolean
19 20 21 |
# File 'lib/jekyll/llms/entry.rb', line 19 def enabled? item.data.fetch("llms", true) end |
#excluded_by?(patterns) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/jekyll/llms/entry.rb', line 27 def excluded_by?(patterns) patterns.any? do |pattern| url.matches?(pattern) end end |
#markdown_source? ⇒ Boolean
23 24 25 |
# File 'lib/jekyll/llms/entry.rb', line 23 def markdown_source? markdown_extensions.include?(File.extname(item.relative_path).delete_prefix(".")) end |
#title ⇒ Object
33 34 35 36 37 38 |
# File 'lib/jekyll/llms/entry.rb', line 33 def title title = item.data.fetch("title", "").strip return title unless title.empty? fallback_title end |