add ability to specify static directory
This commit is contained in:
@@ -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 = ("<figure class='code'>\n<figcaption><span>{title}</span> "
|
||||
"<a href='{url}'>download</a></figcaption>".format(title=title,
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user