style: Fix sider

This commit is contained in:
Suraj Shetty 2020-07-22 10:32:12 +05:30 committed by GitHub
parent 06788762d6
commit 2bf77cd82a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -286,14 +286,14 @@ def setup_source(page_info):
# load css/js files
js_path = os.path.join(page_info.basepath, (page_info.basename or 'index') + '.js')
if os.path.exists(js_path):
if not '{% block script %}' in html:
if '{% block script %}' not in html:
with io.open(js_path, 'r', encoding = 'utf-8') as f:
js = f.read()
page_info.colocated_js = js
css_path = os.path.join(page_info.basepath, (page_info.basename or 'index') + '.css')
if os.path.exists(css_path):
if not '{% block style %}' in html:
if '{% block style %}' not in html:
with io.open(css_path, 'r', encoding='utf-8') as f:
css = f.read()
page_info.colocated_css = css