1
0
Fork 0
mirror of https://codeberg.org/Reuh/feather.git synced 2025-10-27 18:19:32 +00:00

feat: improve image centering in default css

This commit is contained in:
Étienne Fildadut 2025-10-11 21:15:26 +02:00
parent 174486ced8
commit ae0c10eb6d
3 changed files with 25 additions and 15 deletions

View file

@ -6,7 +6,7 @@ start with pictures/gif each time
### Navigating feeds ### Navigating feeds
Directories, sorting/searching by date/title (a.k.a. using a file manager) Directories, sorting/searching by date/title (a.k.a. using a file manager), flattening nested dirs, etc.
### Reading an article ### Reading an article
@ -37,12 +37,12 @@ After changing the configuration, you can call `feather regenerate` to regenerat
`feather clear-data` `feather clear-data`
### Theoretical use-cases ### Layer other things on top
#### Processing with scripts
#### Syncthing #### Syncthing
#### Processing with scripts
## Installation ## Installation
### Docker ### Docker
@ -65,9 +65,14 @@ You need Python 3.12 or newer. Then pip it up, as the kids say.
## TODO ## TODO
before publishing:
- [ ] Write documentation - [ ] Write documentation
- [ ] Use inotify for real-time article mark-as-read action
- [ ] Share the fun somewhere - [ ] Share the fun somewhere
- [ ] Get article attachments
- [ ] Test with FreshRSS - [ ] Test with FreshRSS
"i'll look into it later":
- [ ] Get article attachments
- [ ] Use inotify for real-time article mark-as-read action
- [ ] Partial sync (using since_id for ttrss and start_time for googlereader)

View file

@ -4,7 +4,7 @@
# - setting environment variables for the values you want to overwrite (the environment variable name for each value can be found in the comments below). # - setting environment variables for the values you want to overwrite (the environment variable name for each value can be found in the comments below).
[server] [server]
# Server API to use. Either "googlereader" for the Google Reader API (FreshRSS, Miniflux, etc.) or "ttrss" for the TinyTiny-RSS API. # (Required) Server API to use. Either "googlereader" for the Google Reader API (FreshRSS, Miniflux, etc.) or "ttrss" for the TinyTiny-RSS API.
# The Google Reader API do not support nested categories. # The Google Reader API do not support nested categories.
api = "googlereader" api = "googlereader"
# (Required) URL of your server's Google Reader API endpoint # (Required) URL of your server's Google Reader API endpoint
@ -64,9 +64,12 @@ article_template = '''
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<title>{{ title }}</title> <title>{{ title }}</title>
</head> </head>
<body style="background-color:black; color:white;"> <body style="background-color:black; color:white; overflow-x:hidden;">
<style>a{color:palevioletred; text-decoration:none;}</style> <style>
<article style="max-width:60rem; margin:auto; text-align:justify;"> a {color:palevioletred; text-decoration:none;}
.feather-content img {display:block; margin-left:50%; transform:translateX(-50%); max-width:100vw;}
</style>
<article style="max-width:min(60rem,100%); margin:auto;">
<p style="display:flex; flex-direction:row; justify-content:space-between;"> <p style="display:flex; flex-direction:row; justify-content:space-between;">
<span>{{ published }}</span> <span>{{ published }}</span>
<span> <span>
@ -74,7 +77,7 @@ article_template = '''
<a href="{{ feed_url }}"> <a href="{{ feed_url }}">
{% endif %} {% endif %}
{% if feed_icon_url %} {% if feed_icon_url %}
<img style="height:1em;" src="{{ feed_icon_url }}"> <img style="height:1em; vertical-align:middle;" src="{{ feed_icon_url }}">
{% endif %} {% endif %}
{{ feed_title }} {{ feed_title }}
{% if feed_url %} {% if feed_url %}
@ -85,10 +88,12 @@ article_template = '''
<h1><a href="{{ article_url }}">{{ title }}</a></h1> <h1><a href="{{ article_url }}">{{ title }}</a></h1>
<h3>{{ author }}</h3> <h3>{{ author }}</h3>
{% if content %} {% if content %}
<div>{{ content | safe }}</div> <div class="feather-content">{{ content | safe }}</div>
{% else %} {% else %}
<div class="feather-content">
<img src="{{ image_url }}"> <img src="{{ image_url }}">
<div>{{ summary | safe }}</div> {{ summary | safe }}
</div>
{% endif %} {% endif %}
</article> </article>
</body> </body>

View file

@ -47,7 +47,7 @@ class Config:
self.html_root: Path = Path(get_config("directories", "reader")) self.html_root: Path = Path(get_config("directories", "reader"))
self.json_root: Path = Path(get_config("directories", "data")) self.json_root: Path = Path(get_config("directories", "data"))
self.server_api: str = str(get_config("server", "api")) self.server_api: str = str(get_config("server", "api", False))
if self.server_api not in ("googlereader", "ttrss"): if self.server_api not in ("googlereader", "ttrss"):
raise ConfigurationError( raise ConfigurationError(
f"server.api must be either ttrss or googlereader, not {self.server_api}" f"server.api must be either ttrss or googlereader, not {self.server_api}"