Skip to content

Commit 2b2baf9

Browse files
committed
Modernize
1 parent 8fd8c01 commit 2b2baf9

File tree

4 files changed

+38
-27
lines changed

4 files changed

+38
-27
lines changed

config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
DAILY_HASH_BITS = 9
22

3+
ASSETS_URL = '/pkgs.void/static'
4+
5+
VOIDLINUX_URL = 'https://voidlinux.org'
6+
37
DATASOURCE_CLASS = 'SqliteDataSource'
48

59
DATASOURCE_ARGUMENTS = ['index.sqlite3']

present.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def escape_attr(arg):
5858
def web_parameters():
5959
return {
6060
'root_url': config.ROOT_URL,
61+
'assets_url': config.ASSETS_URL,
62+
'voidlinux_url': config.VOIDLINUX_URL,
6163
'escape_attr': escape_attr,
6264
}
6365

templates/base.html

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
<!DOCTYPE html>
2-
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3-
4-
5-
6-
7-
2+
<html lang="en">
83
<head>
94
<meta charset="utf-8"/>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
106
<title>${_context.get('title', 'Packages')} from Void</title>
11-
<link href="${root_url}/static/style.css" rel="stylesheet" type="text/css"/>
12-
7+
<link rel="icon" type="image/png" href="${assets_url}/img/favicon.png" />
8+
<link rel="stylesheet" href="${assets_url}/css/packages.css"/>
9+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
10+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>
1311
</head>
1412

15-
1613
<body>
17-
<header>
18-
<nav>
19-
<ul class="horizontal">
20-
<li><a href="${root_url}">Homepage</a></li>
21-
<li><a href="https://github.com/void-linux/void-packages">Templates repository</a></li>
22-
<li><a href="https://voidlinux.org">Void Linux homepage</a></li>
23-
<li><a href="${root_url}/all">All packages</a></li>
24-
</ul>
25-
</nav>
26-
<form action="${root_url}/search" class="searchbox" method="GET">
27-
<input name="term" type="text"/>
28-
<input type="submit" value="View"/>
29-
<input type="submit" name="find" value="Find"/>
30-
</form>
14+
<div class="container">
15+
<header class="d-flex flex-wrap justify-content-center py-3 mb-4 border-bottom">
16+
<ul class="nav nav-pills">
17+
<li class="nav-item"><a class="nav-link" href="${voidlinux_url}/">Home</a></li>
18+
<li class="nav-item"><a class="nav-link" href="${voidlinux_url}/news">News</a></li>
19+
<li class="nav-item"><a class="nav-link" href="${voidlinux_url}/download/">Download</a></li>
20+
<li class="nav-item"><a class="nav-link active" aria-current="page" href="${root_url}">Packages</a></li>
21+
<li class="nav-item"><a class="nav-link" href="${voidlinux_url}/acknowledgments/">Acknowledgments</a></li>
22+
<li class="nav-item"><a class="nav-link" href="https://docs.voidlinux.org">Documentation</a></li>
23+
<li class="nav-item"><a class="nav-link" href="https://man.voidlinux.org/">Manual pages</a></li>
24+
<li class="nav-item"><a class="nav-link" href="https://github.com/void-linux">Github</a></li>
25+
</ul>
3126
</header>
27+
<div class="searchbar">
28+
<form action="${root_url}/search" method="GET" class="form-inline">
29+
<a href="${root_url}">Featured packages</a>
30+
<a href="${root_url}/all">All packages</a>
31+
<input name="term" type="text" class="form-control"/>
32+
<input type="submit" value="View" class="btn btn-green"/>
33+
<input type="submit" name="find" value="Find" class="btn btn-green"/>
34+
</form>
35+
</div>
3236
{== _content ==}
37+
</div>
3338
</body>
3439
</html>

templates/main.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?py _context['title'] = title ?>
22
<div class="content">
33
<main>
4-
<div class="breakable">
5-
4+
<div class="d-flex flex-wrap justify-content-between">
5+
66
<?py for entry in lists: ?>
77
<?py include('small/main_list.html', entry=entry) ?>
88
<?py #endfor ?>
99
</div>
10-
<p>Site was updated at ${updated}.</p>
10+
<p class="text-center">Site was updated at ${updated}.</p>
1111
</main>
12-
</div><footer>Server side code is AGPL licensed. You can view <a href="https://github.com/Chocimier/pkgs.void">git repo</a> or get <a href="${root_url}/static/source/pkgs.void.tar.bz2">source tarball</a>.</footer>
12+
</div><footer><p class="text-center">Server side code is AGPL licensed. You can view <a href="https://github.com/Chocimier/pkgs.void">git repo</a> or get <a href="${root_url}/static/source/pkgs.void.tar.bz2">source tarball</a>.</p></footer>

0 commit comments

Comments
 (0)