A minimal and flexible blog generator based on GitHub Gist.
MIT License
A minimal and flexible blog generator based on GitHub Gists with SEO, Templating, Syntax Highlighting, and Metadata support out-of-the-box.
sitemap.xml
and robots.txt
are automatically generated according to your gist entries.Here are some of the concepts that made me utilize/choose GitHub Gists:
Also GitHub's Markdown editor is pretty cool and gisture uses pulldown-cmark which supports GitHub flavored elements.
$ cargo install --git https://github.com/mufeedvh/gisture.git
Prerequisites:
$ 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.
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.
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.
Here are some screenshots of the basic starter template. Admittedly it's not shiny and it's just made for demonstration purposes, the starter templates will show you how to use the template variables or port another theme to support gisture.
index.html
- The homepage.page.html
- A blog/page entry.page_list.html
- The blog listing element.404.html
- Page Not Found template.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.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. :)
Ways to contribute:
Licensed under the MIT License, see LICENSE for more information.
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.
It's Markdown converted to HTML so it needs to be unescaped and one does not simply XSS their own blog.