π A modern blog application built with a powerful Go stack, designed for speed and simplicity. This project serves blog posts written in Markdown from a local JSON file, providing a fast, server-rendered experience with a clean, responsive design.
-
Markdown-Powered: Blog posts are written in simple Markdown and stored in a allposts.json file.
-
Server-Side Rendering: Uses Templ for type-safe, component-based HTML rendering directly on the server.
-
High-Performance Backend: Built on Fiber, a Go web framework designed for high performance and low memory allocation.
-
Beautifully Styled: Styled with Tailwind CSS for a modern, utility-first design that is fully responsive.
-
Dynamic Content:
-
An archive page that lists all available blog posts.
-
Dynamic routes to render individual blog posts.
-
Fast Markdown Parsing: Leverages Goldmark for extremely fast and extensible Markdown-to-HTML conversion.
- Backend: Go
- Web Framework: Fiber
- Templating: Templ
- Styling: Tailwind CSS
- Markdown Parser: Goldmark
- File conversion: Python,
.
βββ handlers/ # Fiber request handlers
βββ models/ # Go struct definitions (e.g., Post)
βββ components/ # Templ components and HTML fragments (buttons)
βββ static/ # Static assets (CSS, images)
βββ services/ # API's for internal and database (fetch posts)
βββ templates/ # Templ components (.templ files)
βββ allposts.json # Data source for blog posts
βββ post_util.py # Add, modify or delete posts (allposts.json)
βββ go.mod # Go module dependencies (github.com/gofiber/fiber/v2)
βββ go.sum # Go check-sum validations (go.mod)
βββ main.go # Application entry point
Follow these instructions to get a copy of the project up and running on your local machine.
-
Go (version 1.21 or later)
-
Templ CLI
-
Tailwind CSS CLI (via npm)
Clone the repository:
git clone https://github.com/your-username/templ-go.git
cd templ-go
Generate Templ Components:
The templ CLI watches for changes and generates Go code from your .templ files.
templ generate --watch
Install Go dependencies:
go mod tidy
Build Tailwind CSS:
npx tailwindcss -i ./static/css/input.css -o ./static/css/output.css --watch
<script>https://cdn.tailwindcss.com</script>
Open a new terminal window and run the main Go program.
go run .
The server will be running on http://localhost:8080.


License
This project is licensed under the MIT License - see the LICENSE file for details.