Bashblog – a single bash script to create blogs

ludicrousdispla1 pts0 comments

GitHub - cfenollosa/bashblog: A single Bash script to create blogs. Download, run, write, done! · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

cfenollosa

bashblog

Public

Notifications<br>You must be signed in to change notification settings

Fork<br>237

Star<br>1.8k

master

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>294 Commits<br>294 Commits

README.md

README.md

bb.sh

bb.sh

View all files

Repository files navigation

bashblog

A single Bash script to create blogs.

I created it because I wanted a very, very simple way to post entries to a blog by using a public folder on my server, without any special requirements and dependencies. Works on GNU/Linux, OSX and BSD.

How simple? Just type ./bb.sh post and start writing your blogpost.

You can see a sample here: read the initial blog post. That page was 100% generated using bashblog, no additional tweaking.

Check out other bashblog users

Usage

Download the code and copy bb.sh into a public folder (for example, $HOME/public_html/blog) and run

./bb.sh

This will show the available commands. If the file is not executable, type chmod +x bb.sh and retry.

Before creating your first post, you may want to configure the blog settings (title, author, etc).<br>Read the Configuration section below for more information

To create your first post, just run:

./bb.sh post

It will try to use Markdown, if installed. To force HTML:

./bb.sh post -html

The script will handle the rest.

When you're done, access the public URL for that folder (e.g. http://server.com/~username/blog)<br>and you should see the index file and a new page for that post!

How to...

Please read the wiki to learn how to use the advanced features of Bashblog, such as headers and footers, static pages, and more.

Features

Ultra simple usage: Just type a post with your favorite editor and the script does the rest. No templating.

No installation required. Download bb.sh and start blogging.

Zero dependencies. It runs just on base utils (date, basename, grep, sed, head, etc)

GNU/Linux, BSD and OSX compatible out of the box, no need for GNU coreutils on a Mac.<br>It does some magic to autodetect which command switches it needs to run depending on your system.

All content is static. You only need shell access to a machine with a public web folder.<br>Tip: advanced users could mount a remote public folder via ftpfs and run this script locally

Allows drafts, includes a simple but clean stylesheet, generates the RSS file automatically.

Support for tags/categories

Support for Markdown, Disqus comments, Twitter, Feedburner, Google Analytics.

The project is still maintained as of 2016. Bugs are fixed, and new features are considered (see "Contributing")

Everything stored in a single ~1k lines bash script, how cool is that?! ;)

Configuration

Configuration is not required for a test drive, but if you plan on running your blog with bashblog, you will<br>want to change the default titles, author names, etc, to match your own.

There are two ways to configure the blog strings:

Edit bb.sh and modify the variables in the global_variables() function

Create a .config file with your configuration values -- useful if you don't want to touch the script and be able to update it regularly with git

The software will load the values in the script first, then overwrite them with the values in the .config file.<br>This means that you don't need to define all variables in the config file, only those which you need to override<br>from the defaults.

The format of the .config file is just one variablename="value" per line, just like in the global_variables()<br>function. Please remember: quote the values, do not declare a variable with the dollar sign, do not use<br>spaces around the equal sign.

bashblog uses the $EDITOR environment value to open the text editor.

Detailed features

A simple but nice and readable design, with nothing but the blog posts

NEW on 2.0 Markdown support via a third-party library.

The easiest method is to download<br>Gruber's Markdown.pl

Post preview

Save posts as drafts and resume editing...

post bashblog script file blog create

Related Articles