From c1692a296d7bfeb33c524e7429436ede6bbace57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Costa?= Date: Mon, 9 Jan 2023 19:07:09 +0100 Subject: [PATCH 1/3] Use object name in the RSS feed title if possible Articles have a title stored in the object name. It makes sense to also use this title in the RSS entry. --- app/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index b40e89b..da96bc0 100644 --- a/app/main.py +++ b/app/main.py @@ -1694,9 +1694,9 @@ async def _gen_rss_feed( fe = fg.add_entry() fe.id(outbox_object.url) - - # Atom feeds require a title - if not is_rss: + if outbox_object.name is not None: + fe.title(outbox_object.name) + elif not is_rss: # Atom feeds require a title fe.title(outbox_object.url) fe.link(href=outbox_object.url) From c97070e3d81d2412ea496d537ea8ae7a33241d4f Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Sun, 4 Dec 2022 20:28:09 +0100 Subject: [PATCH 2/3] Add documentation about image_url and custom favicon Also expand documentation about custom templates --- docs/user_guide.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/user_guide.md b/docs/user_guide.md index 6df4859..d83f1f2 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md @@ -28,6 +28,7 @@ You can tweak your profile by tweaking these items: - `name` - `summary` (using Markdown) - `icon_url` + - `image_url` Whenever one of these config items is updated, an `Update` activity will be sent to all known servers to update your remote profile. @@ -35,6 +36,15 @@ The server will need to be restarted for taking changes into account. Before restarting the server, you can ensure you haven't made any mistakes by running the [configuration checking task](/user_guide.html#configuration-checking). +Note that currently `image_url` is not used anywhere in microblog.pub itself, but other clients/servers do occasionally use it when showing remote profiles as a background image. +Also, this image _can_ be used in microblog.pub - just add this: + +```html + +``` + +to an appropriate place of your template (most likely, `header.html`). +For more information, see a section about [custom templates](/user_guide.html#custom-templates) further in this document. ### Profile metadata @@ -161,10 +171,35 @@ $secondary-color: #32cd32; See `app/scss/main.scss` to see what variables can be overridden. +You will need to [recompile CSS](#recompiling-css-files) after doing any CSS changes (for actual css files to be updates) and restart microblog.pub (for css link in HTML documents to be updated with a new checksum - otherwise, browsers that downloaded old CSS will keep using it). + +#### Custom favicon + +By default, microblog.pub favicon is a square of `$primary-color` CSS color (see above section on how to redefine CSS colors). +You can change it to any icon you like - just save a desired file as `data/favicon.ico`. +After that, run the "[recompile CSS](#recompiling-css-files)" task to copy it to `app/static/favicon.ico`. + #### 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`. +Templates are written using [Jinja](https://jinja.palletsprojects.com/en/latest/templates/) templating language. +Moreover, `utils.html` has scoped blocks around the body of every macro. +This allows 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, you can create `data/templates/utils.html` file with following content: + +```jinja +{% extends "app/utils.html" %} + +{% block display_actor %} + {% if actor.ap_id == "https://me.example.com" %} + + {% else %} + {{ super() }} + {% endif %} +{% endblock %} +``` + #### Custom Content Security Policy (CSP) You can override the default Content Security Policy by adding a line in `data/profile.toml`: From f13376de8484f3ac28ad92368c8162c6a779a42d Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Fri, 20 Jan 2023 08:38:19 +0100 Subject: [PATCH 3/3] More docs tweaks --- docs/user_guide.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/user_guide.md b/docs/user_guide.md index d83f1f2..d76de58 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md @@ -25,10 +25,10 @@ As these two config items define your ActivityPub handle `@handle@domain`. You can tweak your profile by tweaking these items: - - `name` - - `summary` (using Markdown) - - `icon_url` - - `image_url` + - `name`: The name shown with your profile. + - `summary`: The summary or 'bio' part of your profile, written in Markdown. + - `icon_url`: Your profile image or avatar. + - `image_url`: This provides a 'header' or 'banner' image. Note that it is not shown by the default Microblog.pub templates. It will be used by Mastodon (which uses a 3:1 ratio image) and Pleroma. Pixelfed and Peertube, for example, don't show these images by default. Whenever one of these config items is updated, an `Update` activity will be sent to all known servers to update your remote profile.