From 0ff5c6b5268cd2a24dc9077af36b09fc4739729b Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 23 Sep 2026 07:32:57 +0000 Subject: [PATCH] ruff --- pagerite/api.py | 6 ++++-- pagerite/i18n.py | 4 +++- pagerite/views.py | 11 +++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pagerite/api.py b/pagerite/api.py index 1532da8..be66e66 100644 --- a/pagerite/api.py +++ b/pagerite/api.py @@ -679,8 +679,10 @@ async def editor_ws(ws: WebSocket) -> None: {"type": "error", "detail": str(e.detail)} ) continue - if image and image != "@favicon" and not re.fullmatch( - r"[0-9a-f]{12}", image + if ( + image + and image != "@favicon" + and not re.fullmatch(r"[0-9a-f]{12}", image) ): await ws.send_json( { diff --git a/pagerite/i18n.py b/pagerite/i18n.py index 36612ea..55d7c92 100644 --- a/pagerite/i18n.py +++ b/pagerite/i18n.py @@ -102,7 +102,9 @@ def select_language( return original -def hybrid_items(data: Data, node: Node, path: str, lang: str) -> list[tuple[bytes | None, str]]: +def hybrid_items( + data: Data, node: Node, path: str, lang: str +) -> list[tuple[bytes | None, str]]: """The served hybrid as (anchor, block text) pairs: the anchor is the ORIGINAL chunk hash behind the block (None for translation-only addition blocks), in article order. diff --git a/pagerite/views.py b/pagerite/views.py index 0b4fb01..ceaf4bd 100644 --- a/pagerite/views.py +++ b/pagerite/views.py @@ -381,8 +381,15 @@ def _layout( doc.link(rel="alternate", hreflang=hreflang, href=href) # Feed/LLM discovery links (see pagerite/feeds.py): identical on every # page, so the positional sync (swapdoc.js) is unaffected. - doc.link(rel="alternate", type="application/feed+json", title="JSON Feed", href="/feed.json") - doc.link(rel="alternate", type="application/rss+xml", title="RSS feed", href="/feed.xml") + doc.link( + rel="alternate", + type="application/feed+json", + title="JSON Feed", + href="/feed.json", + ) + doc.link( + rel="alternate", type="application/rss+xml", title="RSS feed", href="/feed.xml" + ) doc.link(rel="llms-txt", type="text/markdown", title="llms.txt", href="/llms.txt") for key, value in (social or {}).items(): if value: