image plugin

will guaraldi <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
I'm tossing around writing an image plugin.  I want it to do the following
things:

  1. generate the <img ...> html tag based on an image reference
  2. allow me to move my images around and fix the links from one
     place rather than going through all the blog entries that refer
     to that image and changing them
  3. possibly allowing for multiple image link templates (one with
     just a word, one with a thumbnail, ...)?


I was thinking of doing something along these lines.  I'd have a data file
(much like my booklist plugin).  The data file might look like:

   # image_name::directory::image_file
   s4_no_headlights::photos2/events/2003/s4::no_headlights.jpg

And then I would reference it in my blog like this:

   $image('image_name')

Then I'd have in the config file an entry for the image template:

   py['image_template'] = '<a href="$directory/$file"><img
src="$directory/$file"></a>'

I could make it looser in that you could specify which columns hold what
information.  So then the template could be something like this:

   py['image_template'] = '<a href="$1/$2"><img src="$1/$2"></a>'

Then you could add columns for thumbnails, description pages, ...  Or if
they're all based off the same filename base (i.e. base is no_headlights,
image is no_headlights.jpg, description is no_headlights.html, thumbnail
is no_headlights_thumb.jpg...), then you could do that too.

Any thoughts on this?  Anyone else have an image plugin or ideas for a
better design?

/will

-- 
whatever it is, you can find it at http://www.bluesock.org/~willg/
except Will--you can only see him in real life.


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.