added fallback css path

This commit is contained in:
Navan Chauhan 2020-11-10 22:27:23 +05:30
parent d6d9183e00
commit a8c3d149a3
1 changed files with 4 additions and 0 deletions

View File

@ -166,6 +166,8 @@ if html:
convert = pypandoc.convert_file(ifname,'html',outputfile=ofname,extra_args=['-s']) convert = pypandoc.convert_file(ifname,'html',outputfile=ofname,extra_args=['-s'])
assert(convert) == '' assert(convert) == ''
soup = None
with open(ofname) as fp: with open(ofname) as fp:
soup = BeautifulSoup(fp,'html5lib') soup = BeautifulSoup(fp,'html5lib')
@ -180,6 +182,8 @@ if html:
custom_css = soup.new_tag('link',href=html_stylesheet,rel='stylesheet') custom_css = soup.new_tag('link',href=html_stylesheet,rel='stylesheet')
soup.head.append(custom_css) soup.head.append(custom_css)
custom_css = soup.new_tag('link',href=str("../"+html_stylesheet),rel='stylesheet')
soup.head.append(custom_css)
if animations: if animations:
aos_css = soup.new_tag('link',href='https://unpkg.com/aos@2.3.1/dist/aos.css',rel='stylesheet') aos_css = soup.new_tag('link',href='https://unpkg.com/aos@2.3.1/dist/aos.css',rel='stylesheet')