Skip to content
Browse files

IMP provide a way to use custom layouts from outside the oak package

  • Loading branch information...
1 parent 9e4369b commit 7d9e4eb54d56cedad04fa499f530f98ba794b778 marc0s committed Aug 9, 2010
Showing with 5 additions and 5 deletions.
  1. +0 −1 TODO
  2. +4 −2 oak/launcher.py
  3. +1 −2 oak/settings.py
View
1 TODO
@@ -6,5 +6,4 @@ In no particular order...
* Create a script for extracting posts from wordpress (using python html2text)
* Add an authors page and a page per author
* Add some option to not re-generate already generated contents (or do that by default).
-* Provide the way to use custom templates outside the oak package
View
6 oak/launcher.py
@@ -60,8 +60,10 @@ def run(self, argv=None):
self.settings.DEFAULT_LAYOUT=options.layout
if options.destination:
self.settings.OUTPUT_PATH=options.destination
- # set the path to the layouts directory
- self.settings.LAYOUTS_PATH = os.path.sep.join([os.path.dirname(oak.__file__), self.settings.LAYOUTS_PATH])
+ # set the path to the layouts directory, if LAYOUTS_PATH is not absolute, use the layouts from the package
+ # TODO test!
+ if not os.path.isabs(self.settings.LAYOUTS_PATH):
+ self.settings.LAYOUTS_PATH = os.path.sep.join([os.path.dirname(oak.__file__), self.settings.LAYOUTS_PATH])
self.logger.debug("LAYOUTS_PATH set to %s" % (self.settings.LAYOUTS_PATH,))
self.logger.info("Settings loaded.")
# instantiate Oak with the given settings
View
3 oak/settings.py
@@ -39,7 +39,7 @@
OUTPUT_PATH = 'site'
# Set the path to the layouts directory, the default is OK if you are using the installed oak package
-# You'll probably don't want to change it unless you know what you're doing
+# Use an ABSOLUTE path if you want to point a custom location
LAYOUTS_PATH = 'layouts'
# Set the name of the default layout
@@ -86,4 +86,3 @@
'tags': [],
}
-

0 comments on commit 7d9e4eb

Please sign in to comment.
Something went wrong with that request. Please try again.