Commit 8d363825 authored by Haelwenn's avatar Haelwenn

theme/partials/source.html: Add dropdown menu

parent 945ebb3a
Pipeline #23534 passed with stage
in 1 minute and 21 seconds
......@@ -19,6 +19,7 @@ repo_url: 'https://git.pleroma.social/pleroma/docs'
extra:
repo_icon: gitlab
branch: !!python/object/apply:os.getenv ["BRANCH"]
markdown_extensions:
# Note/warning blocks https://squidfunk.github.io/mkdocs-material/extensions/admonition/
......
......@@ -48,17 +48,60 @@
{% set repo_name = config.repo_name %}
{% endif %}
<!-- Repository containing source -->
<a href="{{ repo_url }}" title="{{ lang.t('source.link.title') }}"
class="md-source" data-md-source="{{ repo_type }}">
{% if repo_type %}
<div class="md-source__icon">
<svg viewBox="0 0 24 24" width="24" height="24">
<use xlink:href="#__{{ repo_type }}" width="24" height="24"></use>
</svg>
<style>
.menu * {
margin: 0;
padding: 0;
}
.menu span {
cursor: pointer;
height: 2.4rem;
display: inline-block;
padding: 0.8rem 0.6rem;
font-size: 0.9rem;
font-weight: bold;
}
.menu li a {
padding: 2ch 2em;
display: block;
}
.menu ul {
list-style: none;
display: none;
transition: 0.5s;
background-color: black;
}
.menu:focus-within > ul,
.menu:hover > ul { display: block; }
.menu li { font-weight: bold; }
.menu li:focus-within,
.menu li:hover { font-weight: normal; }
</style>
<div tabindex="0" class="menu">
<span></span>
<ul>
<!-- Repository containing source -->
<li><a href="{{ repo_url }}" title="{{ lang.t('source.link.title') }}"
class="md-source" data-md-source="{{ repo_type }}">
{% if repo_type %}
<div class="md-source__icon">
<svg viewBox="0 0 24 24" width="24" height="24">
<use xlink:href="#__{{ repo_type }}" width="24" height="24"></use>
</svg>
</div>
{% endif %}
<div class="md-source__repository">
{{ repo_name }}
</div>
</a></li>
<li>
{% if config.extra.branch == "develop" %}
<a href="https://docs.pleroma.social">stable branch documentation</a>
{% else %}
<a href="https://docs-develop.pleroma.social">develop branch documentation</a>
{% endif %}
<div class="md-source__repository">
{{ repo_name }}
</div>
</a>
</li>
<li><a href="https://pleroma.social">Main site</a></li>
</ul>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment