Repo for the belchow.pl website (blog local site)
Find a file
2026-04-06 20:04:22 +02:00
belchow.pl/bike_trip_20260405 First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
cmd/blog Polish is now always default language, with English optional 2026-04-06 17:21:08 +02:00
content First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
internal Optimized images to webp so page loads faster. 2026-04-06 20:04:22 +02:00
opencode-config First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
scripts Optimized images to webp so page loads faster. 2026-04-06 20:04:22 +02:00
static Polish is now always default language, with English optional 2026-04-06 17:21:08 +02:00
templates Ready for release 2026-04-06 16:39:40 +02:00
.dockerignore First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
.gitignore First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
AGENTS.md First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
docker-compose.dev.yml First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
docker-compose.yml First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
Dockerfile Optimized images to webp so page loads faster. 2026-04-06 20:04:22 +02:00
go.mod First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
go.sum First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
LICENSE Initial commit 2026-04-06 08:02:06 +02:00
Makefile First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
opencode-docker.sh First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00
README.md First blog version. Blog entry from 2026-04-05 2026-04-06 15:58:17 +02:00

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)
  1. Build and run with Docker Compose:

    docker-compose -f docker-compose.dev.yml up --build
    
  2. Access the application:

Local Development

  1. Install dependencies:

    go mod download
    
  2. Optimize images (requires ImageMagick):

    chmod +x scripts/optimize-images.sh
    ./scripts/optimize-images.sh
    
  3. 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

  1. Create markdown files in content/{lang}/posts/
  2. Use the format: YYYY-MM-DD-slug.md
  3. 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

  1. Place original images in belchow.pl/{event_date}/
  2. Run make optimize-images to generate optimized versions
  3. 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: /health endpoint
  • Static files: Served from /static and /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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Contact

For questions or suggestions about the Bełchów.pl blog, please open an issue in the repository.