From dec820555a369231e81fd1c1a6783c0d984b1825 Mon Sep 17 00:00:00 2001 From: Zachary Vance Date: Thu, 11 Jul 2024 21:18:02 -0400 Subject: [PATCH] Improve side-by-side view to have source links --- blog | 7 ++++--- templates/postcombined.mustache.html | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/blog b/blog index 476f479..bb7a179 100755 --- a/blog +++ b/blog @@ -182,12 +182,13 @@ class Templatable(PseudoMap): def url(self): return self.blog.web_root + "/" + str(self.output_path.relative_to(Path(self.blog.destination))) - def render_template(source, blog, name, context): + def render_template(source, blog, name, context, replace_links=True): template_path = blog["{}_template".format(name)] with open(template_path, "r") as f: template = f.read() html = mustache.render(template, context, warn=True) - html = blog.replace_links(source, html) + if replace_links: + html = blog.replace_links(source, html) return html def content(self): @@ -260,7 +261,7 @@ class Post(Templatable): return self.blog.web_root + "/" + str(self.output_path_html.relative_to(self.blog.destination)) def content_combined(self): - return self.render_template(self.blog, "postcombined", self.context).encode("utf8") + return self.render_template(self.blog, "postcombined", self.context, replace_links=False).encode("utf8") def content_md(self): content = self.render_template(self.blog, self.type, collections.ChainMap({ diff --git a/templates/postcombined.mustache.html b/templates/postcombined.mustache.html index 77f60c7..ba07589 100644 --- a/templates/postcombined.mustache.html +++ b/templates/postcombined.mustache.html @@ -7,7 +7,16 @@ html, body { padding: 0; border: 0; } -body { +#links { + margin: 0; + padding: 5px 0; + display: flex; +} +#links > * { + flex: 1 1; + text-align: center; +} +#iframes { display: flex; } iframe { @@ -28,5 +37,11 @@ iframe::-webkit-scrollbar { - + + +
-- 2.47.3