From d091f2780b80c5cf0e7f4152ac047418e4c98f1d Mon Sep 17 00:00:00 2001 From: Jake Vanderplas Date: Sat, 4 May 2013 21:25:34 -0700 Subject: [PATCH] add ability to specify static directory --- liquid_tags/include_code.py | 3 ++- liquid_tags/notebook.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/liquid_tags/include_code.py b/liquid_tags/include_code.py index e8eddc0..389f364 100644 --- a/liquid_tags/include_code.py +++ b/liquid_tags/include_code.py @@ -69,7 +69,8 @@ def include_code(preprocessor, tag, markup): else: title = os.path.basename(src) - url = '/{0}/{1}/{2}'.format('static', code_dir, src) + static_dir = settings.get('STATIC_OUT_DIR', 'static') + url = '/{0}/{1}/{2}'.format(static_dir, code_dir, src) open_tag = ("
\n
{title} " "download
".format(title=title, diff --git a/liquid_tags/notebook.py b/liquid_tags/notebook.py index 2d27751..846294d 100644 --- a/liquid_tags/notebook.py +++ b/liquid_tags/notebook.py @@ -174,7 +174,6 @@ def notebook(preprocessor, tag, markup): settings = preprocessor.configs.config['settings'] nb_dir = settings.get('NOTEBOOK_DIR', 'notebooks') nb_path = os.path.join('content', nb_dir, src) - url = '/{0}/{1}/{2}'.format('static', nb_dir, src) if not os.path.exists(nb_path): raise ValueError("File {0} could not be found".format(nb_path))