Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow excerpts to be generated for Page objects (#7642)
Merge pull request 7642
- Loading branch information
Showing
6 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
module Jekyll | ||
class PageExcerpt < Excerpt | ||
attr_reader :output, :doc | ||
alias_method :id, :relative_path | ||
|
||
# The Liquid representation of this instance is simply the rendered output string. | ||
alias_method :to_liquid, :output | ||
|
||
def initialize(doc) | ||
super | ||
self.output = Renderer.new(site, self, site.site_payload).run | ||
end | ||
|
||
def render_with_liquid? | ||
return false if data["render_with_liquid"] == false | ||
|
||
Jekyll::Utils.has_liquid_construct?(content) | ||
end | ||
|
||
def inspect | ||
"#<#{self.class} id=#{id.inspect}>" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters