helpme-tips: fix page-2 Previous pager link and link stylesheet in layout

This commit is contained in:
zai-agent 2026-09-16 06:53:22 +00:00
parent 95defaf0fb
commit e9b534415b

View file

@ -32,6 +32,7 @@ def layout(title, desc, body, path='/', extra_head=''):
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/style.css">
<title>{esc(title)}</title> <title>{esc(title)}</title>
<meta name="description" content="{esc(desc)}"> <meta name="description" content="{esc(desc)}">
<link rel="canonical" href="{SITE_URL}{esc(path)}"> <link rel="canonical" href="{SITE_URL}{esc(path)}">
@ -123,7 +124,7 @@ def page_article(a, page_idx, total):
content = '\n'.join(parts) content = '\n'.join(parts)
nav = [] nav = []
if page_idx > 0: if page_idx > 0:
prev = '/' if page_idx == 1 else '/tips/%s/%d/' % (a['slug'], page_idx) prev = '/tips/%s/' % a['slug'] if page_idx == 1 else '/tips/%s/%d/' % (a['slug'], page_idx)
nav.append('<a class="btn ghost" href="%s">← Previous</a>' % prev) nav.append('<a class="btn ghost" href="%s">← Previous</a>' % prev)
nav.append('<span class="pageno">Page %d of %d</span>' % (page_idx + 1, total)) nav.append('<span class="pageno">Page %d of %d</span>' % (page_idx + 1, total))
if page_idx < total - 1: if page_idx < total - 1: