Commit bdcc8a8f authored by Antoine Beaupré's avatar Antoine Beaupré

fix static command

parent 7cc1e8d3
......@@ -20,7 +20,6 @@ from __future__ import division, absolute_import
from __future__ import print_function
import glob
import itertools
import os
import re
import shlex
......@@ -37,7 +36,7 @@ from markdown import markdown
# workaround missing import issue in 0.5
from humanize.time import naturaldelta
from debmans.utils import mkdirp
from debmans.utils import mkdirp, find_static_file
......@@ -426,8 +425,9 @@ def match_jobs(files, patterns):
def site(obj):
'''render the whole static site'''
suites = obj['mirror'].releases
pattern = os.path.join('static', '*.mdwn')
template = os.path.join('templates', 'template.html')
static_dir = find_static_file(os.path.join('static'))
pattern = os.path.join(static_dir, '*.mdwn')
template = find_static_file(os.path.join('templates', 'template.html'))'rendering files in %s with template %s',
pattern, template)
i = 0
......@@ -445,11 +445,11 @@ def site(obj):
i = 0
t = time.time()
for pattern in '*.css', '*.js':
for static in glob.glob(os.path.join('static', pattern)):
for static in glob.glob(os.path.join(static_dir, pattern)):
i += 1
logging.debug('copying %s to %s', static, obj['output'])
shutil.copy(static, obj['output'])
picsdir = os.path.join('static', 'Pics')
picsdir = os.path.join(static_dir, 'Pics')
pics = os.path.join(picsdir, '*')
targetdir = os.path.join(obj['output'], 'Pics')
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment