bashblog/README.md

91 lines
4.0 KiB
Markdown
Raw Normal View History

2013-02-21 14:53:50 +00:00
bashblog
========
2014-01-17 09:08:53 +00:00
A single Bash script to create blogs.
2013-02-21 16:19:29 +00:00
2014-01-17 09:08:53 +00:00
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.
2013-02-21 16:19:29 +00:00
2014-01-17 09:08:53 +00:00
You can see it live here: [read the initial blog post](http://mmb.pcb.ub.es/~carlesfe/blog/creating-a-simple-blog-system-with-a-500-line-bash-script.html). My blog has been 100% generated using bashblog, no additional tweaking.
2013-02-21 15:00:05 +00:00
2014-01-10 09:51:48 +00:00
Features
--------
2014-01-17 09:08:53 +00:00
- No installation required. Download `bb.sh` and start blogging.
- Ultra simple usage: Just type a post with your favorite editor and the script does the rest. No templating.
- All content is static. You only need shell access to a machine with a public web folder.
*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 Markdown, Disqus comments, Twitter, Feedburner, Google Analytics.
2014-01-10 09:51:48 +00:00
- GNU/Linux, BSD and OSX compatible out of the box (no need for GNU `coreutils` on a Mac)
2014-01-17 09:08:53 +00:00
- Everything stored in a single 700-line bash script, how cool is that?! ;)
2014-01-10 09:51:48 +00:00
2013-02-21 15:01:54 +00:00
Usage
-----
2014-01-17 09:08:53 +00:00
Copy bb.sh into a public folder (for example, `$HOME/public_html/blog`) and run
2013-02-21 15:04:03 +00:00
2013-02-21 15:03:40 +00:00
./bb.sh
2013-02-21 15:01:54 +00:00
2013-07-08 09:32:13 +00:00
This will show the available commands. If the file is not executable, you can either `chmod +x bb.sh`
or run it with `bash bb.sh`
2013-02-21 15:01:54 +00:00
2014-01-17 09:08:53 +00:00
**Before creating your first post, you may want to configure the blog settings (title, author, etc).
2014-01-10 09:51:48 +00:00
Read the Configuration section below for more information**
2013-02-21 15:37:55 +00:00
2014-01-10 09:51:48 +00:00
To create your first post, just run:
2013-02-21 15:10:02 +00:00
./bb.sh post
2014-01-17 09:08:53 +00:00
When you're done, access the public URL for that folder (e.g. `http://server.com/~username/blog`)
and you should see the index file and a new page for that post!
2013-02-21 15:10:02 +00:00
2013-02-21 15:00:05 +00:00
2014-01-10 09:51:48 +00:00
Configuration
-------------
Configuration is not required for a test drive, but if you plan on running your blog with bashblog, you will
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
2014-01-10 10:02:07 +00:00
- Create a `.config` file with your configuration values (useful if you don't want to touch the script)
2014-01-10 09:51:48 +00:00
The software will load the values in the script first, then overwrite them with the values in the `.config` file.
This means that you don't need to define all variables in the config file, only those which you need to override
from the defaults.
2014-01-10 10:02:07 +00:00
The format of the `.config` file is just one `variablename="value"` per line, just like in the `global_variables()`
2014-01-17 09:08:53 +00:00
function. **Please remember:** quote the values, do not declare a variable with the dollar sign, do not use
spaces around the equal sign.
2014-01-10 10:02:07 +00:00
2014-01-17 09:08:53 +00:00
bashblog uses the `$EDITOR` environment value to open the text editor.
2014-01-10 09:51:48 +00:00
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 (e.g.
2013-12-23 20:01:01 +00:00
[Markdown.pl](http://daringfireball.net/projects/markdown/)). Use
it via `./bb.sh post -m`. The third party library must support an invokation
like `markdown_bin in.html > out.md` as the code calls it that way.
2013-02-21 15:10:02 +00:00
- Post preview
2014-01-10 09:51:48 +00:00
- Save posts as drafts and resume editing later
- HTML page for each post, using its title as the URL
- Configurable number of posts on the front page
- Automatic generation of an RSS file, feedburner support
- Additional page containing an index of all posts
- Rebuild all files while keeping the original data
- Comments delegated to Twitter, with additional Disqus support
- Google Analytics code support
- Contains its own CSS so that everything is reasonably styled by default
2013-12-23 20:01:01 +00:00
- Headers, footers, and in general everything that a well-structured html file needs
2014-01-17 09:08:53 +00:00
- Support to add extra content on top of every page (e.g. banners, images, etc)
2013-02-21 15:00:05 +00:00
- xhtml validation, CSS validation, RSS validation by the w3c
2014-01-10 10:02:07 +00:00
- Automatic backup of the site every time you post (stored as `.backup.tar.gz`)
2013-02-21 15:00:05 +00:00
Read the CHANGELOG section of the script header for more updates