Repo for the belchow.pl website (blog local site)
| belchow.pl/bike_trip_20260405 | ||
| cmd/blog | ||
| content | ||
| internal | ||
| opencode-config | ||
| scripts | ||
| static | ||
| templates | ||
| .dockerignore | ||
| .gitignore | ||
| AGENTS.md | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| opencode-docker.sh | ||
| README.md | ||
Bełchów.pl - Village Community Blog
A bilingual (Polish/English) static blog for the Bełchów village community, built with Go and Docker.
Features
- Bilingual support: Polish and English content with language switching
- Static content: Markdown files with YAML front matter (no database)
- Image galleries: Optimized images with lightbox functionality
- Responsive design: Clean modern CSS, mobile-first approach
- Dockerized: Multi-stage build with image optimization
- Traditional pagination: Easy navigation through posts
Project Structure
/app
├── cmd/blog/main.go # Application entry point
├── internal/ # Go packages
│ ├── handlers/ # HTTP handlers
│ ├── content/ # Markdown parsing and loading
│ ├── middleware/ # Language middleware
│ ├── templates/ # Template rendering
│ └── images/ # Image optimization
├── templates/ # HTML templates
├── static/ # CSS and JavaScript
├── content/ # Bilingual content
│ ├── en/ # English content
│ └── pl/ # Polish content
├── assets/images/ # Optimized images
├── scripts/ # Build scripts
└── belchow.pl/ # Original photos (to be processed)
Quick Start
Prerequisites
- Docker and Docker Compose
- Go 1.22+ (for local development)
Using Docker (Recommended)
-
Build and run with Docker Compose:
docker-compose -f docker-compose.dev.yml up --build -
Access the application:
- English: http://localhost:8080/en/
- Polish: http://localhost:8080/pl/
Local Development
-
Install dependencies:
go mod download -
Optimize images (requires ImageMagick):
chmod +x scripts/optimize-images.sh ./scripts/optimize-images.sh -
Run the application:
go run cmd/blog/main.go
Makefile Commands
make dev # Start development server
make build # Build binary
make test # Run tests
make clean # Clean build artifacts
make docker-build # Build Docker image
make docker-run # Run Docker container
make optimize-images # Optimize images
Content Management
Adding New Posts
- Create markdown files in
content/{lang}/posts/ - Use the format:
YYYY-MM-DD-slug.md - Include YAML front matter:
--- title: "Post Title" date: 2024-04-05 author: "Author Name" excerpt: "Brief description" images: - directory/image1.jpg - directory/image2.jpg ---
Adding Images
- Place original images in
belchow.pl/{event_date}/ - Run
make optimize-imagesto generate optimized versions - Reference images in posts using:
assets/images/{directory}/{filename}
Deployment
Production Docker Build
docker build -t belchow-blog:latest .
docker run -p 8080:8080 belchow-blog:latest
Configuration
- Port: 8080 (configurable via PORT environment variable)
- Health check:
/healthendpoint - Static files: Served from
/staticand/assets
Environment Variables
PORT: Server port (default: 8080)GIN_MODE: Gin mode (debug/release)
Technology Stack
- Backend: Go 1.22 with Gin framework
- Templates: Go html/template with custom CSS
- Markdown: gomarkdown/markdown parser
- Image optimization: ImageMagick (build-time)
- Container: Multi-stage Docker build
- Frontend: Vanilla JavaScript for lightbox and language switching
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Contact
For questions or suggestions about the Bełchów.pl blog, please open an issue in the repository.