- INSTALLING BRYAR
- USING BRYAR
Bryar - A modular, extensible weblog tool
Bryar is a piece of blog production software, similar in style to (but considerably more complex than) Rael Dornfest's "blosxom". The main difference is extensibility, in terms of data collection and output formatting. For instance, data can be acquired via DBD from a database, or from the filesystem, or from any other source you can think of; documents can be specified in HTML, or some other format which gets turned into HTML; pages can be rendered with Template Toolkit, HTML::Template, or any other template engine of your choice.
The short answer: run bryar-newblog in a directory served by your web server. Then do what it tells you.
The long answer:
The only front-end working in this release is the CGI one; please don't try this in mod_perl yet.
You'll need to write a little driver script which sets some parameters. For instance, my bryar.cgi looks like this:
#!/usr/bin/perl use Bryar; Bryar->go( name => "Themes, Dreams and Crazy Schemes", description => "Simon Cozens' weblog", baseurl => "http://blog.simon-cozens.org/bryar.cgi" );
You can get away without any configuration options, but it's probably wise to set something like the above up. Bryar will look in its current directory for data files and templates, so if you're keeping your data somewhere else, you'll want to set the datadir option too:
use Bryar; Bryar->go( datadir => "/home/simon/blog" );
If Bryar finds a file called bryar.conf in the data directory, (which as noted above, defaults to the current directory if not specified explicitly) then it'll parse that as a colon-separated file full of other options. I could, for instance, get away with
name: Themes, Dreams and Crazy Schemes description: Simon Cozens' weblog baseurl: http://blog.simon-cozens.org/bryar.cgi email: firstname.lastname@example.org
in a bryar.conf, and then would be able to use
Bryar->go() with no further parameters.
Now you will need some templates to make your new blog look nice and shiny. You can copy in the template.rss and template.html which come with Bryar, and edit those. The bryar-newblog program which comes with Bryar will set all this up for you. Look at Bryar::Renderer::TT for hints as to how to customize the look-and-feel of the blog.
Once you're all up and running, (and your web server knows about bryar.cgi) then you can start blogging! Just dump .txt files into your data directory. If you used bryar-newblog, you should even have a sample blog entry there for you.
This section describes Bryar from the end-users point of view - that is, what do all those URLs do? If you're familiar with blosxom, this section should be a breeze.
will return the most recent 20 posts. The default of 20 can be changed by setting the
recent configuration option.
will try to find a sub-blog - in blosxom terms, this is a subdirectory underneath the main data directory. Sub-blogs can have their own templates, but by default inherit the templates from the main blog.
(Oh, and another thing - you can stick templates either in the template subdirectory or the main directory for your blog/sub-blog. Bryar looks in both.)
If you want your main blog to contain things from sub-blogs, you can change the value of the
depth option, which defaults to one - no descent into subblogs.
You can also export your blog as RSS:
And combine subblogging with RSS:
These are actually blosxom backwardly-compatible versions of the Bryar:
There's also an Atom feed:
And you can write your own formats; see the renderer class documentation for how.
Each blog post will have a unique ID; you can get to an individual post by specifying its ID:
And finally you can retrieve blog entries for a specific period of time:
http://your.blog.com/bryar.cgi/2003/May/ # All entries in May http://your.blog.com/bryar.cgi/2003/May/14/ # All entries on the 14th
Of course, you can combine all these components:
Now for the programmer's interface to Bryar.
Creates a new Bryar instance. You probably don't need to use this unless you're programming your blog to do clever stuff. Use
Does all the work of producing the blog. For parameters you might be interested in setting, see
TODO: Move this out to something that is more flexible.
Return a data structure containing the days and weeks of a given month and year with blog posts attached. See the
calendar template for an example.
Returns the Bryar::Config object for this blog. This is useful as the blog object is passed into the templates by default.
This module is free software, and may be distributed under the same terms as Perl itself.
Steve Peters provided Atom support. Marco d'Itri contributed the calendar, HTTP validators, caching, FastCGI, sitemaps, non-ASCII charsets, bug fixes and optimizations.
Copyright (C) 2003, Simon Cozens
some parts Copyright 2007 David Cantrell
some parts Copyright 2009 Marco d'Itri