From 3e728786a409f7d4e813a8086034bdff20a508d8 Mon Sep 17 00:00:00 2001 From: Anton Baranov <44464480+noneinnon@users.noreply.github.com> Date: Fri, 14 Jan 2022 19:43:15 +0300 Subject: [PATCH] Fix: makes bundles path relative --- loconotion/notionparser.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/loconotion/notionparser.py b/loconotion/notionparser.py index 2807aea..201e11c 100644 --- a/loconotion/notionparser.py +++ b/loconotion/notionparser.py @@ -9,7 +9,7 @@ import glob import mimetypes import urllib.parse import hashlib -from pathlib import Path +from pathlib import Path, PurePath log = logging.getLogger(f"loconotion.{__name__}") @@ -563,12 +563,14 @@ class Parser: injects_custom_tags("body") # inject loconotion's custom stylesheet and script - loconotion_custom_css = self.cache_file(Path("bundles/loconotion.css")) + current_dir = Path(__file__).parent + + loconotion_custom_css = self.cache_file((current_dir / '../bundles/loconotion.css').resolve()) custom_css = soup.new_tag( "link", rel="stylesheet", href=str(loconotion_custom_css) ) soup.head.insert(-1, custom_css) - loconotion_custom_js = self.cache_file(Path("bundles/loconotion.js")) + loconotion_custom_js = self.cache_file((current_dir / '../bundles/loconotion.js').resolve()) custom_script = soup.new_tag( "script", type="text/javascript", src=str(loconotion_custom_js) )