FlyZhy.Org logo Projects - Weblog myself

Before
HowTo
Preparing
Installing
Initializing
Configuring

NanoBlogger is a small weblog engine written in Bash for the command line. It uses common UNIX tools such as cat, grep, and sed to create static HTML content. Also it is highly configurable and script-able. It's amazing for me and I am happy with it.

Before

HowTo

Preparing

$mkdir ~/nanoblogger
$cd ~/nanoblogger/
$wget
$wget

Installing

$mkdir ~/bin
$tar xvfz nanoblogger-3.3-rc4.tar.gz -C ~/bin

Then add the path to the environment variable $PATH by editing ~/.bashrc file +1:

export PATH=$PATH:/home/flyzhy/bin/nanoblogger-3.3-rc4

Make it be effect now:

#. ~/.bashrc

Initializing

$cd ~/nanoblogger/
$nb --blogdir blog --add
$cd blog
$cp -r ~/bin/nanoblogger-3.3-rc4/moods/ .
$tar xvfz ~/nanoblogger/jsfortune.tar.gz -C .

Configuring

/blog/blog.conf
# NanoBlogger Weblog Config File - blog.conf #
##### Publishing Preferences #####
## set default editor for your weblog (default is $EDITOR).
EDITOR="vim"
#EDITOR="emacs -nw"
## set default browser for previewing your weblog (defaults to "lynx")
BROWSER="firefox"
## maximum number of entries to display on the main index page.
MAX_ENTRIES="9"
## date format used for a new entry (used by the "date" command).
## e.g. DATE_FORMAT="%Y-%m-%d %H:%M:%S"
DATE_FORMAT="%a, %Y-%m-%d %T %z"
## date's locale (language) to display in, defaults to "$LANG".
DATE_LOCALE="$LANG"
## date command arguments (see date's man page).
DATE_ARGS=""
## set the full URL to your weblog (required for absolute links and
## syndication feeds).
## e.g. BLOG_URL="http://weblog.user/~foo" ("/" gets appended automatically)
BLOG_URL="http://www.flyzhy.org/blog"
## stylesheet used for your weblog (should alwawys be relative link).
BLOG_CSS="styles/nb_flyzhy.css"
## shortcut icon for your weblog (should always be relative link).
BLOG_ICON="images/lover.ico"
## action to perform on links to entries (e.g. run a server-side script)
## Must be activated in templates.
BLOG_URL_ACTION=""
## e.g. (with BLOG_URL set) BLOG_URL_ACTION="$BLOG_URL/cgi-bin/cgicomment.pl?article="
## e.g. (using BASE_URL in templates) BLOG_URL_ACTION="cgi-bin/cgicomment.pl?article="
## set the Language (character encoding) used for your weblog.
BLOG_CHARSET="utf-8"
## set the Mime Type used for your weblog
## e.g. BLOG_MIMETYPE="text/html"
BLOG_MIMETYPE="application/xhtml+xml"
## set the timezone for your RSS/Atom feed (should follow W3CDTF date format).
## Leave this unset to have it set automatically, if your system supports "date +%z"
## e.g. BLOG_TZD="-05:00"
BLOG_TZD=""
## title of your weblog.
BLOG_TITLE="FlyZhy's Blog"
## description of your weblog.
BLOG_DESCRIPTION="... come on, what are you looking for?"
## default author of your weblog.
BLOG_AUTHOR="Haiyong Zheng"
## Email logo of FlyZhy
BLOG_EMAIL_LOGO='<img src="http://www.flyzhy.org/style/FlyZhy_Gmail_logo.png" alt="Email FlyZhy" />'
## contact information for your weblog.
BLOG_CONTACT='<a href="mailto:flyzhy.org@gmail.com">'$BLOG_EMAIL_LOGO'</a>'
## e.g. BLOG_CONTACT='<a href="mailto:foo@null.org">'$BLOG_AUTHOR'</a>'
## set index for URI's (e.g. index.html)
NB_INDEX="index.html"
## show permanent links for each entry - 0/1 = off/on.
PERMALINKS="1"
## show category links for each entry - 0/1 = off/on.
CATEGORY_LINKS="1"
## command to run when previewing your weblog.
## used by the option and prompt for previewing (when set).
BLOG_PREVIEW_CMD="$BROWSER $BLOG_DIR/index.html"
## command to run when publishing your weblog to a remote site.
## used by the option and prompt for publishing (when set).
BLOG_PUBLISH_CMD="lftp -f .ftprc"
## enable Interactive mode (classic behaviour) - 0/1 = off/on.
#BLOG_INTERACTIVE="1"
##### Archive Preferences #####
## maximum number of entries to display for each category page.
MAX_PAGE_ENTRIES="50"
## build individual archives of each entry - 0/1 = off/on.
ENTRY_ARCHIVES="1"
## enable absolute links - 0/1 = off/on.
ABSOLUTE_LINKS="1"
## set data type to load for category archives - ALL or NOBODY.
## ALL = full entry metadata (slow and bigger cache)
## NOBODY = all except entry's BODY metadata (faster and smaller cache)
## edit the category_entry.htm template accordingly.
CATARCH_DATATYPE="NOBODY"
##### Plugin Preferences #####
## plugins directory
PLUGINS_DIR="$NB_BASE_DIR/plugins"
## set the Language for your RSS feeds.
BLOG_FEED_LANG="en-us"
#BLOG_FEED_LANG="zh-cn"
## default entry text formatting (name of the text formatting plugin(s)).
## e.g. plugins/entry/format/autobr.sh = autobr
ENTRY_FORMAT="raw"
## default article text formatting (name of the text formatting plugin(s)).
## e.g. plugins/page/format/markdown.sh = markdown
ARTICLE_FORMAT="raw"
## maximum links to yearly archives (-1 = all)
#MAX_YEARLINKS="12" # defaults to 12
## maximum links to monthly archives (-1 = all)
#MAX_MONTHLINKS="12" # defaults to 12
## calendar plugin - command arguments for cal. see cal's man pages.
CAL_ARGS=""
## tidy plugin - command arguments for tidy. see tidy's man pages or
## http://tidy.sourceforge.net/
TIDY_HTML_ARGS="-asxhtml -n -utf8"
TIDY_XML_ARGS="-xml -n -utf8 -wrap 0"
## fortune plugin - specify fortune data file to use
#FORTUNE_FILE=""
## enable category feeds - 0/1 = off/on.
ATOM_CATFEEDS="1"
RSS_CATFEEDS="1"
RSS2_CATFEEDS="1"
##### Cache Preferences #####
## maximum number of entries to store in cache
MAX_CACHE_ENTRIES="$MAX_ENTRIES"
## set cache management to automatic (1) or manual (0)
BLOG_CACHEMNG="1"
##### Metadata File Formatting Preferences #####
## the following settings are here for transitional reasons only.
## Unless you are experienced with batch file operations and have a clear
## understanding of NanoBlogger's interworkings (or quirks :)), it is
## recommended that you leave the following settings alone.
## WARNING: changing the following will require manually modifying any
## existing entry data files!
METADATA_CLOSETAG="END-----"
##### FlyZhy ######
## set the Language for your weblog to load.
#NB_LANG="en"
## set the file type or rather the suffix for the generated files.
#NB_FILETYPE="html"
## set the query mode for listing entries and displaying them on the main page.
#QUERY_MODE="$MAX_ENTRIES"
/blog/.ftprc
open ftp_address
login usr password
cd blog
mput *
mirror -R archives
mirror -R articles
mirror -R data
mirror -R templates
bye
/blog/templates/

Using