From 2defd13986e9e03fa9168862944f5655fe60a981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Sun, 4 Sep 2016 23:02:58 -0400 Subject: [PATCH] support arbitrary source URLs This allows the user to specify a different repository, possibly outside of GitHub to link the "show source" to. Closes: #87 --- alabaster/layout.html | 5 +++++ alabaster/theme.conf | 1 + docs/changelog.rst | 2 ++ 3 files changed, 8 insertions(+) diff --git a/alabaster/layout.html b/alabaster/layout.html index 459700f..257c668 100644 --- a/alabaster/layout.html +++ b/alabaster/layout.html @@ -51,9 +51,14 @@ {% endif %} {%- if show_source and has_source and sourcename %} {% if show_copyright or theme_show_powered_by %}|{% endif %} + {%- if source_url_prefix %} + {{ _('Page source') }} + {%- else %} {{ _('Page source') }} {%- endif %} + {%- endif %} {% if theme_github_banner|lower != 'false' %} diff --git a/alabaster/theme.conf b/alabaster/theme.conf index b334015..7da3881 100644 --- a/alabaster/theme.conf +++ b/alabaster/theme.conf @@ -28,6 +28,7 @@ sidebar_includehidden = true sidebar_collapse = true show_powered_by = true show_related = false +source_url_prefix = gray_1 = #444 gray_2 = #EEE diff --git a/docs/changelog.rst b/docs/changelog.rst index 68b72a8..df04249 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,6 +2,8 @@ Changelog ========= +* :feature:`87` Add support for arbitrary "edit source" link + targets. Credit: ``@anarcat``. * :support:`- backported` Miscellaneous project maintenance updates such as adding to Travis CI and enforcing the use of ``flake8``. * :feature:`110 backported` Add ``badge_branch`` option allowing