🎨 manage comics via yaml files

This commit is contained in:
mi
2025-11-15 19:20:21 +10:00
parent 91b6d4efeb
commit 13176c68d2
10 changed files with 419 additions and 80 deletions

View File

@@ -97,34 +97,17 @@ EMBED_ENABLED = True
# When enabled, users can easily copy a direct link to the current comic
PERMALINK_ENABLED = True
COMICS = [
{
'number': 1,
'title': 'First Comic',
'filename': 'comic-001.jpg',
'mobile_filename': 'comic-001-mobile.jpg', # Optional: mobile version of the comic
'date': '2025-01-01',
'alt_text': 'The very first comic',
'author_note': 'This is where your comic journey begins!',
'author_note_md': '2025-01-01.md', # Optional: use markdown from content/author_notes/2025-01-01.md (overrides author_note)
'full_width': True, # Optional: override FULL_WIDTH_DEFAULT for this comic
'plain': True, # Optional: override PLAIN_DEFAULT for this comic
'section': 'Chapter 1: The Beginning', # Optional: start a new section on archive page
},
{
'number': 2,
'filename': 'comic-002.jpg',
'date': '2025-01-08',
'alt_text': 'The second comic',
'full_width': True,
'plain': True,
},
{
'number': 3,
'title': 'Third Comic',
'filename': 'comic-003.jpg',
'date': '2025-01-15',
'alt_text': 'The third comic',
'author_note': 'Things are getting interesting!',
},
]
# Load comics from YAML files
from data_loader import load_comics_from_yaml, validate_comics
COMICS = load_comics_from_yaml('data/comics')
# Validate loaded comics
if not validate_comics(COMICS):
print("Warning: Comic validation failed. Please check your YAML files.")
# Show loaded comics count
if COMICS:
print(f"Loaded {len(COMICS)} comics from data/comics/")
else:
print("Warning: No comics loaded! Please add .yaml files to data/comics/")