A special string token (##POST_URL##) is recognized in post bodies and
replaced with the path to the post (URL-wise) in the rendered HTML. This
makes easier to have local resorces and makes links or use them as image
sources in posts.
self.loaded = True
def to_html(self):
- return rst_to_html(self.raw_content)
+ dirname = os.path.dirname
+ post_url = '/'.join(dirname(full_url), data_path, dirname(self.path))
+ rst = self.raw_content.replace('##POST_URL##', post_url)
+ return rst_to_html(rst)
def to_vars(self):
return {