935331ff0bc35360215a370873d4651678f9be68
Sunday Comics - Webcomic Flask App
A Flask-based webcomic website with server-side rendering using Jinja2 templates.
Features
- Comic viewer with navigation (First, Previous, Next, Latest)
- Archive page with thumbnail grid
- Responsive design
- Server-side rendering with Jinja2
- Clean, comic-focused layout
Project Structure
sunday/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── templates/ # Jinja2 templates
│ ├── base.html # Base template with navigation
│ ├── index.html # Latest comic page
│ ├── comic.html # Individual comic viewer
│ ├── archive.html # Archive grid
│ ├── about.html # About page
│ ├── contact.html # Contact page
│ └── 404.html # Error page
└── static/ # Static files
├── css/
│ └── style.css # Main stylesheet
├── js/
└── images/ # Comic images
└── thumbs/ # Thumbnail images for archive
Setup
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
- Visit http://127.0.0.1:5000 in your browser
Adding Comics
Currently, comics are stored in the COMICS list in app.py. Each comic needs:
{
'number': 1, # Comic number (sequential)
'title': 'Comic Title', # Title of the comic
'filename': 'comic-001.png', # Image filename
'date': '2025-01-01', # Publication date
'alt_text': 'Alt text for comic', # Accessibility text
'transcript': 'Optional transcript' # Optional transcript
}
Adding a New Comic
- Save your comic image in
static/images/(e.g.,comic-001.png) - Optionally, create a thumbnail in
static/images/thumbs/with the same filename - Add the comic entry to the
COMICSlist inapp.py
Upgrading to a Database
For production use, consider replacing the COMICS list with a database:
- SQLite for simple setups
- PostgreSQL/MySQL for production
- Use Flask-SQLAlchemy for ORM support
Customization
Branding
- Update "Sunday Comics" references in
templates/base.html - Update site title and footer text
Styling
- Modify
static/css/style.cssto change colors, fonts, and layout - Current color scheme uses blue (#3498db) and dark blue-gray (#2c3e50)
About Page
- Edit
templates/about.htmlto add your bio and comic information
Pages
/- Shows the latest comic/comic/<id>- View a specific comic by number/archive- Browse all comics in a grid/about- About the comic and author/contact- Contact form
License
[Add your license here]
Languages
Python
31.7%
HTML
23.7%
JavaScript
23.5%
CSS
20.3%
Dockerfile
0.8%