fix paths

This commit is contained in:
cellarspoon
2021-12-15 12:05:44 +01:00
parent 55050aa3f6
commit 30dbc6212f
4 changed files with 15 additions and 18 deletions

View File

@ -35,7 +35,8 @@ def linebreaks(text):
return br.sub(r"<br />\n", text)
env = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.curdir))
template_dir = os.path.join(Path(__file__).parent.resolve(), "templates")
env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir))
env.filters["duration"] = duration
env.filters["linebreaks"] = linebreaks
@ -119,8 +120,7 @@ output_dir = os.environ.get(
if not os.path.exists(output_dir):
os.mkdir(output_dir)
cwd = Path.resolve()
template = env.get_template(os.path.join(cwd, "templates" "video.md"))
template = env.get_template("video.md")
existing_posts = os.listdir(output_dir)