aboutsummaryrefslogtreecommitdiff
path: root/templates/base.html
blob: cb8d73f0574e5e7375a6a4da1d3433a295dc5bb7 (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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{%- import 'macros/head.html' as macros_head %}
{%- import "macros/social.html" as social_macros %}
{%- import "macros/page.html" as page_macros %}
{%- import "macros/macros.html" as macros %}
<!DOCTYPE html>
<html lang="{%- if lang != config.default_language %}{{ lang }}{% else %}{{ config.extra.language_code | default(value=lang) }}{% endif %}">
<head>
  {{- macros_head::theme(config=config) }}
  {{- macros_head::stylesheets(config=config) }}
  <meta charset="utf-8" />
  <meta http-equiv="x-ua-compatible" content="ie=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  {{- macros_head::stylesheets_preload(config=config) }}
  {{- macros_head::js(config=config) }}
  <meta name="base" content="{{ config.base_url | safe }}" />
  {{- macros_head::feed(config=config) }}
  {%- block seo %}
    {%- if config.extra.title_separator %}
      {%- set title_separator = " " ~ config.extra.title_separator ~ " " -%}
    {%- else %}
      {%- set title_separator = " | " -%}
    {%- endif %}
  {%- endblock seo %}
  <meta name="HandheldFriendly" content="True" />
  <meta name="mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="default" />
  {{- macros_head::security(config=config) }}
  {{- macros_head::favicons(config=config) }}
  {%- if config.build_search_index %}
  <noscript><link rel="stylesheet" href="{{ get_url(path='nojs.css', trailing_slash=false) | safe }}" /></noscript>
  {%- endif %}
</head>
<body>
{%- block header %}
  <header>
    <nav>
      <div>
        {%- if config.extra.logo -%}
        <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls %}/index.html{%- endif %}">
        {%- if config.extra.logo.file -%}
        <img src="{{ config.base_url | safe }}/{{ config.extra.logo.file | safe }}"{%- if config.extra.logo.alt %} alt="{{ config.extra.logo.alt | safe }}"{%- endif %}{%- if config.extra.logo.width %} width="{{ config.extra.logo.width | safe }}"{%- endif %}{%- if config.extra.logo.height %} height="{{ config.extra.logo.height | safe }}"{%- endif %} />
        {%- endif -%}
        {%- if config.extra.logo.text -%}{{ config.extra.logo.text | safe }}{%- endif -%}
        </a></h1>
        {%- elif config.extra.textlogo -%}
        <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls -%}
        {%- if lang == config.default_language -%}/{%- endif -%}
        index.html{%- endif -%}">{{ config.extra.textlogo | safe }}</a></h1>
        {%- elif config.title -%}
        <h1><a href="{{ get_url(path="/", lang=lang) }}{%- if config.extra.uglyurls %}/index.html{%- endif %}">{{ config.title | safe }}</a></h1>
        {%- endif -%}
      </div>
      <div>
        <ul>
          {%- set js_switcher=config.extra.js_switcher | default(value=true) -%}
          {%- if config.extra.menu or js_switcher %}
          {%- if config.extra.menu %}
          {%- for i in config.extra.menu -%}
          <li> <h2><a href="{{ get_url(path=i.url, lang=lang, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>
          {%- if lang != config.default_language -%}
          {{ trans(key=i.name | safe, lang=lang) }}
          {%- else -%}
          {{ i.name | safe }}
          {%- endif -%}
          </a></h2> </li>
          {%- endfor -%}
          {%- endif -%}
          {%- set language_count = 1 -%}
          {%- for language_name, language in config.languages -%}
          {%- set_global language_count = language_count + 1 -%}
          {%- endfor -%}
          {%- if language_count > 1 %}
          <li class="js"><div class="dropdown" type="Button"> {%- if lang != config.default_language %}{{ trans(key="flag" | safe, lang=lang) }}{% else %}{{ config.extra.flag.en }}{% endif %}
            {%- if current_url %}
            <div class="dropdown-content">
            {%- for lcode,flag in config.extra.flag -%}
            {%- if lang != lcode -%}
            {%- if lcode == config.default_language -%}
            <a type="Button" href="{{ current_url | replace(from=current_path | truncate(length=4, end=""), to="/") }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ flag }}</a><br />
            {%- else -%}
            <a type="Button" href="{{ current_url | replace(from=config.base_url, to=config.base_url ~ "/" ~ lcode) }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ flag }}</a><br />
            {%- endif -%}
            {%- endif -%}
            {%- endfor -%}
            </div>
            {%- endif %}
          </div></li>
          {%- endif -%}
          {%- if js_switcher -%}
          {%- set icon_adjust=config.extra.icon_adjust | default(value="svgs adjust") -%}
          <li class="js">{%- if icon_adjust -%}<i type="reset" id="mode" class="{{ icon_adjust }}"></i>{%- else -%}<i type="reset" id="mode" class="mode">&#9728;</i>{%- endif -%}</li>
          {%- endif -%}
          {%- endif -%}
        </ul>
      </div>
      {%- if config.build_search_index %}
      {%- set icon_search=config.extra.icon_search | default(value="svgs search") %}
      <div>
        <form autocomplete=off class="js" name="goSearch" id="searchbox">
          <div class="searchd">
            <input id="searchinput" type="text" placeholder="{%- if lang != config.default_language %}{{ trans(key="Search" | safe, lang=lang) }}{% else %}Search{% endif %}" title="Search"{% if config.extra.search_library %}{% if config.extra.search_library == "stork" %} data-stork="stork" {% endif %}{% endif %} />
            <button type="submit" title="Search">{%- if icon_search -%}<i class="{{ icon_search }}"></i>{%- else -%}<span class="si">&#8981;</span>{%- endif -%}</button>
          </div>
          <div><div id="suggestions"{% if config.extra.search_library %}{% if config.extra.search_library == "stork" %} data-stork="stork-output" {% endif %}{% endif %}></div></div>
        </form>
      </div>
      {%- endif %}
    </nav>
    {%- if config.extra.sitedesc %}
    {%- if config.description %}
    <div>{{ config.description }}</div>
    {%- endif %}
    {%- endif %}
    {%- if config.extra.headhr %}
    <hr />
    {%- endif %}
  </header>
{%- endblock header %}
  <main>
  {%- block content %}
  {%- endblock content %}
  </main>
{%- block footer %}
  <footer>
    {%- if config.extra.foothr %}
    <hr />
    {%- endif %}
    <div class="c">
      {{- social_macros::social_links(config=config) }}

      {#- Copyright START #}
      {%- set copyright_start_year=config.extra.copyright_start_year | default(value="") %}
      {%- if copyright_start_year %}{%- set copyright_start_year=copyright_start_year ~ "-" %}{%- endif %}
      {%- set copyright_end_year=config.extra.copyright_end_year | default(value=now() | date(format="%Y")) %}
      <p{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}> &copy; {{ copyright_start_year ~ copyright_end_year }} {{ config.title }}</p>
      {#- Copyright END #}
      {%- if config.extra.menu_footer %}
      <nav>
        <ul>
          {%- for i in config.extra.menu_footer -%}
          {%- if i.url != "sitemap.xml" %}
          {%- set furl=get_url(path=i.url, lang=lang, trailing_slash=i.slash) %}
          {%- else %}
          {%- set furl=get_url(path=i.url, trailing_slash=i.slash) %}
          {%- endif %}
          <li{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}> <a href="{{ furl }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}> {% if lang != config.default_language -%} {{ trans(key=i.name | safe, lang=lang) }} {%- else -%} {{ i.name | safe }} {% endif %} </a> </li>
          {%- endfor -%}
        </ul>
      </nav>
      {%- endif %}
      {%- if config.extra.footer_credit | default(value=true) %}
      {%- if config.extra.footer_credit_override %}
      {{ config.extra.footer_credit_override | safe }}
      {%- else %}
      <p{%- if config.extra.footer_size %} class="{{ config.extra.footer_size }}"{% endif %}>{%- if lang != config.default_language %} {{ trans(key="Powered_by" | safe, lang=lang) }} {% else %} Powered by {% endif %} <a href="https://www.getzola.org/" target="_blank">Zola</a> {%- if lang != config.default_language %} {{ trans(key="and" | safe, lang=lang) }} {% else %} and {% endif %} <a href="https://github.com/jieiku/abridge/" target="_blank">Abridge</a></p>
      {%- endif %}
      {%- endif %}
    </div>
  </footer>
{%- endblock footer %}
{%- block gotop %}
{%- endblock gotop %}
</body>
</html>