Directly publish your blog posts to GitHub Pages from the command line.
This is a simple command line tool, written in pure python, to allow users to start publishing posts on their jekyll/github powered blogs. It uses the GitHub api and hence does not need git and jekyll installed.
It supports multiple users, custom repositories, and a lot more to come.
Install it directly from PyPI using
pip3. Only supported on Python 3.x.
pip3 install ghPublish
- Write a top kek blog post, preferably in markdown or html.
- Rename your blog post appropriately to how you have Jekyll configured.
- Default is
- Default is
Now that you have the file ready.
- You need to preview the file locally.
ghPublish --preview -f <path to file>
- This will render your markdown file to html and automagically open in le browser.
- Publish the changes to github.
ghPublish -u <Username> -f <path to file>
- This works for both adding new files, and updating existing ones.
- Password is asked only once, then a token is generated and stored in a config file.
That's it. Your blog has been pushed live to
$ ghPublish --help usage: ghPublish [-h] (--preview | -u USER) -f FILE [-r REPO] [-l LOC] Directly publish your blog posts to GitHub Pages from the command line. optional arguments: -h, --help show this help message and exit Required: you can either preview the file, or supply a user to publish the file --preview preview a blog post locally. (default: False) -u USER, --user USER github username (default: None) -f FILE, --file FILE path to local file (default: None) Remote: optional details for publshing to a custom location in a repository -r REPO, --repo REPO optional repository name (default: None) -l LOC, --loc LOC optional file path in repostiory (default: None)
- mistune - pure python markdown renderer
- requests - http request library
Author: Mitesh Shah
Copyright (c) 2016 Mitesh Shah