From a8c3d149a3a1bae555bc9d6934d0b831c54fc4d4 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 10 Nov 2020 22:27:23 +0530 Subject: [PATCH] added fallback css path --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index 3e7c388..f3f1b40 100644 --- a/main.py +++ b/main.py @@ -166,6 +166,8 @@ if html: convert = pypandoc.convert_file(ifname,'html',outputfile=ofname,extra_args=['-s']) assert(convert) == '' + soup = None + with open(ofname) as fp: soup = BeautifulSoup(fp,'html5lib') @@ -180,6 +182,8 @@ if html: custom_css = soup.new_tag('link',href=html_stylesheet,rel='stylesheet') soup.head.append(custom_css) + custom_css = soup.new_tag('link',href=str("../"+html_stylesheet),rel='stylesheet') + soup.head.append(custom_css) if animations: aos_css = soup.new_tag('link',href='https://unpkg.com/aos@2.3.1/dist/aos.css',rel='stylesheet')