From 24dd74ae771916ad3cc42ff1fa7408cbed659c0e Mon Sep 17 00:00:00 2001 From: mi Date: Thu, 13 Nov 2025 15:07:30 +1000 Subject: [PATCH] :wrench: site url --- app.py | 3 ++- comics_data.py | 4 ++++ scripts/generate_rss.py | 5 ++--- templates/base.html | 4 ++-- templates/comic.html | 2 +- templates/index.html | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index a2b1ae5..c323e46 100644 --- a/app.py +++ b/app.py @@ -2,7 +2,7 @@ import os from datetime import datetime from flask import Flask, render_template, abort, jsonify, request from comics_data import ( - COMICS, COMIC_NAME, FULL_WIDTH_DEFAULT, PLAIN_DEFAULT, HEADER_IMAGE, FOOTER_IMAGE, + COMICS, COMIC_NAME, SITE_URL, FULL_WIDTH_DEFAULT, PLAIN_DEFAULT, HEADER_IMAGE, FOOTER_IMAGE, COMPACT_FOOTER, ARCHIVE_FULL_WIDTH, USE_COMIC_NAV_ICONS, USE_HEADER_NAV_ICONS, USE_FOOTER_SOCIAL_ICONS, SOCIAL_INSTAGRAM, SOCIAL_YOUTUBE, SOCIAL_EMAIL, API_SPEC_LINK @@ -20,6 +20,7 @@ def inject_global_settings(): """Make global settings available to all templates""" return { 'comic_name': COMIC_NAME, + 'site_url': SITE_URL, 'header_image': HEADER_IMAGE, 'footer_image': FOOTER_IMAGE, 'compact_footer': COMPACT_FOOTER, diff --git a/comics_data.py b/comics_data.py index 60a5da1..8ae4778 100644 --- a/comics_data.py +++ b/comics_data.py @@ -4,6 +4,10 @@ # Global setting: The name of your comic/website COMIC_NAME = 'Sunday Comics' +# Global setting: Your website's domain (used for RSS feed, Open Graph tags, etc.) +# Update this to your production domain when deploying +SITE_URL = 'http://localhost:3000' + # Global setting: Set to True to make all comics full-width by default # Individual comics can override this with 'full_width': False FULL_WIDTH_DEFAULT = False diff --git a/scripts/generate_rss.py b/scripts/generate_rss.py index 22bf1d7..f5150c6 100755 --- a/scripts/generate_rss.py +++ b/scripts/generate_rss.py @@ -10,10 +10,9 @@ from xml.dom import minidom # Add parent directory to path so we can import comics_data sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from comics_data import COMICS, COMIC_NAME +from comics_data import COMICS, COMIC_NAME, SITE_URL -# Configuration - update these for your site -SITE_URL = "http://localhost:3000" # Change to your actual domain +# Configuration SITE_TITLE = COMIC_NAME SITE_DESCRIPTION = "A webcomic about life, the universe, and everything" SITE_LANGUAGE = "en-us" diff --git a/templates/base.html b/templates/base.html index 748d4cd..a68bbd7 100644 --- a/templates/base.html +++ b/templates/base.html @@ -10,10 +10,10 @@ - + - + diff --git a/templates/comic.html b/templates/comic.html index 00bb878..7fb89b9 100644 --- a/templates/comic.html +++ b/templates/comic.html @@ -2,7 +2,7 @@ {% block meta_description %}{{ comic.alt_text }}{% if comic.author_note %} - {{ comic.author_note }}{% endif %}{% endblock %} -{% block og_image %}{{ request.url_root }}static/images/thumbs/{{ comic.filename }}{% endblock %} +{% block og_image %}{{ site_url }}/static/images/thumbs/{{ comic.filename }}{% endblock %} {% block content %}
diff --git a/templates/index.html b/templates/index.html index e3a0234..06337b0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,7 +3,7 @@ {% if comic %} {% block meta_description %}{{ comic.alt_text }}{% if comic.author_note %} - {{ comic.author_note }}{% endif %}{% endblock %} -{% block og_image %}{{ request.url_root }}static/images/thumbs/{{ comic.filename }}{% endblock %} +{% block og_image %}{{ site_url }}/static/images/thumbs/{{ comic.filename }}{% endblock %} {% endif %} {% block content %}