mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
paths for finding articles and pages are now parametrable
This commit is contained in:
parent
012caed1dc
commit
0ca9997e10
2 changed files with 10 additions and 4 deletions
|
|
@ -211,10 +211,10 @@ class ArticlesGenerator(Generator):
|
||||||
def generate_context(self):
|
def generate_context(self):
|
||||||
"""change the context"""
|
"""change the context"""
|
||||||
|
|
||||||
# return the list of files to use
|
|
||||||
files = self.get_files(self.path, exclude=['pages', ])
|
|
||||||
all_articles = []
|
all_articles = []
|
||||||
for f in files:
|
for f in self.get_files(
|
||||||
|
os.path.join(self.path, self.settings['ARTICLE_DIR']),
|
||||||
|
exclude=self.settings['ARTICLE_EXCLUDES']):
|
||||||
try:
|
try:
|
||||||
content, metadata = read_file(f, settings=self.settings)
|
content, metadata = read_file(f, settings=self.settings)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
@ -316,7 +316,9 @@ class PagesGenerator(Generator):
|
||||||
|
|
||||||
def generate_context(self):
|
def generate_context(self):
|
||||||
all_pages = []
|
all_pages = []
|
||||||
for f in self.get_files(os.sep.join((self.path, 'pages'))):
|
for f in self.get_files(
|
||||||
|
os.path.join(self.path, self.settings['PAGE_DIR']),
|
||||||
|
exclude=self.settings['PAGE_EXCLUDES']):
|
||||||
try:
|
try:
|
||||||
content, metadata = read_file(f)
|
content, metadata = read_file(f)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@ from pelican import log
|
||||||
DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),
|
DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)),
|
||||||
"themes/notmyidea"])
|
"themes/notmyidea"])
|
||||||
_DEFAULT_CONFIG = {'PATH': None,
|
_DEFAULT_CONFIG = {'PATH': None,
|
||||||
|
'ARTICLE_DIR': '',
|
||||||
|
'ARTICLE_EXCLUDES': ('pages',),
|
||||||
|
'PAGE_DIR': 'pages',
|
||||||
|
'PAGE_EXCLUDES': (),
|
||||||
'THEME': DEFAULT_THEME,
|
'THEME': DEFAULT_THEME,
|
||||||
'OUTPUT_PATH': 'output/',
|
'OUTPUT_PATH': 'output/',
|
||||||
'MARKUP': ('rst', 'md'),
|
'MARKUP': ('rst', 'md'),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue