Add PageWithoutAFile class from jekyll plugins (#6556)

Merge pull request 6556
This commit is contained in:
ashmaroli
2017-11-30 23:46:35 +05:30
committed by Frank Taillandier
parent e3b8ba33da
commit 65f7deca98
4 changed files with 184 additions and 0 deletions

View File

@@ -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"

View 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