From 5e9fa2453a235e82ba38717b35ad627f1f3a20bc Mon Sep 17 00:00:00 2001 From: Baillette <3332281+jfbaillette@users.noreply.github.com> Date: Wed, 3 Oct 2018 23:54:01 +0200 Subject: [PATCH] Make relative source path available for themes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - **Need**: I didn't find a way to figure out from article the original name from the file (md or rst) it was generated, - **Typical use case:** users may modify the version of their article from a direct link opening GitHub in edition mode, - **Proposal**: Make a article.orig_relpath available for themes article.html template. Exemple in YOURTHEME/template/article.html: ``` ... ... ``` --- pelican/generators.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pelican/generators.py b/pelican/generators.py index c7fc4a9e..f3d34c9f 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -595,6 +595,7 @@ class ArticlesGenerator(CachingGenerator): all_articles.append(article) elif article.status == "draft": all_drafts.append(article) + article.orig_relpath = f; self.add_source_path(article) self.articles, self.translations = process_translations(all_articles)