GoBlog

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2025 License: MIT

README

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

GoBlog

Create a blog feed from posts written in Markdown!
Explore the docs »

View Example · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact

About The Project

GoBlog aims to make writing blog posts easy for developers. Write your posts in markdown and generate HTML pages ready to be deployed. There are two core parts to GoBlog, GoBlogGen and GoBlogServ.

GoBlogGen

GoBlogGen is the core of the project and takes the markdown posts you have written, and generates a directory of HTML and CSS files based on the configuration provided. This configuration allows you to set custom stylesheets, outline templates, homepages and more!

Some of you may stop at this point and take the generated static files, dump them into a web server and move on with your day.

For those of you who want a little more... GoBlogServ

GoBlogServ

GoBlogServ is a set of APIs which can be used to take the static HTML generated by GoBlogGen, and push them a bit further. Think comments, likes and more.

To get started with GoBlogServ, check out the template repository or a live demo!

(back to top)

Built With

  • GoLang

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

  • You will need Go installed on your machine. You can get this from Go.Dev or via your package manager.
  • Some posts written in Markdown!

GoBlogGen Usage

  1. Clone the repo
    git clone https://github.com/harrydayexe/GoBlog.git
    cd GoBlog
    
  2. Move your posts into a directory
    cp /path/to/posts .
    
  3. Change config.yaml where necessary
    vim config.yaml
    
  4. Run GoBlogGen
    go run ./cmd/GoBlogGen
    

Customizing Templates

GoBlog uses HTML templates for rendering your blog. You can customize the look and feel by creating your own templates.

Using Default Templates

By default, GoBlog uses templates from ./templates/defaults/. These include:

  • post.html - Individual blog post page
  • index.html - Blog index/list page
  • tag.html - Tag filter page
Creating Custom Templates
  1. Create a new directory for your templates:

    mkdir ./my-templates
    
  2. Copy the default templates as a starting point:

    cp templates/defaults/* ./my-templates/
    
  3. Edit the templates to match your design. Each template must exist:

    • post.html
    • index.html
    • tag.html
  4. Update your config.yaml:

    template_dir: "./my-templates"
    
Template Data

Templates have access to the following data:

post.html:

  • .Post.Title - Post title
  • .Post.Description - Post description
  • .Post.FormattedDate - Human-readable date
  • .Post.ShortDate - ISO date (YYYY-MM-DD)
  • .Post.Tags - Array of tags
  • .Post.HTMLContent - Rendered HTML content
  • .Site.Title - Site title
  • .Site.Description - Site description
  • .Site.Author - Site author
  • .BlogPath - Blog URL path

index.html:

  • .Posts - Array of posts for this page
  • .AllTags - Array of all tags across all posts
  • .Page - Current page number
  • .TotalPages - Total number of pages
  • .HasNext - Boolean, true if there's a next page
  • .HasPrev - Boolean, true if there's a previous page
  • .Site.* - Site metadata (same as post.html)
  • .BlogPath - Blog URL path

tag.html:

  • .Tag - Current tag being filtered
  • .Posts - Array of posts with this tag
  • .AllTags - Array of all tags across all posts
  • .Site.* - Site metadata
  • .BlogPath - Blog URL path
Template Functions

The following functions are available in templates:

  • {{add .Page 1}} - Add two numbers
  • {{sub .Page 1}} - Subtract two numbers

See templates/defaults/ for complete examples.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Top contributors:

contrib.rocks image

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Harry Day - @harrydayexe - contact@harryday.xyz

Project Link: https://github.com/harrydayexe/GoBlog

(back to top)

Directories

Path Synopsis
cmd
GoBlogGen command
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL