Cybrkyd's git repositories

page-with-py • commit: 2be223a

commit 2be223a1f659d45d45e215ce09a998514f2291cc3bc62fda78a469b70fe6b9aa
author cybrkyd <vii@cybrkyd.com> 2025-09-21 14:17:56 +0100
committer cybrkyd <vii@cybrkyd.com> 2025-09-21 14:17:56 +0100

Commit Message

Minor change to pagination styling options by adding span with class. Moved SITE_TITLE to correct position

📊 Diffstat

pg-py/pg.py 8
1 files changed, 4 insertions(+), 4 deletions(-)

Diff

diff --git a/pg-py/pg.py b/pg-py/pg.py
index bd010b7..0643a3d 100644
--- a/pg-py/pg.py
+++ b/pg-py/pg.py
@@ -15,8 +15,8 @@ from email.utils import format_datetime
# Configuration
POSTS_PER_PAGE = 10
SITE_URL = "https://example.com"
- SITE_DESC = "Site Description"
SITE_TITLE = "My Site"
+ SITE_DESC = "Site Description"
CONTENT_LANGUAGE = "en"
SITE_LOGO = "/img/logo.png"
THEME = "basic"
@@ -85,6 +85,7 @@ def load_template_parts(theme_dir: Path):
main_file = theme_dir / 'main.html'
single_file = theme_dir / 'single.html'
tags_file = theme_dir / 'tags.html'
+ page_file = theme_dir / 'page.html'
if header_file.exists():
templates['header'] = header_file.read_text(encoding="utf-8")
@@ -116,7 +117,6 @@ def load_template_parts(theme_dir: Path):
templates['single'] = '<main class="single-page">\n<article class="post-content">\n{content}\n</article>\n</main>'
print("Warning: single.html not found in theme directory")
- page_file = theme_dir / 'page.html'
if page_file.exists():
templates['page'] = page_file.read_text(encoding="utf-8")
else:
@@ -368,7 +368,7 @@ def generate_index_page(templates, posts, output_dir: Path, page_num=1, is_pagin
prev_url = f"/tags/{tag_name}/page/{page_num-1}/" if page_num > 2 else f"/tags/{tag_name}/"
else:
prev_url = f"/page/{page_num-1}/" if page_num > 2 else "/"
- pagination_html += f'<a href="{prev_url}">Previous</a> '
+ pagination_html += f'<span class="previous"><a href="{prev_url}">Previous</a></span> '
if PAGINATION == "numbers":
for i in range(1, total_pages + 1):
@@ -385,7 +385,7 @@ def generate_index_page(templates, posts, output_dir: Path, page_num=1, is_pagin
if tag_name:
pagination_html += f'<a href="/tags/{tag_name}/page/{page_num+1}/">Next</a>'
else:
- pagination_html += f'<a href="/page/{page_num+1}/">Next</a>'
+ pagination_html += f'<span class="next"><a href="/page/{page_num+1}/">Next</a></span>'
pagination_html += '</div>'
description = "Blog post archive" if is_pagination else SITE_DESC