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):
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({
padding: 0;
border: 0;
}
-body {
+#links {
+ margin: 0;
+ padding: 5px 0;
+ display: flex;
+}
+#links > * {
+ flex: 1 1;
+ text-align: center;
+}
+#iframes {
display: flex;
}
iframe {
</style>
</head>
-<body><iframe src="{{url_html}}"></iframe><iframe src="{{url_md}}"></iframe></body>
+<body>
+<ul id="links">
+ <a href="https://blog.za3k.com/{{id}}/">original blog</a>
+ <a href="https://git.za3k.com/?p=blog.git;a=blob_plain;f=posts-html/{{id}}.html;hb=HEAD">html source</a>
+ <a href="https://git.za3k.com/?p=blog.git;a=blob_plain;f=posts-md/{{id}}.md;hb=HEAD">markdown source</a>
+</ul>
+<div id="iframes"><iframe src="{{url_html}}" id="html"></iframe><iframe src="{{url_md}}" id="markdown"></iframe></body></div>
</html>