This commit is contained in:
SG
2025-06-17 13:46:08 +03:00
parent 0583eb07ee
commit 438a8d6a14
3 changed files with 7 additions and 3 deletions

View File

@@ -13,7 +13,10 @@ from config import Config
from jinja2 import Environment, FileSystemLoader
# get the scrip directory
if getattr(sys, 'frozen', False):
if Path(f'themes/{Config.THEME}/templates').exists():
base_dir = "."
elif getattr(sys, 'frozen', False):
# Running fron Pyinstaller-packed binary
base_dir = Path(sys._MEIPASS)
else:
@@ -26,6 +29,7 @@ env = Environment(loader=FileSystemLoader(f"{jinja_env_dir}"))
env.globals['header_image'] = f"{base_dir}/themes/{Config.THEME}/static/images/header.jpg"
index_template = env.get_template("index.html")
content_item_template = env.get_template("content_item.html")
print(env.loader.searchpath)
class ContentItem:
def render_content(self, categories, target_file = False):