To be able to use Google’s Blogger [tm] service with markdown. This in turn avoids a lock-in into their specific service. It also allows you to store your clean and clear markup in a version management system of your own choosing (subversion, git, mercurial etc.), while keeping the convenience of Google Blogger (cookie banner, HTML layouts, discussion feature, Google Analytics [tm], AdSense [tm] etc.).
BlogTool needs a Java runtime environment. It has been developed on Linux, but it should also run on Windows and Mac.
The BlogTool separates two types of data: html generated from your markdown and resource files like images. The html gets pushed to Google Blogger, the resource files can be pushed via a 3rd party tool like rsync to a separate, simple file server.
The way how the separation works, provides you with another feature: unlike Hugo or Jekyll, you can effortlessly group all of a post’s assets in one directory instead of having to refer to a central assets directory (which is mighty stupid IMHO).
Be aware that the main operational mode is to push your local primary data (markdown) to Google Blogger [tm]. The copies existing at Google Blogger are treated as expendable. Do not use the Google Blogger frontend or any other tool together with BlogTool. Always work on your local, primary markdown data and use that to export. If you really want to mix your blogging experience with other tools that directly work against Google Blogger, you can detect blog posts that will be overwritten by BlogTool via the checksum stored at the start of each blog post:
<!-- 4369fe7972770e3c0506401ff9ef50ae6eb19065 -->
Don’t edit blog posts directly that start with such a marker.
Make a backup of your Google Blogger [tm] data/posts first.
You don’t really need to install BlogTool, unzipping the zip distribution and having a recent Java runtime
environment avilable should be enough. For convenience, however, a shell script is included. Just put the unzipped
blogtool folder on your PATH and you can run BlogTool via the
install -d ~/.local cd ~/.local unzip /path/to/zip/file echo "export PATH=\$HOME/.local/blogtool:\$PATH" >> ~/.bashrc
This works on Linux/UNIX-like system with a BASH-like shell (which includes cygwin).
java -jar blogtool.jar --publish -b https://your-blog.blogspot.com
That command will traverse the directory structure below your current working directory and look for files ending in ‘.md’ or ‘.markdown’. The markdown files (articles) are expected to have the following format:
--- title: some title tags: - label 1 - label 2 --- some content using pegdown markup
The frontmatter is in Yaml format. The ‘title’ specification inside the frontmatter is required, the tags (labels) are optional.
During the first run, BlogTool will detect that the markdown file has no post id defined in its frontmatter and it will publish the article. Upon publishing, the following data will be added to the frontmatter:
id will be used in future runs to update the published remote post at blogspot.com.
url has been added simply for convenience, while
date will keep track/store when you first published
your post - you can change this date manually anytime.
The BlogTool detects a necessary update by first fetching all remote posts, and then checking if anything of the following has changed:
If you don’t want to manually upload image resources and other file types, you can use the ‘-p’ option to adjust the generated resource links to point to another website. Example:
java -jar blogtool.jar --publish -b https://blog.your.domain -p https://files.your.domain
Then use a tool like rsync to copy your assets in place:
rsync -ain --del --usermap="*":www-data --groupmap="*":www-data --exclude="**/*.md" \ ./ firstname.lastname@example.org:/var/www/files.your.domain/html/
n argument after verifying that nothing important gets deleted.
This command likely needs to be adapted if you are using the virtual server for the files.your.domain
for other things than just backing your Google Blogger blog. Personally, I’m running nginx on Debian 8 in
conjunction with certbot. The domain is hosted on nameinfo.com and the vserver is sold by ultravps.eu.
The default nginx configuration root setting was changed to
When specifying the
-p argument, relative resource links will be verified to point to a local resource file.
Example: if ‘post001/content.md’ contains the markup
(graph.png), the BlogTool will abort processing if
it doesn’t find a readable file at
post001/graph.png. The generated HTML will then point to:
and the nginx server will serve the file from:
BlogTool is currently being developed using OpenJDK 11. It’s recommended to use the same runtime environment.
If you have multiple blogs and need multiple Google account logins for them, add
to the command line.
$id is an arbitrary identifier to identify your credentials, ie. use one unique
per Google login.
If you already have posts on Google Blogger [tm], you might want to run
java -jar blogtool.jar -b https://blog.your.domain -i
once to import them into your local repository.
BlogTool is free to use.
The free BlogTool version adds an invisible tag to published blog posts which makes the use of BlogTool theoretically trackable across the WWW.
BlogTool’s homepage can be found at:
Subscribe to the blog to get update notifications or use the comment section to give feedback or ask questions.
If you like BlogTool, think about using the donation option on the website.
blogtoolshell script so users are able to run the tool from PATH (should also work under Windows if cygwin is in use.