diff --git a/development.ini b/development.ini index 662495a..2992df0 100644 --- a/development.ini +++ b/development.ini @@ -20,6 +20,7 @@ hashfs.location = %(here)s/mimirdata/hashfs render.location = %(here)s/output render.site_title = Elfgames R Us render.display_timezone = US/Pacific +render.contact_email = me@example.com auth.accounts = rose:$argon2id$v=19$m=102400,t=2,p=8$M4bQeg9hLEUoZYwxBmAsBQ$bZ3u7RfLMddRvsT5Ys8Qeg # Use https://docs.python.org/3.9/library/secrets.html#generating-tokens to generate a suitable secret diff --git a/production.ini b/production.ini index 53226c9..1bbf6fa 100644 --- a/production.ini +++ b/production.ini @@ -19,6 +19,7 @@ hashfs.location = %(here)s/mimirdata/hashfs render.location = %(here)s/output render.site_title = Elfgame Writeups render.display_timezone = US/Pacific +render.contact_email = me@example.com # auth.accounts = rose:foobar # Use https://docs.python.org/3.9/library/secrets.html#generating-tokens to generate a suitable secret diff --git a/src/mimir/render/__init__.py b/src/mimir/render/__init__.py index 8bffd84..67b327f 100644 --- a/src/mimir/render/__init__.py +++ b/src/mimir/render/__init__.py @@ -62,6 +62,7 @@ def copy_static_files(request): def render_toc(request): site_title = request.registry.settings["render.site_title"] + contact_email = request.registry.settings["render.contact_email"] writeups = ( request.db_session.query(Writeup) .options(joinedload(Writeup.posts)) @@ -72,7 +73,11 @@ def render_toc(request): content = pyramid.renderers.render( "mimir:render/toc.mako", - {"writeups": writeups, "site_title": site_title}, + { + "writeups": writeups, + "site_title": site_title, + "contact_email": contact_email, + }, request=request, ) @@ -108,15 +113,22 @@ def render_feed(request, generator, filename, batches): feed_title = "{} Recent Changes".format( request.registry.settings["render.site_title"] ) + description = pyramid.renderers.render( + "mimir:render/toc#site_description.mako", {}, request=request + ).strip() + feed = generator( - title=feed_title, link=request.route_url("rendered_toc"), language="en", description="These writeups are extracted from the SA Forum's \"FATAL & Friends\" thread. Some of them are obscure RPGs. Some of them are very bad RPGs." + title=feed_title, + link=request.route_url("rendered_toc"), + language="en", + description=description, ) for batch in batches: batch_html = pyramid.renderers.render( "mimir:render/changelog#batch_feed_html.mako", {"batch": batch}, request=request, - ) + ).strip() feed.add_item( title=format_datetime(batch.created_at, request.display_timezone), link=request.route_url("rendered_changelist", _anchor=batch.id.base62), @@ -131,6 +143,7 @@ def render_feed(request, generator, filename, batches): def render_changelog(request): site_title = request.registry.settings["render.site_title"] + contact_email = request.registry.settings["render.contact_email"] batches = ( request.db_session.query(ChangeLogBatch) .order_by(ChangeLogBatch.id.desc()) @@ -139,7 +152,7 @@ def render_changelog(request): ) content = pyramid.renderers.render( "mimir:render/changelog.mako", - {"batches": batches, "site_title": site_title}, + {"batches": batches, "site_title": site_title, "contact_email": contact_email}, request=request, ) @@ -155,9 +168,10 @@ def render_changelog(request): def render_writeup(request, writeup): site_title = request.registry.settings["render.site_title"] + contact_email = request.registry.settings["render.contact_email"] content = pyramid.renderers.render( "mimir:render/writeup.mako", - {"writeup": writeup, "site_title": site_title}, + {"writeup": writeup, "site_title": site_title, "contact_email": contact_email}, request=request, ) diff --git a/src/mimir/render/layout.mako b/src/mimir/render/layout.mako index 28e3235..0171ba8 100644 --- a/src/mimir/render/layout.mako +++ b/src/mimir/render/layout.mako @@ -13,6 +13,9 @@
${ next.body() }
+ ## <%block name="in_footer"/> diff --git a/src/mimir/render/static/styles.css b/src/mimir/render/static/styles.css index 7ebe5ae..9d0b719 100644 --- a/src/mimir/render/static/styles.css +++ b/src/mimir/render/static/styles.css @@ -8,6 +8,12 @@ main { padding: 2ch; margin: auto; } +footer { + max-width: 70ch; + padding: 2ch; + margin: auto; + margin-top: 1.5rem; +} header { margin-bottom: 1.5rem; } diff --git a/src/mimir/render/toc.mako b/src/mimir/render/toc.mako index d014768..c5cf7f6 100644 --- a/src/mimir/render/toc.mako +++ b/src/mimir/render/toc.mako @@ -23,7 +23,7 @@

-These writeups are extracted from the SA Forum's "FATAL & Friends" thread. Some of them are obscure RPGs. Some of them are very bad RPGs. +${site_description()}

Recent Changes (RSS, Atom, or JSON feed)

@@ -44,3 +44,6 @@ These writeups are extracted from the SA Forum's "FATAL & Friends" thread. Some % endfor
+<%def name="site_description()"> +These writeups are extracted from the SA Forum's "FATAL & Friends" thread. Some of them are obscure RPGs. Some of them are very bad RPGs. + \ No newline at end of file