-
+
{% block left_content %}
{% endblock %}
@@ -60,11 +60,11 @@
-
+
diff --git a/nova.py b/nova.py
index b37eaa0..ab539f6 100755
--- a/nova.py
+++ b/nova.py
@@ -137,13 +137,18 @@ class EpisodeList(UserList):
def generate_archives(self):
"Generates archives page"
- with open(self.output + "archives.html", "w") as file:
+ if not path.isdir(self.output + "archives"):
+ logging.info("Creating directory archives")
+ os.mkdir(self.output + "archives")
+ with open(self.output + "archives/index.html", "w") as file:
episodes = [{
"slug": gen_name(i.date, i.slug) + ".html",
"title": i.title
} for i in self.data[::-1]]
file.write(self.archives.render(episodes=episodes,
- title="Archives"))
+ title="Archives",
+ relative=".."
+ ))
def generate_site(self, root):
"Generates the entire site"
@@ -205,12 +210,13 @@ class Episode:
logging.info(f"New episode: {date=} {slug=} {title=} {self.video=} "
f"{self.audio=} {config=} {self.length=} {self.show_notes=}")
- def render(self, template, thumbnail_src):
+ def render(self, template, thumbnail_src, relative="."):
"Renders the Episode with the given template"
return template.render(
title=self.title,
show_notes=jinja2.Markup(self.show_notes),
thumbnail_src=thumbnail_src,
+ relative=relative,
video_src=f"assets/videos/{path.basename(self.video)}"
)
@@ -346,17 +352,23 @@ def main(args):
)
)
+ if not path.isdir(output_dir + "subscribe"):
+ os.mkdir(output_dir + "subscribe")
logging.info("Generating subscribe page")
with open(input_dir + "subscribe.json") as subscribe, \
- open(output_dir + "subscribe.html", "w") as html:
+ open(output_dir + "subscribe/index.html", "w") as html:
html.write(env.get_template("subscribe.html").render(
+ relative="..",
subscribtions=json.load(subscribe)
))
+ if not path.isdir(output_dir + "donate"):
+ os.mkdir(output_dir + "donate")
logging.info("Generating donate page")
with open(input_dir + "donate.json") as donate, \
- open(output_dir + "donate.html", "w") as html:
+ open(output_dir + "donate/index.html", "w") as html:
html.write(env.get_template("donate.html").render(
+ relative="..",
donations=json.load(donate)
))
diff --git a/subscribe.html b/subscribe.html
index 836b0bf..5d6ace6 100644
--- a/subscribe.html
+++ b/subscribe.html
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block title %}Subscribe | Redacted Life{% endblock %}
{% block stylesheets %}
-
+
{% endblock %}
{% block left_content %}