Skip to content

Commit

Permalink
Add a new theme "martyalchin", based on http://martyalchin.com
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Metaireau committed Nov 8, 2010
1 parent 5a9dbca commit 35dc0bf
Show file tree
Hide file tree
Showing 12 changed files with 468 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/pelican
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if __name__ == '__main__':

generator = Generator(args.settings, args.path, args.theme,
args.output, markup)
clean_output_dir(args.output)
clean_output_dir(generator.output_path)

processors = [ArticlesProcessor, PagesProcessor, StaticProcessor]
if generator.settings['PDF_PROCESSOR']:
Expand Down
13 changes: 9 additions & 4 deletions pelican/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ def __init__(self, settings=None, path=None, theme=None, output_path=None,
self.output_path = os.path.realpath(output_path)
self.markup = markup or self.settings['MARKUP']

if not os.path.exists(self.theme):
theme_path = os.sep.join([os.path.dirname(
os.path.abspath(__file__)), "themes/%s" % self.theme])
if os.path.exists(theme_path):
self.theme = theme_path
else:
raise Exception("Impossible to find the theme %s" % self.theme)

if 'SITEURL' not in self.settings:
self.settings['SITEURL'] = self.output_path

Expand Down Expand Up @@ -102,10 +110,7 @@ def generate_file(self, name, template, context, **kwargs):
print u' [ok] writing %s' % filename

def get_templates(self):
"""Return the templates to use.
:param path: the path to load the templates from
"""
"""Return the templates to use."""
path = os.path.expanduser(os.path.join(self.theme, 'templates'))
env = Environment(loader=FileSystemLoader(path))
templates = {}
Expand Down
Loading

0 comments on commit 35dc0bf

Please sign in to comment.