summaryrefslogtreecommitdiff
path: root/templates/base.html
blob: eef6a39680f1c8217be7b6616e68fce12a0261bf (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
<!DOCTYPE html>
<html>
<head>
    {% set sub_title = section.title | default(value=page.title | default(value='')) %}
    {% if sub_title %}
        {% set title = sub_title ~ ' - ' ~ trans(key="title") %}
    {% else %}
        {% set title = trans(key="title") %}
    {% endif %}
    {% set cn_font_family = "'Source Serif Pro', 'Source Han Serif SC', 'Noto Serif CJK SC', 'Noto Serif SC', serif" %}
    {% set fallback_font_family = "'Source Serif Pro', 'Source Han Serif TC', 'Noto Serif CJK TC', 'Noto Serif TC', 'Noto Serif KR', 'Noto Serif SC', serif" %}
    {% set fonts_url = "Noto+Serif+SC:wght@400;700" %}
    {% set font_base_url = config.extra.seje_font_mirror | default(value="fonts.googleapis.com") %}
    {% if lang == 'zh-cn' and not config.extra.seje_vertical_layout %}
        {% set font_family = cn_font_family %}
    {% else %}
        {% set font_family = fallback_font_family %}
        {% set fonts_url = "Noto+Serif+TC:wght@400;700&family=Noto+Serif+KR:wght@400;700&" ~ fonts_url %}
    {% endif %}
    {% if config.extra.seje_custom_fonts %}
        {% set font_family = config.extra.seje_custom_fonts ~ ',' ~ font_family %}
    {% endif %}
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <title>{{ title }}</title>
    <meta charset="utf-8">
    <meta name="title" content="{{ title }}">
    <meta name="description" content="{{ section.description | default(value=page.description | default(value=config.description)) }}">
    <meta property="og:image:width" content="200" />
    <meta property="og:image:height" content="200" />
    <link rel="stylesheet" href="{{ config.base_url }}/style.css">
    {% if config.extra.seje_darkmode == "auto" %}
    <link rel="stylesheet" href="{{ config.base_url }}/autodarkmode.css">
    {% elif config.extra.seje_darkmode == "always" %}
    <link rel="stylesheet" href="{{ config.base_url }}/darkmode.css">
    {% endif %}
    {% if config.extra.seje_vertical_layout %}
    <link rel="stylesheet" href="{{ config.base_url }}/vertical.css">
    {% else %}
    <style>
    @media screen and (min-width: 320px) {
        body {
            font-size: calc(16px + 2 * ((100vw - 320px) / 960));
        }
    }
    </style>
    {% endif %}
    <link rel="stylesheet" href="https://{{ font_base_url }}/css2?family=Source+Serif+Pro:wght@400;700&display=swap">
    <link rel="stylesheet" href="https://{{ font_base_url }}/css2?family={{ fonts_url }}&display=swap">
    <style>body { font-family: {{ font_family | safe }} }</style>
    {% block metadata %}{# <meta property="og:image" content="/<%= theme.favicon %>"> #}{% endblock %}
</head>
<body>
    {% block header %}
    <header class="header">
        <div class="blog-title"><a href="{{ config.base_url }}" class="logo">{{ trans(key="title") }}</a></div>
        {% include "navbar.html" %}
    </header>
    {% endblock %}
    <main class="main">
        {% block content %}
        {% endblock %}
    </main>
    {% block footer %}
        <p class="license">{{ config.license | default(value='') }}</p>
    {% endblock %}
</body>
</html>