Author | zPlus <zplus@peers.community> 2024-12-15 10:17:29 |
Committer | zPlus <zplus@peers.community> 2024-12-15 10:17:29 |
Commit | e600530 (patch) |
Tree | 64aed34 |
Parent(s) |
index f339fa2..ad971da | |||
old size: 14K - new size: 14K | |||
@@ -23,7 +23,7 @@ if not FUSEKI_ENDPOINT: | |||
23 | 23 | application = bottle.app() | |
24 | 24 | ||
25 | 25 | # Directories to search for HTML templates | |
26 | - | bottle.TEMPLATE_PATH = [ './pages' ] | |
26 | + | bottle.TEMPLATE_PATH = [ './templates', './articles' ] | |
27 | 27 | ||
28 | 28 | def query(query_string, jsonld_frame=None): | |
29 | 29 | """ | |
@@ -100,7 +100,7 @@ def homepage(): | |||
100 | 100 | Homepage. | |
101 | 101 | """ | |
102 | 102 | ||
103 | - | return template('templates/index.html') | |
103 | + | return template('index.html') | |
104 | 104 | ||
105 | 105 | @bottle.route('/library', method=['GET', 'POST'], name='library') | |
106 | 106 | def library(): | |
@@ -188,7 +188,7 @@ def library(): | |||
188 | 188 | 'library:title': {} | |
189 | 189 | }) | |
190 | 190 | ||
191 | - | return template('templates/library/index.html', authors=authors, licenses=licenses, items=items, | |
191 | + | return template('library/index.html', authors=authors, licenses=licenses, items=items, | |
192 | 192 | filters_author=filters_author, filters_license=filters_license) | |
193 | 193 | ||
194 | 194 | @bottle.get('/library/<item_id>', name='library_item') | |
@@ -243,7 +243,7 @@ def library_item(item_id): | |||
243 | 243 | } | |
244 | 244 | )["@graph"][0] | |
245 | 245 | ||
246 | - | return template('templates/library/item.html', item_id=item_id, plaintext=item_plaintext, data=data) | |
246 | + | return template('library/item.html', item_id=item_id, plaintext=item_plaintext, data=data) | |
247 | 247 | ||
248 | 248 | @bottle.get('/license', name='license_list') | |
249 | 249 | def license_list(): | |
@@ -263,7 +263,7 @@ def license_list(): | |||
263 | 263 | ORDER BY ASC(UCASE(?name)) | |
264 | 264 | """) | |
265 | 265 | ||
266 | - | return template('templates/license/index.html', data=data) | |
266 | + | return template('license/index.html', data=data) | |
267 | 267 | ||
268 | 268 | @bottle.get('/license/<id>', name='license') | |
269 | 269 | def license(id): | |
@@ -278,7 +278,7 @@ def license(id): | |||
278 | 278 | DESCRIBE <dokk:license:{id}> | |
279 | 279 | """) | |
280 | 280 | ||
281 | - | return template('templates/license/license.html', data=data) | |
281 | + | return template('license/license.html', data=data) | |
282 | 282 | ||
283 | 283 | @bottle.get('/manpages', name='manpages') | |
284 | 284 | def manpages(): | |
@@ -298,7 +298,7 @@ def manpages(): | |||
298 | 298 | ORDER BY ?name ?number | |
299 | 299 | """) | |
300 | 300 | ||
301 | - | return template('templates/manpages/index.html', data=data) | |
301 | + | return template('manpages/index.html', data=data) | |
302 | 302 | ||
303 | 303 | @bottle.get('/manpages/<distribution>/<version>', name='manpages_distribution') | |
304 | 304 | def manpages_distribution(distribution, version): | |
@@ -323,7 +323,7 @@ def manpages_distribution(distribution, version): | |||
323 | 323 | ORDER BY ?name | |
324 | 324 | ''') | |
325 | 325 | ||
326 | - | return template('templates/manpages/distribution.html', data=data, distribution=distribution, version=version) | |
326 | + | return template('manpages/distribution.html', data=data, distribution=distribution, version=version) | |
327 | 327 | ||
328 | 328 | @bottle.get('/manpages/<distribution>/<version>/<package>', name='manpages_package') | |
329 | 329 | def manpages_package(distribution, version, package): | |
@@ -352,7 +352,7 @@ def manpages_package(distribution, version, package): | |||
352 | 352 | ORDER BY ?filename | |
353 | 353 | ''') | |
354 | 354 | ||
355 | - | return template('templates/manpages/package.html', data=data, distribution=distribution, version=version, package=package) | |
355 | + | return template('manpages/package.html', data=data, distribution=distribution, version=version, package=package) | |
356 | 356 | ||
357 | 357 | @bottle.get('/manpages/<name>.<section>', name='manpages_disambiguation') | |
358 | 358 | def manpages_disambiguation(name, section): | |
@@ -383,7 +383,7 @@ def manpages_disambiguation(name, section): | |||
383 | 383 | ORDER BY ?distro_name ?distro_number ?package_name | |
384 | 384 | ''')['results']['bindings'] | |
385 | 385 | ||
386 | - | return template('templates/manpages/disambiguation.html', name=name, section=section, data=data) | |
386 | + | return template('manpages/disambiguation.html', name=name, section=section, data=data) | |
387 | 387 | ||
388 | 388 | @bottle.get('/manpages/<distro_name>/<distro_number>/<package>/<page>', name='manpages_page') | |
389 | 389 | def manpages_page(distro_name, distro_number, package, page): | |
@@ -441,7 +441,7 @@ def manpages_page(distro_name, distro_number, package, page): | |||
441 | 441 | >{match.group('page')}({match.group('section')})</a>''', | |
442 | 442 | html) | |
443 | 443 | ||
444 | - | return template('templates/manpages/manpage.html', | |
444 | + | return template('manpages/manpage.html', | |
445 | 445 | distro = {'name': distro_name, 'number': distro_number}, | |
446 | 446 | package = package, | |
447 | 447 | page = { | |
@@ -469,7 +469,7 @@ def mimi_and_eunice(): | |||
469 | 469 | ORDER BY ?number | |
470 | 470 | """) | |
471 | 471 | ||
472 | - | return template('templates/mimi_and_eunice/index.html', data=data) | |
472 | + | return template('mimi_and_eunice/index.html', data=data) | |
473 | 473 | ||
474 | 474 | @bottle.get('/mimi_and_eunice/<number>', name='mimi_and_eunice_strip') | |
475 | 475 | def mimi_and_eunice_strip(number): | |
@@ -505,24 +505,25 @@ def mimi_and_eunice_strip(number): | |||
505 | 505 | 'blob:at': {} | |
506 | 506 | }) | |
507 | 507 | ||
508 | - | return template('templates/mimi_and_eunice/strip.html', data=data['@graph'][0]) | |
508 | + | return template('mimi_and_eunice/strip.html', data=data['@graph'][0]) | |
509 | 509 | ||
510 | 510 | @bottle.get('/articles', name='articles') | |
511 | 511 | def articles(): | |
512 | 512 | """ | |
513 | 513 | """ | |
514 | 514 | ||
515 | - | pages = [ page.stem for page in sorted(pathlib.Path('./pages').glob('*.html')) ] | |
515 | + | pages = [ page.stem for page in sorted(pathlib.Path('./articles').glob('*.html')) ] | |
516 | 516 | ||
517 | - | return template('templates/articles/index.html', pages=pages) | |
517 | + | return template('articles/index.html', pages=pages) | |
518 | 518 | ||
519 | - | # TODO Make this obsolete. Replace with controllers | |
520 | - | @bottle.get('/<page:path>', name='page') | |
521 | - | def article(page=''): | |
519 | + | @bottle.get('/<article_title:path>', name='article') | |
520 | + | def article(article_title=''): | |
522 | 521 | """ | |
523 | - | Path for serving a "page". | |
522 | + | Path for serving an "article". | |
523 | + | If no other controller has matched, this will look into the "articles" folder. | |
524 | + | Keep this controller last. | |
524 | 525 | """ | |
525 | 526 | ||
526 | - | page += '.html' | |
527 | + | article_title += '.html' | |
527 | 528 | ||
528 | - | return template(page) | |
529 | + | return template(article_title) |
index 5702f6a..caf0ee1 | |||
old size: 1K - new size: 1K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "1984 ehf." %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index eb10230..13434b5 | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Bottle" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 90f9826..f332c51 | |||
old size: 1K - new size: 1K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "DOKK" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index d2a9d26..077c023 | |||
old size: 1K - new size: 1K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Dragora" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 6a46df3..1c03c33 | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "ForgeFed" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 1eb7009..62fc89c | |||
old size: 1K - new size: 1K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "GNU Hackers' Meetings" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 873fae7..baa451b | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Gitea" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 39f77af..f977891 | |||
old size: 3K - new size: 3K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Gogs" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 8be1604..8f092d9 | |||
old size: 3K - new size: 3K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Header Dictionary Triples" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index db0894e..9e07602 | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Minifree Ltd" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index abcf9af..1fedea6 | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "NotABug.org" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index ccd87b3..cde6afb | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "The Peers Community" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 1c93753..0fe9649 | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "TuxFamily" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index b694aee..eabb172 | |||
old size: 1K - new size: 1K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Vervis" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 3a0de5b..e293507 | |||
old size: 1022B - new size: 1012B | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Vikings GmbH" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 4f8d8f2..92f268a | |||
old size: 346B - new size: 336B | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "archive-webextension" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index c11e314..cdf1c30 | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "freepost" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index daad857..f2c9318 | |||
old size: 2K - new size: 2K | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "lib.reviews" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index d1313f9..d0d78fc | |||
old size: 918B - new size: 908B | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "radio-browser.info" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 4260d53..c8edc12 | |||
old size: 1015B - new size: 1005B | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | {% set title = "Virtual Hosting platform For Free Software" %} | |
2 | - | {% extends "templates/articles/article.html" %} | |
2 | + | {% extends "articles/article.html" %} | |
3 | 3 | ||
4 | 4 | {% block article %} | |
5 | 5 |
index 5fbbfd9..412f47c | |||
old size: 373B - new size: 363B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}{{ title }}{% endblock %} | |
4 | 4 | {% block stylesheets %} |
index 5169f51..8b452bb | |||
old size: 453B - new size: 443B | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | because unused | |
3 | 3 | #} | |
4 | 4 | ||
5 | - | {% extends "templates/base.html" %} | |
5 | + | {% extends "base.html" %} | |
6 | 6 | ||
7 | 7 | {% block title %}Articles{% endblock %} | |
8 | 8 |
index fe0f782..fe0f782 | |||
old size: 517B - new size: 517B | |||
index 74d30ef..83bc128 | |||
old size: 741B - new size: 731B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}{% endblock %} | |
4 | 4 |
index e7fb841..9f02c5f | |||
old size: 2K - new size: 2K | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}Library{% endblock %} | |
4 | 4 |
index f24ce52..f7299d9 | |||
old size: 972B - new size: 962B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}{{ data['library:title'] }}{% endblock %} | |
4 | 4 |
index bf0208e..d0f8ec3 | |||
old size: 337B - new size: 327B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}Licenses{% endblock %} | |
4 | 4 |
index 4cead96..915978d | |||
old size: 371B - new size: 361B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}{{ data['license:name'] }}{% endblock %} | |
4 | 4 |
index 26c3550..49daa3a | |||
old size: 907B - new size: 897B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}Man pages named {{ name }} in section {{ section }}{% endblock %} | |
4 | 4 |
index 23ed03c..396e9b5 | |||
old size: 628B - new size: 618B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}{{ distribution }} {{ version }} man pages{% endblock %} | |
4 | 4 |
index d15ddcb..bf0e251 | |||
old size: 609B - new size: 599B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}man pages{% endblock %} | |
4 | 4 |
index c8379b4..bcf58a6 | |||
old size: 763B - new size: 753B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}{{ page["name"] }}({{ page["section"] }}){% endblock %} | |
4 | 4 | {% block stylesheets %} |
index 73a0ebb..d3134b3 | |||
old size: 689B - new size: 679B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}{{ package }} ({{ distribution }} {{ version }}) man pages{% endblock %} | |
4 | 4 |
index f3c2b4a..04144e8 | |||
old size: 401B - new size: 391B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}Mimi & Eunice{% endblock %} | |
4 | 4 |
index 0d48798..c162f56 | |||
old size: 953B - new size: 943B | |||
@@ -1,4 +1,4 @@ | |||
1 | - | {% extends "templates/base.html" %} | |
1 | + | {% extends "base.html" %} | |
2 | 2 | ||
3 | 3 | {% block title %}Mimi&Eunice {{ data['comics:number'] }}: {{ data['comics:title'] }}{% endblock %} | |
4 | 4 |