mirror of
https://github.com/jekyll/jekyll.git
synced 2026-02-04 11:45:03 -05:00
Add PageWithoutAFile class from jekyll plugins (#6556)
Merge pull request 6556
This commit is contained in:
committed by
Frank Taillandier
parent
e3b8ba33da
commit
65f7deca98
@@ -61,6 +61,7 @@ module Jekyll
|
||||
autoload :ThemeAssetsReader, "jekyll/readers/theme_assets_reader"
|
||||
autoload :LogAdapter, "jekyll/log_adapter"
|
||||
autoload :Page, "jekyll/page"
|
||||
autoload :PageWithoutAFile, "jekyll/page_without_a_file"
|
||||
autoload :PluginManager, "jekyll/plugin_manager"
|
||||
autoload :Publisher, "jekyll/publisher"
|
||||
autoload :Reader, "jekyll/reader"
|
||||
|
||||
18
lib/jekyll/page_without_a_file.rb
Normal file
18
lib/jekyll/page_without_a_file.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Jekyll
|
||||
# A Jekyll::Page subclass to handle processing files without reading it to
|
||||
# determine the page-data and page-content based on Front Matter delimiters.
|
||||
#
|
||||
# The class instance is basically just a bare-bones entity with just
|
||||
# attributes "dir", "name", "path", "url" defined on it.
|
||||
class PageWithoutAFile < Page
|
||||
def read_yaml(*)
|
||||
@data ||= {}
|
||||
end
|
||||
|
||||
def inspect
|
||||
"#<Jekyll:PageWithoutAFile @name=#{name.inspect}>"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user