Table of Contents
programs required other than bash:
cat, cp, cut, date, echo, eval, expr, getopt, getopts*, grep (fgrep), mkdir, read, rm, sed, shift*, sort, touch, trap, uname
* = only used if output from uname is not "Linux"
nb [OPTION]... [PATH_TO_BLOG]...Try "nb -h" to see all available options. For each blog there's a user defined configuration file called "blog.conf". This file controls the behavior of a blog. It allows you to change such things as, how many entries to display on the front page. It's also where you set the title, description, and the URL for your blog. The DATE_FORMAT variable can be customized to change the date format of a new entry. The default DATE_FORMAT uses "%B %d, %Y %l:%M %p" and produces something like this: "August 05, 2003 12:53 AM". Read the man pages of the date command to see more on how to customize the format of a date.
NanoBlogger creates the following web pages:
The web pages are regenerated each time you add, edit, or delete an entry.
- index.html
- index.rdf
- archives/monthly/[YYYY-MM].html
The blog's appearance is controlled by the following templates: templates description archive_links.htm the links to the archives default.htm controls look of alternate pages, such as the archive pages entries.htm controls look of your blog entries main_index.htm controls look of the blog's main page rdf_entries.xml controls look of each individual news item in the rss feed rdf.xml controls look and format of rss feed (index.rdf)
In addition there's a stylesheet called, "blog_style.css".
All the placeholders are reinterpretted by the shell as variables when a template is sourced, making the templates capable of a few bash tricks themselves. As a simple example, you could place this in your template: "Last Modified: `date`", and it would display the time your page was last modified, using the date command. How cool is that!? This greatly enchances the power of the templates, making it possible to create your own script and replace my "`date`" example with "`your_script`". Have fun!
The entry template includes the following placeholders: placeholders description $NB_EntryAuthor author of entry $NB_EntryBody entry's content $NB_EntryDate entry's posted time $NB_EntryPermalink entry's permalink $NB_EntryTitle entry's title
The main template includes the following placeholders: placeholders description $BLOG_CHARSET blog's character set $BLOG_CONTACT blog's contact info $BLOG_DESCRIPTION blog's description $BLOG_TITLE blog's title $BLOG_URL blog's URL $NB_Archive_Links links to archives $NB_Entries all the current entries
To disable a plugin, rename the plugin's extension from ".sh" to ".off". This will move the plugin off of the radar, so to speak.
The plugins included and what placeholders they create (most are enabled by default in the included templates): plugins description placeholders special requirements auto_format.sh automatically adds paragraph tags to blank lines $NB_EntryBody none blog_status.sh makes blog statistics $NB_Blog_Status none calendar.sh uses cal to make a calendar with links $NB_Calendar cal fortune.sh uses fortune to generate random quotes $NB_Fortune fortune list_entries.sh makes list of entries recent or old $NB_Recent_Entries, $NB_Older_Entries none
--
#!/bin/sh
# WARNING! the following commands could expose your password to another user viewing the output of "ps" or "top"
# remove old archives to conserve space
#echo "rm -fr /blog/archives" | ncftp -u XX -p XX myblog.com
# connect once to upload the main page and other misc. stuff
ncftpput -u XX -p XX -mR myblog.com /blog /home/XX/myblog/index.* \
/home/XX/myblog/blog_style.css
# then connect again for the archives since we can only specify one path at a time
ncftpput -u XX -p XX -mR myblog.com /blog/archives /home/XX/myblog/archives/monthly
# End of script
--