Skip to content

Commit

Permalink
Docs: add sidebar links
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinvis committed Oct 16, 2020
1 parent c04313f commit b87b51d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{#
The MIT License (MIT)

Copyright (c) 2012-2019 Juan Luis Cano Rodríguez and the poliastro development team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
#}
{% extends "!layout.html" %}

{% block menu %}
{{ super() }}

{% if sidebar_external_links %}
<p class="caption">
<span class="caption-text">
{% if sidebar_external_links_caption %}
{{ sidebar_external_links_caption }}
{% else %}
External links
{% endif %}
</span>
</p>
<ul>
{% for text, link in sidebar_external_links %}
{% if hasdoc(link) %}
<li class="toctree-l1"><a href="{{ pathto(link) }}">{{ text }}</a></li>
{% else %}
<li class="toctree-l1"><a href="{{ link }}">{{ text }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}

{% endblock %}
31 changes: 31 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,37 @@ def root(module):

html_favicon = "_static/favicon.ico"

# Values to pass into the template engine's context for all pages.
html_context = {
"sidebar_external_links_caption": "Links",
"sidebar_external_links": [
(
'<i class="fa fa-cube fa-fw"></i> PyPI',
f"https://pypi.org/project/{project.lower()}",
),
# (
# '<i class="fa fa-cube fa-fw"></i> Conda forge',
# f"https://anaconda.org/conda-forge/{project.lower()}",
# ),
(
'<i class="fa fa-code fa-fw"></i> Source code',
f"https://github.com/exabl/{project.lower()}",
),
(
'<i class="fa fa-bug fa-fw"></i> Issue tracker',
f"https://github.com/exabl/{project.lower()}/issues",
),
# ('<i class="fa fa-rss fa-fw"></i> Blog', 'https://...'),
# (
# '<i class="fa fa-comments fa-fw"></i> Chat',
# "https://matrix.to/#/#snek5000:matrix.org",
# ),
# (
# '<i class="fa fa-file-text fa-fw"></i> Citation',
# "https://doi.org/10.5334/jors.237",
# ),
],
}
# -- Options for Intersphinx -------------------------------------------------

intersphinx_mapping = dict(
Expand Down

0 comments on commit b87b51d

Please sign in to comment.