From d718b59416ddc22a7fc4300e9fe759050dbffcd4 Mon Sep 17 00:00:00 2001 From: mi Date: Thu, 6 Nov 2025 21:32:40 +1000 Subject: [PATCH] :truck: move out comics data --- app.py | 29 +---------------------------- comics_data.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 28 deletions(-) create mode 100644 comics_data.py diff --git a/app.py b/app.py index bd55307..b2e3556 100644 --- a/app.py +++ b/app.py @@ -1,38 +1,11 @@ from flask import Flask, render_template, abort +from comics_data import COMICS app = Flask(__name__) # Configuration app.config['SECRET_KEY'] = 'your-secret-key-here' # Change this in production -# Sample comic data (in production, this would come from a database) -COMICS = [ - { - 'number': 1, - 'title': 'First Comic', - 'filename': 'comic-001.png', - 'date': '2025-01-01', - 'alt_text': 'The very first comic', - 'transcript': 'This is where your comic journey begins!' - }, - { - 'number': 2, - 'title': 'Second Comic', - 'filename': 'comic-002.png', - 'date': '2025-01-08', - 'alt_text': 'The second comic', - 'transcript': 'The adventure continues...' - }, - { - 'number': 3, - 'title': 'Third Comic', - 'filename': 'comic-003.png', - 'date': '2025-01-15', - 'alt_text': 'The third comic', - 'transcript': 'Things are getting interesting!' - }, -] - def get_comic_by_number(number): """Get a comic by its number""" diff --git a/comics_data.py b/comics_data.py new file mode 100644 index 0000000..f9bc84f --- /dev/null +++ b/comics_data.py @@ -0,0 +1,29 @@ +# Comic data +# Edit this file to add, remove, or modify comics + +COMICS = [ + { + 'number': 1, + 'title': 'First Comic', + 'filename': 'comic-001.png', + 'date': '2025-01-01', + 'alt_text': 'The very first comic', + 'transcript': 'This is where your comic journey begins!' + }, + { + 'number': 2, + 'title': 'Second Comic', + 'filename': 'comic-002.png', + 'date': '2025-01-08', + 'alt_text': 'The second comic', + 'transcript': 'The adventure continues...' + }, + { + 'number': 3, + 'title': 'Third Comic', + 'filename': 'comic-003.png', + 'date': '2025-01-15', + 'alt_text': 'The third comic', + 'transcript': 'Things are getting interesting!' + }, +]