A minimal and flexible blog generator based on GitHub Gists.

Overview

gisture

Utilizing GitHub Gists as a Blogging Platform

version

A minimal and flexible blog generator based on GitHub Gists with SEO, Templating, Syntax Highlighting, and Metadata support out-of-the-box.

Table of Contents

Features

  • Single Binary - Just run the binary and it will generate the starter boilerplate.
  • Simple Configuration - A simple JSON file will be created upon initiation which has everything you need to setup your blog.
  • Templating - A set of template variables are prefixed to write your own blog template or port any blog theme easily using everyone's familiar Handlebars. (See Templating)
  • SEO Utility - A sitemap.xml and robots.txt are automatically generated according to your gist entries.
  • Syntax Highlighting - Every code snippet in your Gist will be highlighted in the generated HTML and you can add your own syntax spec with Sublime Text syntax definitions. (Thanks to syntect)
  • Helpful Log Messages - Every error case has been handled with a helpful and verbose error message to provide a breeze CLI experience.
  • Caching - Since Gists are fetched from the API, building multiple blog entries will take time hence gisture handles a disk cache and only build when a gist is updated.

Why Gist?

Here are some of the concepts that made me utilize/choose GitHub Gists:

  • Git: You can use git to edit and manage a gist just like a repository.
  • Hosting: Your Gists will exist as long as GitHub exists.
  • Integrated Comment Section: Every gist has a comment section which supports Markdown.
  • Transparent: As it's based on gists, anyone can check revisions to see the changes made to a blog entry.
  • Starring: You can bookmark a gist entry into your GitHub account by starring it.

Also GitHub's Markdown editor is pretty cool and gisture uses pulldown-cmark which supports GitHub flavored elements.

Installation

$ cargo install --git https://github.com/mufeedvh/gisture

Install Rust/Cargo

Build From Source

Prerequisites:

  • Git
  • Rust
  • Cargo (Automatically installed when installing Rust)
  • A C linker (Only for Linux, generally comes pre-installed)
$ git clone https://github.com/mufeedvh/gisture.git
$ cd gisture/
$ cargo build --release

The first command clones this repository into your local machine and the last two commands enters the directory and builds the source in release mode.

Usage

A gisture blog should have xyz.blog.md as it's Gist filename where /xyz becomes the permalink, description as it's meta description, a Markdown title (# Title) for it's title.

Setup configuration and Generate template boilerplate:

$ gisture

Build blog files with the configuration:

$ gisture build

Open up a preview web server on port 1337:

$ gisture serve 1337

Just running serve will open up the web server on a random free port.

Templating

gisture uses Handlebars as it's templating engine. All you need to make/port a theme for your blog, are these files and a couple of template variables which are automatically generated upon initiation.

Template Files

  • index.html - The homepage.
  • page.html - A blog/page entry.
  • page_list.html - The blog listing element.
  • 404.html - Page Not Found template.

Template Variables

NOTE: Just refer to the templates/ directory to get up and running quickly, it has a starter template that utilizes these variables.

Blog:

  • {{ blog_title }} - The home title of the blog.
  • {{ blog_description }} - The home description of the blog.
  • {{ blog_url }} - The URL of the blog.
  • {{ blog_list }} - The list of all the blog/page entries as an HTML element. (blog_list.html)

Gist:

  • {{ page_title }} - A blog/page entry's title.
  • {{ page_description }} - A blog/page entry's description.
  • {{ page_url }} - The full URL of a blog/page entry.
  • {{ published_date }} - The published datetime of a blog/page entry.
  • {{ updated_at }} - The recent update datetime of a blog/page entry.
  • {{ blog_contents }} - The content of the blog/page entry.

Modification Guide

Here are some code pointers if you want to modify gisture to fit your own needs or to add new features. I have tried to make the code verbose and easier to modify. :)

API Guide

Contribution

Ways to contribute:

  • Suggest a feature
  • Report a bug
  • Fix something and open a pull request
  • Help me document the code
  • Spread the word
  • Create a better starter template for gisture because I suck at CSS

License

Licensed under the MIT License, see LICENSE for more information.

FAQ

  1. Why?

This is the embodiment of the automation XKCD comic, all I wanted to do was write a blog (which I didn't) and this is the result. I am not a fan of static site generators because of the markdown metadata section + the disqus comment hosting shenanigans (I don't like disqus) although utteranc.es is pretty cool. So I set out to find another static solution and ended up deciding to utilize Gist as a blogging platform because it comes with my favorite Markdown editor, an excellent comment section, starring for bookmarks and hence the yoink. Hopefully someone other than me who actually wants to write a blog finds it useful so putting it out there.

  1. Why are the Handlebars variables unescaped?

It's Markdown converted to HTML so it needs to be unescaped and one does not simply XSS their own blog.

Liked the project?

Support the author by buying him a coffee!

Buy Me A Coffee


You might also like...
Murasaki is a Fast, Secure, and Reliable Webkit based web browser.
Murasaki is a Fast, Secure, and Reliable Webkit based web browser.

Murasaki is a Fast, Secure, and Reliable Webkit based web browser. Table of Contents Goals Status Usage License Goals Security: Be secure, and not com

📝 Web-based, reactive Datalog notebooks for data analysis and visualization
📝 Web-based, reactive Datalog notebooks for data analysis and visualization

Percival is a declarative data query and visualization language. It provides a reactive, web-based notebook environment for exploring complex datasets, producing interactive graphics, and sharing results.

Layers, extractors and template engine wrappers for axum based Web MVC applications

axum-template Layers, extractors and template engine wrappers for axum based Web MVC applications Getting started Cargo.toml [dependencies] axum-templ

HTTP Proxy based solution for real-time interception and prioritization of SQL queries.
HTTP Proxy based solution for real-time interception and prioritization of SQL queries.

starproxy ⚠️ starproxy is a prototype: Not currently used in production, but will likely be some day. Table of Contents starproxy Table of Contents Ba

axum-serde is a library that provides multiple serde-based extractors and responders for the Axum web framework.

axum-serde 📑 Overview axum-serde is a library that provides multiple serde-based extractors / responses for the Axum web framework. It also offers a

A web application to configuration Caddy based on MoonZoon.

Cream A web application to configuration Caddy based on MoonZoon. MoonZoon is a Rust Fullstack Framework. Live demo Run on a local machine Check you'v

A GUI frontend in Rust based on web-view
A GUI frontend in Rust based on web-view

neutrino I am not working anymore on this project. If you want to become a maintainer of neutrino, please answer to this issue. Preamble Docs | Repo |

JLM: A research compiler based on the RVSDG IR

JLM: A research compiler based on the RVSDG IR Jlm is an experimental compiler/optimizer that consumes and produces LLVM IR. It uses the Regionalized

Based on the Book Computer Graphics from Scratch
Based on the Book Computer Graphics from Scratch

raytracing_basic v1 Description Based on the Book Computer Graphics from Scratch Dependencies Good Web Game Build and run cargo build --release

Comments
  • Running on Digital Ocean

    Running on Digital Ocean

    I need to learn how to use this! I have a very cool idea that I believe this will help me with! I now just need to understand some basics. How do I get this on the web? I have a DigitalOcean Droplet with Gesture on it. I edit the github_username & blog_url to what I need. I point my DNS to the DO droplet and nothing. Can you please help me with this lol

    opened by rjahrj 3
  • Too many <h1>s

    Too many

    s

    Problem

    For various reasons including screen readers and semantic HTML, there should only be one top-level <h1> element per page.

    Solution

    AFAIK gisture is just consuming whatever is coming from the raw markdown. It should either take it's first-level heading from the markdown file when it detects one is present. The alternative of just leveling all markdown headings one down (unless already at the bottom-level of <h6> seems an inferior solution.

    I don't know Rust but I might hack on it and see what I can do. No promises though given I would be starting from zero.

    opened by nat-418 2

Releases(v0.1.0)
Owner
Mufeed VH
organized chaos.
Mufeed VH
Discover GitHub token scope permission and return you an easy interface for checking token permission before querying GitHub.

github-scopes-rs Discover GitHub token scope permission and return you an easy interface for checking token permission before querying GitHub. In many

null 8 Sep 15, 2022
A Blog & RSS system written in Rust based on Luke Smith's LB.

OB - Oliver's Blog Script A Blog and RSS system written in Rust. Features Converts blog entries written in Markdown into HTML. ✍?? Keeps a rolling blo

Oliver Brotchie 19 Aug 28, 2022
Yew + Axum + blog = Yab

Yew + Axum + blog = Yab

STUDIO RSBM 13 Dec 5, 2022
An API to track various stats written in Rust. Tracking Github, Wakatime, Spotify, and Duolingo

Null API API For collecting data Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Project Built With Getting St

The Null Dev 2 Dec 15, 2022
Rustypaste is a minimal file upload/pastebin service.

Rustypaste is a minimal file upload/pastebin service.

Orhun Parmaksız 169 Jan 1, 2023
Turn GitHub into an RSS reader

NotCraft::NotFeed An RSS reader running entirely from your GitHub repo. Free hosting on GitHub Pages. No ads. No third party tracking. No need for bac

NotCraft 22 Nov 30, 2022
👦 🗞 Paperboy is a GitHub template that delivers RSS by email.

Paperboy Paperboy is a GitHub template that delivers RSS by email. Why? Free, no trackers, easy to set up, and does the job. Usage Click on "use this

Eduardo Stuart 12 Jul 5, 2022
A fast static site generator in a single binary with everything built-in. https://www.getzola.org

zola (né Gutenberg) A fast static site generator in a single binary with everything built-in. Documentation is available on its site or in the docs/co

Zola 10.1k Jan 10, 2023
Oinky - A blazing fast, data-oriented static site generator.

Oinky Oinky is a static site generator, written in Rust, that compiles Handlebars templates and Markdown files into a static site. Oinky also enables

Asko Nõmm 4 Jun 18, 2022
⚡ A Blazingly-Fast Static Site Generator, built with Rust.

Stuart A Blazingly-Fast Static Site Generator. Download Now » Stuart is a very fast and flexible static site generator, with build times as low as 0.1

William Henderson 5 Nov 25, 2022