integrated the forum plugin
This commit is contained in:
parent
4a0214f020
commit
46cd28ba54
5 changed files with 122 additions and 4 deletions
|
|
@ -1,22 +1,24 @@
|
|||
import html
|
||||
from db import get_setting
|
||||
|
||||
FORUM_ENABLED = False
|
||||
|
||||
def esc(s):
|
||||
return html.escape(str(s))
|
||||
|
||||
|
||||
|
||||
DEFAULT_TEMPLATE = "<html>\n<head>\n<meta name=\"referrer\" content=\"no-referrer\">\n<meta http-equiv=\"x-dns-prefetch-control\" content=\"off\">\n</head>\n<body>\n{{content}}\n</body>\n</html>"
|
||||
|
||||
|
||||
def _default_template():
|
||||
name = esc(get_setting("site_name", "tinyweb"))
|
||||
forum_link = ' | <a href="/forum">forum</a>' if FORUM_ENABLED else ""
|
||||
return (
|
||||
'<html>\n<head>\n<meta name="referrer" content="no-referrer">\n<meta http-equiv="x-dns-prefetch-control" content="off">\n</head>\n<body>\n'
|
||||
f'<p><b><a href="/">{name}</a></b>'
|
||||
' | <a href="/">search</a> | <a href="/pages">browse</a>'
|
||||
' | <a href="/tags">tags</a> | <a href="/subscriptions">subscriptions</a>'
|
||||
f'{forum_link}'
|
||||
' | <a href="/style">customize</a> | <a href="/about">about</a></p>\n'
|
||||
"<hr>\n{{content}}\n</body>\n</html>"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue