Skip to content

Instantly share code, notes, and snippets.

@ww9
Last active January 12, 2024 23:00
Show Gist options
  • Star 39 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ww9/4419877e9be023e465b9ff99ecb75f40 to your computer and use it in GitHub Desktop.
Save ww9/4419877e9be023e465b9ff99ecb75f40 to your computer and use it in GitHub Desktop.
Using Gist as a blog #blog

Blogging with Gist

Gist simplicity can turn blogging into a liberating experience.

Pros Cons
✅ Free, simple, fast, hassle-free ❌ Image upload in comments only
✅ Tagging ❌ No post pinning
✅ Search ❌ Doesn't look like a blog
✅ Revisions ❌ Unfriendly URLs
✅ Comments ❌ Cannot disable comments
✅ Delete comments ❌ Date only shown in Revisions
✅ Markdown ❌ Not WYSIWYG
✅ Syntax highlighting ❌ No fancy theme
✅ One click copy (Fork)
git clone gist URL
✅ Not Wordpress, not Medium
✅ No ads
✅ No facebook/google tracking
✅ Reliable, secure, accessible

How it works

A Gist post is a collection of one or more files. To use it as a blog, simply create a markdown (.md) file for each post and you're set.

If you're like me who also use Gist to share non non-blogging content, simply append #blog to blog Gist titles. Doing so allows us to search blog posts: user:ww9 #blog

Search

Filters that work in Gist search.

Search Gists
stars:>100 with more than 100 stars
user:ww9 from user ww9
#blog with #blog in title or content
NOT #misc not containing #misc in title or content
extension:go with .go files
forks:<200 with less than 200 forks
size:1000..4000 having a file between 1000kb and 4000kb
size:>4000 having a file larger than 4000kb

Search examples

Search Result
#blog user:ww9 My blog posts
stars:>100 extension:go .go gists with more than 100 stars

Comments

Users can upload images in comments simply copying and pasting the image using CTRL+V. Drag-n-Drop works as well. I guess this wont work on mobile phones.

You can delete any comment from your gists.

Tips

  • Multiple files in a post are listed in alphabetical order. To make a file appear first on the list, prepend its name with a space. To make it appear last, prepend filename with ~. Numbers also work.

Tools

Tool Notes
GitHub Flavored Markdown Spec Comprehensive
Stackedit - online markdown editor Feature rich with live preview. Publishes to Github (haven't tested).
Minimalist Online Markdown Editor Fast with live preview.

Formatting with Markdown

See my other gist called Gist Markdown Examples for ways to format posts in Gist.

Happy blogging!

@avi-perl
Copy link

🤔 with the GitHub API, the contents and comments of a gist could be easily retrieved. A combination of .md and code files, ordered as you've indicated, could be presented on a regular blog for a native experience, comments included! Interaction could be encouraged by pushing readers of the blog to comment on GitHub.

This would address many of your cons!

I've been looking for a way to have a blog on my static personal site, this seems like a pretty interesting option 😃.

@vkz
Copy link

vkz commented May 29, 2023

This is totally a thing: git.ht

Emphasis is on RSS, but each subdomain gets a hosted feed that, I guess, majority of people expect these days. Here's mine: vlad.git.ht. A bit more about it in git.ht in a nutshell. Each hoot also gets necessary meta tags so that sites like Twitter show nicer preview when you share them.

A few nice to have features missing, but will make appearance soon enough, I guess. Won't hurt to raise an issue if you really want something or there's a bug: https://github.com/fullmeta-dev/githoot-public

In fact, you could trivially turn this gist we're commenting on into a hoot by renaming its main file into hoot.md, assuming you've claimed a subdomain. This is meant to be hassle-free blogging for someone starting out or old and busy, like me. So, yeah, get it a go - works for me. I started blogging after, what, a decade in the industry. Late bloomer :)

@avi-perl
Copy link

avi-perl commented Jun 2, 2023

Amazing, thank you for sharing @vkz !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment