Documentation updates for stable release (#73)
[akkoma] / docs / theme / partials / source.html
1 <!--
2 Copyright (c) 2016-2019 Martin Donath <martin.donath@squidfunk.com>
3
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to
6 deal in the Software without restriction, including without limitation the
7 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 sell copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 IN THE SOFTWARE.
21 -->
22
23 {% import "partials/language.html" as lang with context %}
24
25 <!--
26 Check whether the repository is hosted on one of the supported code hosting
27 platforms (GitHub, GitLab or Bitbucket) to show icon.
28 -->
29 {% set platform = config.extra.repo_icon or config.repo_url %}
30 {% if "github" in platform %}
31 {% set repo_type = "github" %}
32 {% elif "gitlab" in platform %}
33 {% set repo_type = "gitlab" %}
34 {% elif "bitbucket" in platform %}
35 {% set repo_type = "bitbucket" %}
36 {% else %}
37 {% set repo_type = "" %}
38 {% endif %}
39
40 {% if page and page.url.startswith('backend') %}
41 {% set repo_url = "https://git.pleroma.social/pleroma/pleroma" %}
42 {% set repo_name = "pleroma/pleroma" %}
43 {% elif page and page.url.startswith('frontend') %}
44 {% set repo_url = "https://git.pleroma.social/pleroma/pleroma-fe" %}
45 {% set repo_name = "pleroma/pleroma-fe" %}
46 {% else %}
47 {% set repo_url = config.repo_url %}
48 {% set repo_name = config.repo_name %}
49 {% endif %}
50
51 <!-- Repository containing source -->
52 <a href="{{ repo_url }}" title="{{ lang.t('source.link.title') }}"
53 class="md-source" data-md-source="{{ repo_type }}">
54 {% if repo_type %}
55 <div class="md-source__icon">
56 <svg viewBox="0 0 24 24" width="24" height="24">
57 <use xlink:href="#__{{ repo_type }}" width="24" height="24"></use>
58 </svg>
59 </div>
60 {% endif %}
61 <div class="md-source__repository">
62 {{ repo_name }}
63 </div>
64 </a>