Fixed whitespace behavior in generate_errors.py
This commit is contained in:
parent
3a3a0f42f2
commit
04e3f982d4
1 changed files with 5 additions and 2 deletions
|
@ -34,8 +34,11 @@ 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:
|
||||||
html.write(root_html.format(
|
content = 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