Closed BenWard closed 1 year ago
The source HTML of the post, and the bio info of the accounts, are provided in the info dictionary. That means it is possible to render without iframes at all. @mauforonda has been doing some really neat work on their fork. I think such an overhaul to the included templates are out-of-scope for this PR, but I could imagine it being a reasonable change in the future. This is also somewhat captured in https://github.com/hodgesmr/mastodon_digest/issues/6.
Yep, and I included the link to documentation for info
in the readme, but didn't want to get into building a whole new post rendering at the same time as this foundational change. That was part of my thinking behind the common
repository for shared template partials though: I'd imagine that if someone does contribute a template for rendering posts, it could be re-usable by any theme.
This patch adds a new argument
--theme
to allow specifying of different render templates for the digest. It refactors the existing digest theme without any visual modification, and adds alight
variant of it by way of demonstrating the functionality.Context: I'd like to play around with visual customisation of the digest more drastically, but since visuals are a very opinionated and personal thing, I wanted to first have the base project able to handle different templates simultaneously, so that you're not obligated to wrangle anyone's visual ideas into your default, but will be free to bundle alternate digest styles as you like, and adopt ideas into your default in whatever way makes sense.
Summary of Changes:
--theme {default, light}
(and, automatically, the name of any other theme directory added totemplates/themes
.)default
, and moves some pieces of the mark-up intotemplates/common
, a second template repository passed in to Jinja, where recurring mark-up or script references can live. This reduces DRY-violations in variant themes and will allow for common scripts, styles and the debug output to be shared as the script evolves.light
theme, which is identical todefault
but with inverted coloursMakefile
run and build commands to mount the localtemplates
directory as a volume, so that templates can be modified without requiring a full Docker rebuild.Aside: Unfortunately the Mastodon
<iframe>
embeds don't allow you to specify which theme to use within each post, so they continue to render based on the configuration of the remote server.