aboutsummaryrefslogtreecommitdiff
path: root/templates/base.html
blob: c759e7af6d0b2ff68cd65ef3ade4c979810562ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{% macro feed(path, feed_name, type) %}
{% if path %}
<link href="{{ SITEURL }}/{{ path }}" type="application/{{ type }}+xml" rel="alternate" title="{{ SITENAME }} {{feed_name }}">
{% endif %}
{% endmacro -%}

{%- macro logo(name) -%}
<div class="social-icon">
  <img class="social-icon" src="{{ SITEURL }}/theme/images/logos/{{ name }}" alt="Logo {{ name }}">
</div>
{%- endmacro -%}

<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">
{#
 # Moeka Pelican Theme
 # Copyright (C) 2023 Daniel Schadt
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #}
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}{{ SITENAME }}{% endblock %}</title>

    {# Feeds! #}
    {{ feed(FEED_ALL_ATOM, "Full Atom Feed", "atom") }}
    {{ feed(FEED_ALL_RSS, "Full RSS Feed", "rss") }}

    {% if FAVICON %}
    <link rel="icon" href="{{ SITEURL }}/{{ FAVICON }}">
    {% endif %}

    <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/main.css">
    <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/monokai.css">
  </head>
  <body>
    {# The site/side menu #}
    <div id="openSideBanner">
      <a id="hamburgerMenu" href="#sideBanner"><img src="{{ SITEURL }}/theme/images/hamburger.svg"></a>
    </div>
    <div role="banner" id="sideBanner">
      <a id="hideMenu" href="#"><img src="{{ SITEURL }}/theme/images/hamburger.svg"></a>
      <header>
        <div id="mainTitle">
          <a href="{{ SITEURL }}">{{ SITENAME }}</a>
        </div>

        <nav id="menu">
          <ul>
            {% if DISPLAY_PAGES_ON_MENU %}
            {% for p in pages %}
            <li {% if p == page -%} class="active" {%- endif %}>
              <a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a>
            </li>
            {% endfor %}
            {% endif %}

            {% for link_title, link in MENUITEMS %}
            <li>
              <a href="{{ link }}">{{ link_title }}</a>
            </li>
            {% endfor %}

            {% if DISPLAY_CATEGORIES_ON_MENU %}
            {% for cat, _ in categories %}
            <li {% if cat == category -%} class="active" {%-endif%}>
              <a href="{{ SITEURL }}/{{ cat.url }}">{{ cat.name }}</a>
            </li>
            {% endfor %}
            {% endif %}
          </ul>
        </nav>
      </header>
    </div>

    {# Main content #}
    <div id="mainArea" role="main">
      {% block content %}
      {% endblock %}
    </div>

    {# Footer #}
    <footer>
      <div class="icons">
        {% if GITHUB %}
        <a href="{{ GITHUB }}" target="_blank">{{ logo("GitHub.svg") }}</a>
        {% endif %}

        {% if GITLAB %}
        <a href="{{ GITLAB }}" target="_blank">{{ logo("GitLab.svg") }}</a>
        {% endif %}

        {% if CODEBERG %}
        <a href="{{ CODEBERG }}" target="_blank">{{ logo("Codeberg.svg") }}</a>
        {% endif %}

        {% if MASTODON %}
        <a href="{{ MASTODON }}" target="_blank">{{ logo("Mastodon.svg") }}</a>
        {% endif %}
      </div>

      <p>&copy; {{ AUTHOR }}</p>
      {% if CONTENT_LICENCE %}
      <p id="licenceLine">
        {% if CONTENT_LICENCE.startswith("CC-BY-SA") %}
        <img src="{{ SITEURL }}/theme/images/cc/cc.svg" class="cc-icon" alt="CC">
        <img src="{{ SITEURL }}/theme/images/cc/by.svg" class="cc-icon" alt="BY">
        <img src="{{ SITEURL }}/theme/images/cc/sa.svg" class="cc-icon" alt="SA">
        {% endif %}
        The text of this website is licensed under {{ CONTENT_LICENCE }}.
      </p>
      {% endif %}
      {% if ATTRIBUTION %}
      <p>Pelican Theme <a href="https://codeberg.org/dunj3/moeka">moeka</a>, available under the GPL.</p>
      {% endif %}
    </footer>
  </body>
</html>