mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Allow templates to be overridden in data/templates/
I'd like to customize my instance's theme beyond what's possible with
_theme.scss. This patch would allow me to do that, and keep my changes
self-contained in data/ without maintaining a local patchset over
app/templates/.
For utils.html, I've also added scoped blocks around the body of every
macro. This allows the macros to be overridden individually in
data/templates/utils.html, without copying the whole file. For example,
to only override the display of a specific actor's name/icon:
{% extends "app/utils.html" %}
{% block display_actor %}
{% if actor.ap_id == "https://me.example.com" %}
<!-- custom actor display -->
{% else %}
{{ super() }}
{% endif %}
{% endblock %}
This commit is contained in:
committed by
Thomas Sileo
parent
0d7c121781
commit
48740ea8cb
@@ -127,6 +127,10 @@ $secondary-color: #32cd32;
|
||||
|
||||
See `app/scss/main.scss` to see what variables can be overridden.
|
||||
|
||||
#### Custom templates
|
||||
|
||||
If you'd like to customize your instance's theme beyond CSS, you can modify the app's HTML by placing templates in `data/templates` which overwrite the defaults in `app/templates`.
|
||||
|
||||
#### Code highlighting theme
|
||||
|
||||
You can switch to one of the [styles supported by Pygments](https://pygments.org/styles/) by adding a line in `profile.toml`:
|
||||
|
||||
Reference in New Issue
Block a user