/
base.html
64 lines (57 loc) · 2.36 KB
/
base.html
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
{% import "macros/social.html" as social_macros %}
<!DOCTYPE html>
<html lang="{% if lang %}{{ lang }}{% else %}en{% endif %}" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="no-referrer-when-downgrade">
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
<meta name="description" content="{{ config.description }}">
<link rel="stylesheet" href="{{ get_url(path="main.css", trailing_slash=false) }}">
<link rel="preload" href={{ config.extra.cdn.font_awesome }} as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href={{ config.extra.cdn.font_awesome }}></noscript>
{% if config.generate_feed %}
<link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="RSS" href="{{ get_url(path=config.feed_filename) | safe }}">
{% endif %}
{% block ogp_head %}
<meta property="og:title" content="{{ config.title }}">
<meta property="og:type" content="website">
{% endblock ogp_head %}
{% block extra_head %}
{% endblock extra_head %}
</head>
<body>
<div class="container">
{% block header %}
{% set base_url = get_url(path="", lang=lang) %}
<header>
<h1 class="site-header">
<a href="{{ base_url }}">{{ config.title }}</a>
</h1>
<nav>
<ul>
{% block nav_bar %}
{% for subsec in config.extra.menu_items %}
{% set link_url = subsec.url | replace(from="$BASE_URL", to=config.base_url) | replace(from="$LANG_BASE_URL", to=base_url) %}
<li><a {% if current_url and current_url is starting_with(link_url) %}class="active"{% endif %} href="{{ link_url }}">{{ trans(key=subsec.name, lang=lang) }}</a></li>
{% endfor %}
{% endblock nav_bar %}
</ul>
</nav>
</header>
{% endblock header %}
{% block content %}
{% endblock content %}
<footer>
<p>
{{ social_macros::social_links(social_config=config.extra.social) }}
</p>
<p>
{% block footer %}
{% endblock footer %}
</p>
</footer>
</div>
</body>
</html>