Archive for the 'Gallery plugin' Category

Published by Niels on 29 Aug 2006

Release of NanoBlogger Gallery plugin 0.6.0

There is a new release of the NanoBlogger Gallery plugin. The previous version had a problem when run in Bash versions below 3.1. There are some differences when initializing arrays from a ‘string’ using $IFS.

In Bash 3.1 you can do this:

declare -a arr=( $a )
echo "${#arr[@]}"
# Outputs 3 in version 3.1 and 1 in version 3.0

But if you instead do this then it works in both versions:

declare -a arr
eval "arr=( $a )"
echo "${#arr[@]}"
# Outputs 3 in version 3.1 and 3.0

So hopefully the Gallery plug-in is better prepared for the real world :). Thanks to Chris Gratham for helping me out with this.

The new version can be downloaded here.

Published by Niels on 25 Aug 2006

Release of Gallery plug-in 0.5.0

Version 0.5.0 of the NanoBlogger Gallery plug-in has just been released. It does not offer any extra features and is just a bug fix release to make the plug-in work with all versions of NanoBlogger from 3.0 and up.

It has been tested on the for the following releases:

  • 3.0
  • 3.1
  • 3.2
  • 3.2.3
  • 3.3 RC5

The major problem that needed to be fixed is that the plug-in uses standard NanoBlogger calls as often as possible. This means that the standard entry format can be used and even that (from version 3.3) the format field can be used to put markup into the entry.

Unfortunately the NanoBlogger API has changed a bit between versions. The call to read_metadata does not fill the same return variable in the versions mentioned above:

  • $NB_Metadata for version 3.0 and 3.1
  • $META_DATA for versions 3.2 and 3.2.3
  • $METADATA for version 3.3

There was already a function in the plug-in to determine for two given version numbers which was the newer one because the parameters to read_metadata also needed to have $METADATA_CLOSETAG specified from version 3.3 and up if the entry’s body is requested. So the plug-in already had to choose between two different calls based on the NanoBlogger version.

But everything seems to be fixed for now. The new plug-in can be downloaded here.

Published by Niels on 02 Jul 2006

NanoBlogger plug-ins

New releases of the code and gallery plug-ins for NanoBlogger. The code plug-in now no longer causes two blank line to be sent to stdout. The gallery plug-in now handles different versions of NanoBlogger better, i.e. the version check to determine which version of NanoBlogger is running does not cause an error anymore. It also delays the cleanup of meta files on Apple Mac OS X so I hope this is handles better now.

  • The new gallery plug-in can be downloaded here.
  • The new code plug-in can be downloaded here.

Enjoy and if there are any questions or problems contact me.

Published by Niels on 02 Apr 2006

Gallery Plugin version 0.3.0

A new release (0.3.0) of the Gallery Plugin for NanoBlogger to avoid problems with meta files on Mac OS X. These are files starting with ._ and contain data on files not stored on the native file system HFS.

This release will test if the plugin is running on Mac OS X and delete all picture files (*.jpg and *.png) starting with ._ in the current gallery directory.

The new version can be downloaded here.

Published by Niels on 25 Dec 2005

Version 0.2.0 of the Gallery Plugin

Version 0.2.0 of the Picture Gallery Plugin is available. This version should play nice with versions of NanoBlogger <3.3.

Beware: This plugin has only be tested with versions 3.1 and 3.3 RC3 of NanoBlogger. If I have time I will try to test the plugin for other versions. But don’t let that stop you from doing the same and provide me with feedback :).

You can download it here.

Published by Niels on 21 Dec 2005

New Gallery plugin release – 0.1.0

After trying to add a second picture gallery to this site the plugin would overwrite the title and the introductory text for all galleries with the ones from the latest gallery. This has been fixed in the new release together with a minor bug.

You can get this release here

Published by Niels on 09 Dec 2005

First release of a Picture Gallery Plugin for NanoBlogger

As mentioned in a previous post we visited a Sinterklaas celebration where we took a lot of pictures. The problem was that putting them on-line using NanoBlogger was a bit cumbersome. After some investigation on the NanoBlogger Yahoo group I found that a man named Chris had written a picture gallery plugin. After contacting him about it, he was so kind as to make it available to me. As it was still in a somewhat rudimentary state and I really like to tinker, I started writing my own plugin.

It is now in a quite usable state so I am sharing this with the rest of the world. Its usage is (hopefully) quite simple:


  1. Install the plugin in the NanoBlogger plugin directory. The plugin can be downloaded here.
  2. Create a directory named galleries in the NanoBlogger image directory. Any sub-directory of galleries will be considered a gallery.
  3. Place the pictures (JPG or PNG format) in the sub-directory of galleries that you created.
  4. Adjust the template main_index.htm to include the variable $NB_GalleryLinks
  5. Run nb -u all.

The created gallery will get the title of the sub-directory in which the pictures are stored.

These are the basics. But the plugin also gives the possibility to:

  • Prepend an introductory text
  • Annotate arbitrary pictures

Prepend introductory text

Create a file named intro.txt in the place the pictures are stored using nb --draft intro.txt and treat it like you would treat a regular entry for NanoBlogger. The title you set in the entry will be the title for the gallery.

Annotate pictures

Create a file named annotations.txt and put a line for each picture you want annotated using the following format:

<picture file>,<annotation>

Picture file is the local file name of the picture. Do not include paths, just use the bare file name. Everything after the comma is then considered an annotation for the picture.

To make the gallery a bit more pleasant-looking adjust your website’s style sheet. You can use this as an example.