From 46eba541f4135bcebc8d96134662eb4278e6b911 Mon Sep 17 00:00:00 2001 From: yuuki <> Date: Wed, 5 Mar 2025 08:57:28 +0000 Subject: [PATCH] =?UTF-8?q?/=3Flimit=3D0=E3=81=AE=E3=82=B5=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 4 ++-- templates/index.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index f47e475..8cfd389 100644 --- a/app.py +++ b/app.py @@ -227,9 +227,9 @@ async def api_ng_delete(item: NGItem): return PlainTextResponse("OK") @app.get("/") -async def home(req: Request): +async def home(req: Request, limit: int = 50): res = ctx["templates"].TemplateResponse(req, "index.html", { - "notes": get_litey_notes(limit=50), + "notes": get_litey_notes(limit=limit), "ng_words": get_ng_words() }) res.headers["Cache-Control"] = f"public, max-age=60, s-maxage=60" diff --git a/templates/index.html b/templates/index.html index c35af19..6d2af30 100644 --- a/templates/index.html +++ b/templates/index.html @@ -11,6 +11,7 @@

掲示板へようこそ!

良識のあるメッセージを心がけてください

荒らしが横行しているため、最初の50件のみ表示しています。

+

全て表示するにはこちら

{% for note in notes %}