forked from github/pelican
readers: Add 'static' to the base Reader's extensions
Instead of just being a base class, we can use it to parse static files. It won't actually do any parsing, but we will get path metadata extraction from read_file, and this will make the StaticGenerator implementation simpler.
This commit is contained in:
parent
90822de962
commit
f147d9ec4a
1 changed files with 8 additions and 1 deletions
|
|
@ -44,6 +44,7 @@ METADATA_PROCESSORS = {
|
|||
|
||||
class Reader(object):
|
||||
enabled = True
|
||||
file_extensions = ['static']
|
||||
extensions = None
|
||||
|
||||
def __init__(self, settings):
|
||||
|
|
@ -54,6 +55,12 @@ class Reader(object):
|
|||
return METADATA_PROCESSORS[name](value, self.settings)
|
||||
return value
|
||||
|
||||
def read(self, source_path):
|
||||
"No-op parser"
|
||||
content = None
|
||||
metadata = {}
|
||||
return content, metadata
|
||||
|
||||
|
||||
class _FieldBodyTranslator(HTMLTranslator):
|
||||
|
||||
|
|
@ -311,7 +318,7 @@ class AsciiDocReader(Reader):
|
|||
|
||||
EXTENSIONS = {}
|
||||
|
||||
for cls in Reader.__subclasses__():
|
||||
for cls in [Reader] + Reader.__subclasses__():
|
||||
for ext in cls.file_extensions:
|
||||
EXTENSIONS[ext] = cls
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue