Compare commits
No commits in common. "04e3f982d40a81ea9121592df1bd732055be3841" and "528ef21491267bb39e3c6638330bd12ebaef14bf" have entirely different histories.
04e3f982d4
...
528ef21491
2 changed files with 4 additions and 11 deletions
|
@ -26,10 +26,7 @@ modules = dict(map(read, module.glob('*.html')))
|
||||||
def format(item, modules):
|
def format(item, modules):
|
||||||
name, content = item
|
name, content = item
|
||||||
|
|
||||||
content = content.format(**modules)
|
return (name, re.sub('\n\s*', '', content.format(**modules)))
|
||||||
content = re.sub(r'\s+', ' ', content)
|
|
||||||
content = re.sub(r'>\s<', '><', content)
|
|
||||||
return (name, content)
|
|
||||||
|
|
||||||
dist_html = dict(map(lambda item: format(item, modules), templates.items()))
|
dist_html = dict(map(lambda item: format(item, modules), templates.items()))
|
||||||
|
|
||||||
|
@ -45,5 +42,4 @@ def mk_dist(dist, item):
|
||||||
for item in dist_html.items():
|
for item in dist_html.items():
|
||||||
mk_dist(dist, item)
|
mk_dist(dist, item)
|
||||||
|
|
||||||
dist.joinpath('static')\
|
dist.joinpath('static').symlink_to(static.resolve(strict=True), target_is_directory=True)
|
||||||
.symlink_to(static.resolve(strict=True), target_is_directory=True)
|
|
||||||
|
|
|
@ -34,11 +34,8 @@ for item in codes:
|
||||||
code, title, desc = item.groups()
|
code, title, desc = item.groups()
|
||||||
if int(code) < 400 or int(code) >= 600: continue
|
if int(code) < 400 or int(code) >= 600: continue
|
||||||
with error.joinpath(f'{code}.html').open('w') as html:
|
with error.joinpath(f'{code}.html').open('w') as html:
|
||||||
content = root_html.format(
|
html.write(root_html.format(
|
||||||
code=code, title=title, desc=desc, style=root_css)
|
code=code, title=title, desc=desc, style=root_css))
|
||||||
content = re.sub(r'\s+', ' ', content)
|
|
||||||
content = re.sub(r'>\s<', '><', content)
|
|
||||||
html.write(content)
|
|
||||||
nginx_head += f'error_page {code} @error{code};\n'
|
nginx_head += f'error_page {code} @error{code};\n'
|
||||||
nginx_body += f'location @error{code} {{\n'\
|
nginx_body += f'location @error{code} {{\n'\
|
||||||
f'root {error.resolve()};\n'\
|
f'root {error.resolve()};\n'\
|
||||||
|
|
Reference in a new issue