mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Make relative source path available for themes
- **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: ``` ... <button onclick="window.location.href='https://github.com/getpelican/pelican/edit/master/{{ article.orig_relpath }}'"> Modify this article under GitLab </button> ... ```
This commit is contained in:
parent
9e526a825e
commit
5e9fa2453a
1 changed files with 1 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue