Skip to content

Commit 32df8c8

Browse files
committed
chore: update layouts and cleanup
- Update default and page layouts for consistency - Clean up search layout structure - Simplify about page content - Refactor calendar page for better organization - Remove redundant code and improve formatting
1 parent fdd9107 commit 32df8c8

File tree

5 files changed

+110
-79
lines changed

5 files changed

+110
-79
lines changed

_layouts/default.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ site.lang }}">
3+
<head>
4+
{% include head.html %}
5+
{% if page.extra_css %}
6+
{% for css in page.extra_css %}
7+
<link rel="stylesheet" type="text/css" href="{{ css | prepend: site.baseurl_root }}">
8+
{% endfor %}
9+
{% endif %}
10+
</head>
11+
<body>
12+
{% include header.html %}
13+
14+
{% if page.show_masthead %}
15+
{% capture masthead_title %}
16+
{% if page.masthead_title %}
17+
{{ page.masthead_title }}
18+
{% elsif page.title %}
19+
{% t page.title %}
20+
{% endif %}
21+
{% endcapture %}
22+
23+
{% capture masthead_hook %}
24+
{% if page.masthead_hook %}
25+
{{ page.masthead_hook }}
26+
{% endif %}
27+
{% endcapture %}
28+
29+
{% capture masthead_description %}
30+
{% if page.masthead_description %}
31+
{{ page.masthead_description }}
32+
{% endif %}
33+
{% endcapture %}
34+
35+
{% include masthead.html url=page.url title=masthead_title hook=masthead_hook description=masthead_description %}
36+
{% endif %}
37+
38+
<div class="container" id="main-content">
39+
{{ content }}
40+
</div>
41+
42+
{% if page.extra_js %}
43+
{% for js in page.extra_js %}
44+
<script type="text/javascript" src="{{ js | prepend: site.baseurl_root }}?t={{site.time | date: '%s'}}"></script>
45+
{% endfor %}
46+
{% endif %}
47+
48+
{% if page.include_footer %}
49+
<footer>{% include_cached footer.html %}</footer>
50+
{% else %}
51+
{% include sneks.html %}
52+
{% endif %}
53+
</body>
54+
</html>

_layouts/page.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
layout: default
3+
---
4+
5+
{{ content }}

_layouts/search.html

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
---
2+
layout: default
3+
show_masthead: true
4+
include_footer: true
25
---
36

4-
<html>
5-
<head>
6-
{% include head.html %}
7-
</head>
8-
<body>
9-
{% include header.html %} {% capture search_title %} {% t titles.search %} {% endcapture %} {% capture
10-
search_hook %} {% tf frontpage/hook.md %} {% endcapture %} {% capture search_description %}{% tf
11-
search/description.md %}
12-
<form class="form" action="{% tl search %}" method="get">
13-
<input
14-
type="search"
15-
id="search"
16-
name="query"
17-
class="form-control col-md-12"
18-
placeholder="{% t titles.search %}"
19-
aria-label="Search"
20-
/>
21-
<button class="btn btn-outline-dark col-md-12" type="submit">{% t titles.search %}</button>
22-
</form>
23-
{% endcapture %} {% include masthead.html url=page.url title=search_title hook=search_hook
24-
description=search_description %}
25-
<div class="container">
26-
<div id="confs">{{ content }}</div>
27-
</div>
28-
<footer>{% include_cached footer.html %}</footer>
29-
</body>
30-
</html>
7+
{% capture search_title %}{% t titles.search %}{% endcapture %}
8+
{% capture search_hook %}{% tf frontpage/hook.md %}{% endcapture %}
9+
{% capture search_description %}
10+
{% tf search/description.md %}
11+
<form class="form" action="{% tl search %}" method="get">
12+
<input
13+
type="search"
14+
id="search"
15+
name="query"
16+
class="form-control col-md-12"
17+
placeholder="{% t titles.search %}"
18+
aria-label="Search"
19+
/>
20+
<button class="btn btn-outline-dark col-md-12" type="submit">{% t titles.search %}</button>
21+
</form>
22+
{% endcapture %}
23+
24+
{% include masthead.html url=page.url title=search_title hook=search_hook description=search_description %}
25+
26+
<div id="confs">{{ content }}</div>

_pages/about.html

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
layout: page
23
title: titles.about
34
author: Jesper Dramsch
45
description: 'Never miss another Python conference deadline!'
@@ -13,19 +14,14 @@
1314
permalink_ru: /о-нас/
1415
permalink_id: /tentang-kami/
1516
permalink_hi: /के-बारे-में/
17+
extra_css:
18+
- /static/css/about.css
19+
extra_js:
20+
- /static/js/about.js
21+
include_footer: true
1622
---
1723

1824
{% assign confs = site.data.archive | concat: site.data.conferences | concat: site.data.legacy %}
19-
<!DOCTYPE html>
20-
<html lang="{{ site.lang }}">
21-
<head>
22-
{% include head.html %}
23-
<link rel="stylesheet" type="text/css" href="{{ "/static/css/about.css" | prepend:site.baseurl_root }}">
24-
</head>
25-
<body>
26-
{% include header.html %}
27-
28-
<div class="container">
2925
<button class="presentation-mode-btn" id="presentation-toggle" title="{% t about.toggle_fullscreen %}">
3026
3127
</button>
@@ -287,10 +283,3 @@ <h2 class="text-center mb-4">{% t about.cta.title %}</h2>
287283
</div>
288284
</div>
289285
</div>
290-
</div>
291-
292-
<footer>{% include_cached footer.html %}</footer>
293-
294-
<script src="{{ "/static/js/about.js" | prepend: site.baseurl_root }}"></script>
295-
</body>
296-
</html>

_pages/calendar.html

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
layout: default
23
namespace: calendar
34
permalink: /calendar/
45
permalink_es: /calendario/
@@ -10,20 +11,11 @@
1011
permalink_id: /kalender/
1112
permalink_hi: /कैलेंडर/
1213
title: titles.calendar
14+
show_masthead: true
15+
include_footer: true
1316
---
1417

15-
<html>
16-
<head>
17-
{% include head.html %}
18-
</head>
19-
20-
<body>
21-
{% include header.html %} {% capture cal_title %} {% t titles.calendar %} {% endcapture %} {% capture cal_hook
22-
%} {% tf frontpage/hook.md %} {% endcapture %} {% capture cal_description %} {% tf calendar/description.md %} {%
23-
endcapture %} {% include masthead.html url=page.url title=cal_title description=cal_description %}
24-
25-
<div class="container">
26-
<div id="calendar-page" class="calendar-page"></div>
18+
<div id="calendar-page" class="calendar-page"></div>
2719

2820
<div class="modal fade" id="event-modal">
2921
<div class="modal-dialog">
@@ -93,30 +85,25 @@ <h5 class="modal-title">Event</h5>
9385
</div>
9486
{% endfor %}
9587
</div>
96-
</div>
97-
<footer>{% include_cached footer.html %}</footer>
98-
99-
<script type="text/javascript" charset="utf-8">
100-
let calendar = null;
101-
var page_url = "{{site.baseurl}}/calendar"
102-
var conf_list_all = [];
88+
</div>
10389

104-
{% include utils.js %}
105-
{% include load_data.js %}
106-
{% include multiselect_handler.js %}
107-
$(function () {
108-
// Get data from URL/Cache
109-
{% include handle_url_retrieval.js %}
90+
<script type="text/javascript" charset="utf-8">
91+
let calendar = null;
92+
var page_url = "{{site.baseurl}}/calendar"
93+
var conf_list_all = [];
11094

111-
conf_list_all = load_conference_list();
112-
conf_list = conf_list_all;
95+
{% include utils.js %}
96+
{% include load_data.js %}
97+
{% include multiselect_handler.js %}
98+
$(function () {
99+
// Get data from URL/Cache
100+
{% include handle_url_retrieval.js %}
113101

114-
// Render calendar
115-
update_filtering({ subs: subs, all_subs: all_subs });
116-
});
117-
{% include calendar.js %} // overwrites update_filtering
118-
</script>
102+
conf_list_all = load_conference_list();
103+
conf_list = conf_list_all;
119104

120-
{% include sneks.html %}
121-
</body>
122-
</html>
105+
// Render calendar
106+
update_filtering({ subs: subs, all_subs: all_subs });
107+
});
108+
{% include calendar.js %} // overwrites update_filtering
109+
</script>

0 commit comments

Comments
 (0)