forked from bevyengine/bevy-website
/
base.html
228 lines (228 loc) · 9.53 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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
{% import "macros/header.html" as header_macros %}
{% import "macros/public_draft.html" as public_draft %}
{% set current_path = current_path | default(value="/") %}
{% if section and section.title %}
{% if section.path is starting_with("/learn/book/") %}
{% set page_title = "Bevy Book: " ~ section.title %}
{% elif section.path is starting_with("/assets") %}
{% set page_title = "Bevy Assets" %}
{% else %}
{% set page_title = section.title %}
{% endif %}
{% elif page and page.title %}
{% if page.path is starting_with("/learn/book/") %}
{% set page_title = "Bevy Book: " ~ page.title %}
{% elif page.path is starting_with("/assets") %}
{% set page_title = "Bevy Assets" %}
{% else %}
{% set page_title = page.title %}
{% endif %}
{% else %}
{% set page_title = "Bevy Engine" %}
{% endif %}
{% if section and section.path %}
{% set path = "/" ~ section.path %}
{% elif page and page.path %}
{% set path = "/" ~ page.path %}
{% else %}
{% set path = "" %}
{% endif %}
{% if section %}
{% if section.path is starting_with("/learn/book/") %}
{% set show_nav_toggle = true %}
{% elif section.path is starting_with("/learn/migration-guides/") %}
{% set show_nav_toggle = true %}
{% elif section.path is starting_with("/assets/") %}
{% set show_nav_toggle = true %}
{% endif %}
{% elif page %}
{% if page.path is starting_with("/learn/book/") or page.path is starting_with("/learn/migration-guides/") or page.path
is starting_with("/assets/") %}
{% set show_nav_toggle = true %}
{% endif %}
{% endif %}
{% set newline = "
" %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content="{{ page_title }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://bevyengine.org{{ path }}" />
<meta property="og:image"
content="https://bevyengine.org/assets/bevy_logo_fill.png" />
<meta property="og:description"
content="Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever!" />
<link rel="shortcut icon" type="image/png" href="/assets/favicon.png">
<link rel="stylesheet" href="/site.css" />
<link href="/atom.xml" rel="alternate" type="application/atom+xml" />
<title>{{ page_title }}</title>
{% block head_extensions %}{% endblock head_extensions %}
</head>
<body>
<div class="layout">
<input id="mobile-menu-state" class="hidden" type="checkbox">
<header class="layout__header header" data-mobile-menu-state-container>
<div class="header__content">
<label class="main-menu-backdrop" for="mobile-menu-state"></label>
<label class="header__hamburger button-square button-square--header"
for="mobile-menu-state">
<img src="/assets/icon-hamburger.svg"
alt="Three horizontal lines stacked on top of eachother"
width="20"
height="16">
</label>
<div class="header__left-block">
<a class="header__logo" href="/">
<img class="logo"
src="/assets/bevy_logo_dark.svg"
alt="Bevy Engine"
width="520"
height="130">
</a>
<div class="header__message">
{% if section and section.extra.header_message %}
{{ section.extra.header_message }}
{% elif page and page.extra.header_message %}
{{ page.extra.header_message }}
{% elif section and section.path is starting_with("/learn/book/") or page and page.path is
starting_with("/learn/book/") %}
The Book
{% elif section and section.path is starting_with("/learn/quick-start/") or page and page.path is
starting_with("/learn/quick-start/") %}
Quick Start
{% elif section and section.path is starting_with("/learn/migration-guides/") or page and page.path is
starting_with("/learn/migration-guides/") %}
Migration Guides
{% elif section and section.path is starting_with("/news/") %}
News
{% elif page and page.path is starting_with("/news/") %}
News
{% else %}
Features
{% endif %}
</div>
</div>
{% block mobile_page_menu_state %}{% endblock mobile_page_menu_state %}
<nav class="header__menu main-menu {% block main_menu_extra_class %}{% endblock main_menu_extra_class %}"
role="navigation"
data-page-menu-switch-state-container>
<div class="main-menu__header">
<a href="/">
<img class="logo"
src="/assets/bevy_logo_dark.svg"
alt="Bevy Engine"
width="520"
height="130">
</a>
<label class="button-square button-square--header" for="mobile-menu-state">
<img src="/assets/icon-times.svg"
alt="A saltire or x-cross"
width="16"
height="16">
</label>
</div>
{% block mobile_page_menu_switch %}{% endblock mobile_page_menu_switch %}
<div class="main-menu__content">
<div class="main-menu__page-menu">
{% block mobile_page_menu %}{% endblock mobile_page_menu %}
</div>
<ul class="main-menu__menu">
{{ header_macros::header_item(name="Getting Started", path="/learn/quick-start/getting-started",
extra_class="main-menu__entry--getting-started", current_path=current_path) }}
{{ header_macros::header_item(name="Learn", current_path=current_path) }}
{{ header_macros::header_item(name="News", current_path=current_path) }}
{{ header_macros::header_item(name="Community", current_path=current_path) }}
{{ header_macros::header_item(name="Assets", current_path=current_path) }}
{{ header_macros::header_item(name="Examples", current_path=current_path) }}
{# <li class="main-menu__entry">
<a class="main-menu__link" href="https://merch.bevyengine.org">Merch</a>
</li> #}
</ul>
</div>
</nav>
<div class="header__cta-container">
<a class="button button--pink header__cta" href="/community/donate">Donate
<img class="button__icon"
src="/assets/heart.svg"
alt="heart icon"
width="512"
height="512" />
</a>
<a class="header__cta header__cta--github"
href="https://github.com/bevyengine/bevy">
<img src="/assets/github-mark-white.svg"
alt="GitHub repo"
width="98"
height="96" />
</a>
</div>
</div>
</header>
<main class="layout__content">
<div class="container">
{% if section %}
{{ public_draft::warning(section=section) }}
{% elif page %}
{{ public_draft::warning(section=page) }}
{% endif %}
{% block content %}{% endblock content %}
</div>
</main>
<footer>
{% block footer_extensions %}{% endblock footer_extensions %}
<div class="footer__social-container">
<a class="footer__social" href="https://github.com/bevyengine/bevy">
<img src="/assets/github-mark-white.svg"
alt="Bevy engine's GitHub repo"
width="32"
height="32" />
</a>
<a class="footer__social" href="https://discord.gg/bevy">
<img src="/assets/discord.svg"
alt="Bevy Discord server"
width="32"
height="32" />
</a>
<a class="footer__social" href="https://mastodon.social/@bevy">
<img src="/assets/mastodon-logo-purple.svg"
alt="Bevy Mastodon account"
width="32"
height="32" />
</a>
<a class="footer__social" href="https://twitter.com/BevyEngine">
<img src="/assets/twitter.svg"
alt="Bevy Twitter account"
width="32"
height="32" />
</a>
<a class="footer__social" href="https://www.reddit.com/r/bevy/">
<img src="/assets/reddit.svg"
alt="Bevy subreddit"
width="32"
height="32" />
</a>
<a class="footer__social" href="/atom.xml">
<img src="/assets/feed.svg"
alt="Bevy news feed"
width="32"
height="32" />
</a>
</div>
</footer>
</div>
<script>
const search_params = new URLSearchParams(window.location.search);
if (search_params.has("show_drafts") || document.cookie.indexOf("show_drafts") >= 0) {
if (search_params.get("show_drafts") === "0") {
document.cookie = "show_drafts=;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC";
} else {
document.cookie = "show_drafts=1;path=/"
document.body.classList.add('show_drafts');
}
}
</script>
</body>
</html>