Skip to content

Commit e108d5c

Browse files
committed
theme: add support for 'Open on GitHub' links
This requires the Zephyr 'gh_utils' extension to be enabled. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
1 parent d85eedd commit e108d5c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

sphinx_ncs_theme/breadcrumbs.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% extends "sphinx_rtd_theme/breadcrumbs.html" %}
2+
{%- block breadcrumbs_aside %}
3+
<li class="wy-breadcrumbs-aside">
4+
{% if 'gh_link_get_blob_url' is filter %}
5+
{% set gh_blob_url = pagename | gh_link_get_blob_url %}
6+
{%- endif %}
7+
{%- if gh_blob_url is defined and gh_blob_url %}
8+
<a href="{{ gh_blob_url }}" class="fa fa-github"> {{ _('Open on GitHub') }}</a>
9+
{%- elif show_source and source_url_prefix %}
10+
<a href="{{ source_url_prefix }}{{ pagename }}{{ page_source_suffix }}">{{ _('View page source') }}</a>
11+
{%- elif show_source and has_source and sourcename %}
12+
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> {{ _('View page source') }}</a>
13+
{%- endif %}
14+
</li>
15+
{%- endblock %}

0 commit comments

Comments
 (0)