Add links

This commit is contained in:
2026-02-06 20:44:53 +00:00
parent 9b2b15c570
commit 46605e5f75
8 changed files with 121 additions and 47 deletions

13
src/jakecharman/links.py Normal file
View File

@@ -0,0 +1,13 @@
from flask import Blueprint, render_template
import json
class Links(Blueprint):
def __init__(self, file, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_url_rule('/', view_func=self.links)
self.file = file
def links(self):
with open(self.file, encoding='utf8') as file:
links = json.load(file)
return render_template('links.html', links=links, page_title='Useful Links - ')