Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
DAILY_HASH_BITS = 9

ASSETS_URL = '/pkgs.void/static'

VOIDLINUX_URL = 'https://voidlinux.org'

DATASOURCE_CLASS = 'SqliteDataSource'

DATASOURCE_ARGUMENTS = ['index.sqlite3']
Expand Down
2 changes: 2 additions & 0 deletions present.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def escape_attr(arg):
def web_parameters():
return {
'root_url': config.ROOT_URL,
'assets_url': config.ASSETS_URL,
'voidlinux_url': config.VOIDLINUX_URL,
'escape_attr': escape_attr,
}

Expand Down
Binary file added static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 44 additions & 42 deletions static/style.css
Original file line number Diff line number Diff line change
@@ -1,68 +1,70 @@
html, body {
background: #ddd;
color: #222;
html {
--void-green: #478061;
--void-green-link: #478061;
--void-green-light: #478061;
--text: #333;
--background: white;
--border: #ddd;
}

header {
font-size: 1.2em;
text-align: right;
body {
background-color: var(--background);
color: var(--text);
}

.searchbox {
margin: 1ex;
}

.content {
max-width: 90ex;
max-width: 90ch;
margin: auto;
.btn-primary {
background-color: var(--void-green);
border-color: var(--void-green);
}

a {
color: #0000E0;
color: var(--void-green-light);
}

.horizontal {
display: inline;
padding: 0;
.bg-void {
background-color: var(--void-green);
}

.horizontal li {
display: inline;
margin: auto 1ex;
.card {
background-color: inherit;
border: 1px solid var(--border);
}

dd {
margin-bottom: 1ex;
.card-body {
padding: 2rem 3rem;
}

ul, .breakable {
columns: 40ex 2;
columns: 40ch 2;
.nav-link {
color: white;
}

ul.continuous {
columns: auto 1;
.nav-link:focus, .nav-link:hover {
color: white;
text-decoration: inherit;
}

li, .non-breakable {
break-inside: avoid;
a:hover {
color: var(--text);
text-decoration: underline;
}

hr {
max-width: 20ex;
max-width: 20ch;
color: #bfb;
border: none;
border-top: dotted 0.4em #bfb;
margin: 1.3em auto;
.btn-primary:hover {
background-color: var(--background);
border-color: var(--text);
}

li > aside, .masked > aside {
font-size: 0.8em;
display: inline;
.form-control, .form-control:focus {
background-color: inherit;
color: var(--text);
}

.archs-per-version a {
white-space: nowrap;
@media (prefers-color-scheme: dark) {
html {
--void-green: #295340;
--void-green-link: #62b086;
--void-green-light: #478061;
--text: #ccc;
--background: #222;
--border: #666;
}
}
83 changes: 53 additions & 30 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,57 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>${_context.get('title', 'Packages')} from Void</title>
<link rel="icon" type="image/png" href="${assets_url}/favicon.png" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<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>
<link rel="stylesheet" href="${assets_url}/style.css"/>
</head>





<head>
<meta charset="utf-8"/>
<title>${_context.get('title', 'Packages')} from Void</title>
<link href="${root_url}/static/style.css" rel="stylesheet" type="text/css"/>

</head>


<body>
<header>
<nav>
<ul class="horizontal">
<li><a href="${root_url}">Homepage</a></li>
<li><a href="https://github.com/void-linux/void-packages">Templates repository</a></li>
<li><a href="https://voidlinux.org">Void Linux homepage</a></li>
<li><a href="${root_url}/all">All packages</a></li>
</ul>
</nav>
<form action="${root_url}/search" class="searchbox" method="GET">
<input name="term" type="text"/>
<input type="submit" value="View"/>
<input type="submit" name="find" value="Find"/>
<body>
<div class="bg-void">
<header class="container d-flex flex-wrap justify-content-center py-3 mb-4">
<ul class="nav nav-pills">
<li class="nav-item"><a class="nav-link" href="${voidlinux_url}/">Home</a></li>
<li class="nav-item"><a class="nav-link" href="${voidlinux_url}/news">News</a></li>
<li class="nav-item"><a class="nav-link" href="${voidlinux_url}/download/">Download</a></li>
<li class="nav-item"><a class="nav-link" aria-current="page" href="${root_url}">Packages</a></li>
<li class="nav-item"><a class="nav-link" href="${voidlinux_url}/acknowledgments/">Acknowledgments</a></li>
<li class="nav-item"><a class="nav-link" href="https://docs.voidlinux.org">Documentation</a></li>
<li class="nav-item"><a class="nav-link" href="https://man.voidlinux.org/">Manual pages</a></li>
<li class="nav-item"><a class="nav-link" href="https://github.com/void-linux">Github</a></li>
</ul>
</header>
</div>
<div class="container">
<div class="searchbar mb-4">
<div class="row g-3 align-items-center">
<div class="col-auto">
<a href="${root_url}">Featured packages</a>
</div>
<div class="col-auto">
<a href="${root_url}/all">All packages</a>
</div>
<div class="col">
<form action="${root_url}/search" method="GET" class="form-inline">
<div class="row g-3 align-items-center">
<div class="col">
<input name="term" type="text" class="form-control"/>
</div>
<div class="col-auto">
<input type="submit" value="View" class="btn btn-primary"/>
</div>
<div class="col-auto">
<input type="submit" name="find" value="Find" class="btn btn-primary"/>
</div>
</div>
</form>
</header>
{== _content ==}
</body>
</div>
</div>
</div>
{== _content ==}
</div>
</body>
</html>
24 changes: 13 additions & 11 deletions templates/main.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?py _context['title'] = title ?>
<div class="content">
<main>
<div class="breakable">

<?py for entry in lists: ?>
<?py include('small/main_list.html', entry=entry) ?>
<?py #endfor ?>
</div>
<p>Site was updated at ${updated}.</p>
</main>
</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>
<div class="content">
<main>
<div class="d-flex flex-wrap justify-content-between align-items-start">
<?py for entry in lists: ?>
<?py include('small/main_list.html', entry=entry) ?>
<?py #endfor ?>
</div>
</main>
<footer class="mt-4 text-center">
<p>Site was updated at ${updated}.</p>
<p>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>
</div>
34 changes: 17 additions & 17 deletions templates/small/main_list.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<div class="non-breakable">
<h2>${entry['title']}</h2>
<?py tag = 'ul' if entry.get('bullets') else 'ol' ?>
<{== tag ==}>
<?py echo(' ') ?>
<?py for i in entry['packages']: ?>
<li>
<a href="${root_url}/package/${i}">${i}</a>
</li><?py
#endfor ?>

</{== tag ==}>
<?py if 'more' in entry: ?>
<a href="${root_url}/${entry['address']}">${entry['more']}</a>
<?py #endif ?>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">${entry['title']}</h2>
<?py tag = 'ul' if entry.get('bullets') else 'ol' ?>
<{== tag ==} class="card-text">
<?py echo(' ') ?>
<?py for i in entry['packages']: ?>
<li>
<a href="${root_url}/package/${i}">${i}</a>
</li>
<?py #endfor ?>
</{== tag ==}>
<?py if 'more' in entry: ?>
<a class="btn btn-primary" href="${root_url}/${entry['address']}">${entry['more']}</a>
<?py #endif ?>
</div>
</div>