XML Blog Stuff IRC Ramblings
The Beginning
<nlindblad> anyone using LightPress then?
<nlindblad> http://lightpress.org/
<nlindblad> looks interesting
<sward> nlindblad: It's PHP (nevermind a plugin for another PHP app), I
lost any interest I may have had in it
<nlindblad> sward: what CMS would you use then?
<sward> nlindblad: I don't :)
<nlindblad> sward: okey...
<nlindblad> sward: what would you recommend then
<sward> nlindblad: I wouldn't, I'm not a big fan of CMSes, at least not
in the "dynamic page generation from static content in a data
store which only looks dynamic because it's updated often" sense
<nlindblad> ah
<nlindblad> sward: true
<nlindblad> sward: I'm really after something I can update without
having to use vim all the time
<sward> nlindblad: and vim's a problem because? I find it better than a
textarea
<nlindblad> sward: hmm
<h|barbobot> vim is no problem.
<nlindblad> sward: I'll just do a neat page then and use vim and shut
up, etc.
<sward> nlindblad: Not that I have a website to manage.. I mean, the one
page I have up hasn't changed for 3 years, except for updates to
my CV and text ever so slightly modified to be past tense (I am
studying.. -. I studied, blah)
<nlindblad> :P
<StarScream> i really should make a website for my self some day
<sward> nlindblad: For anything more complex, I'd probably look into an
XML-based system, but the resulting pages are generated by me
(or automagically as I add content) (probably XSL
transformations), rather than having the content pulled from a
DB and generating pages dynamically.
<Dave2> XML!
<sward> nlindblad: Even with caching, dynamic generation in that way
seems a bad method
<nlindblad> sward: TBH, Gentoo's XML policies are lovely
<nlindblad> sward: it's so easy to write content for their site
<nlindblad> sward: XML is neat
<nlindblad> sward: but the question is then
<nlindblad> sward: how would one go on about doing it properly
<nlindblad> sward: my idea is to make separate XML-documents for each
"post" then merge them into a static page using Python in
chronological order after their <date> tags
<sward> nlindblad: For journal type stuff, yeah, possibly. You may not
even need XML documents for each post, just plain text which
gets included into XML, though that doesn't help with how you
get the date. I don't think file modification times are
sufficient.
<nlindblad> yeah
<nlindblad> http://pastebin.com/683246
<sward> Heh, just had a thought.. changelog format is essentially the
same as a journal, and vim has nice macros to manipulate
changelogs
<h|barbobot> vim uber alles!
<sward> nlindblad: In your example post, too much crap. You want it
simple.
<nlindblad> well
<sward> nlindblad: It can be an XML fragment, rather than a complete XML
document, so you can probably leave out the header crap
<nlindblad> <time> is probably crap
<nlindblad> sward: true
<nlindblad> http://pastebin.com/683252
<sward> nlindblad: Yeah, make date + time = <date>, and in ISP format
<sward> ISO
<nlindblad> yeah
<sward> nlindblad: If you want to separate them, it's designed to be
easy to process, so... process it :)
<nlindblad> http://pastebin.com/683255 then
<nlindblad> the point of having <title> is for automatically generating
the navigation
<nlindblad> and to have a real title that is a bit bigger than the
content
<nlindblad> sward: the idea is that you shouldn't have to care about
what you name the files
<sward> Agreed
<nlindblad> sward: as long as you put all the posts in a pre-defined
directory the Python-script should look at the date and
properly generate
<sward> although I think nice names are better than some crap hash
<nlindblad> yeah
<nlindblad> the ideal thing would be to have a vim-skeleton defined for
the post directory
<nlindblad> so vim /postdirectory/somefile
<nlindblad> would create a new skeleton with empty tags
<nlindblad> (if somefile doesn't exist)
<sward> also, if your blog links to "full" versions of posts where you
can add comments and such, then the server should serve it as
http://host.domain.tld/blog/nice_name instead of crap like
http://host.domain.tld/blog/2006/04/21/<number-assigned-to-the-current-phase-of-the-moons-of-jupiter>/$(cat
/dev/urandom | base64encoder)/shit_name
<nlindblad> sward: hmm
<sward> date, long title, author.. all meta-data rather than URI
material, though that does bring the "how do you ensure each
name is unique?" question
<nlindblad> sward: I don't intend to keep the directory with posts in
the htdocs
<nlindblad> sward: so what you're saying makes perfect sense, generate
standalone pages and make nice URIs
<sward> I wouldn't, but you want to be able to generate reasonable
output files
<nlindblad> sward: what tags would you use then?
<nlindblad> to be exact
<sward> not sure.. within the confines of XML, you've about minimised
the amount of faff you need to put in as much as you can
<sward> you'd probably do better generating an index
<astopy> putting the date in the URI is a good idea
<sward> then you can setup something to "add a post", and it'll fill in
the date for you, so you can get rid of that
<nlindblad> sward: yeah, preferably a small Python-script simply taking
input
<sward> once the post is in the index file.. it won't be overwritten
(unless you tell "add a post" to), so existing dates won't get
changed to the current date
<nlindblad> sward: but somewhere along the road I think I should be a
bit different to other traditional blogs
<sward> I know someone who did a set of XML templates for his site at
one point, maybe I'll steal from him
<nlindblad> http://pastebin.com/683281
<nlindblad> yes, alot of tags
<nlindblad> but the metadata helps you create some cool stuff out of it
<sward> it might be useful to separate metadata from the content.. most
of that I'd want to auto generate
<nlindblad> sward: you mean to put "easy to generate" stuff in a
<metadata> tag?
<sward> for example, if I wanted to create an id (reference) for a
post.. I'd process the title into some canonical form which is
valid for ids
<nlindblad> true
<nlindblad> the thing is
<sward> name can be obtained from your user name, e.g. like mutt fills
in 'Simon Edward Ward' in my From: address
<nlindblad> I must settle for a DTD before I can continue doing real
code
<nlindblad> yeah
<nlindblad> http://pastebin.com/683287
<nlindblad> now all data intended to be auto-added is in the <meta> tag
<nlindblad> *are
<sward> nlindblad: I'll start putting stuff up at
http://projects.bleah.co.uk/misc/wiki/XmlBlog .. I'm actually
interested in seeing this work
<sward> nlindblad: Feel free to edit the page and add new sub-pages
(assuming I let anonymous do that...)
<nlindblad> okey
<nlindblad> I will
<nlindblad> I'll dig through my XML books later on
<nlindblad> but I think http://pastebin.com/683304 is a good start
<nlindblad> if I've understood DTD a bit
<sward> balls, the person who I thought did a pure XML-based template
system didn't.. he used Smarty
<nlindblad> :(
<nlindblad> sward: but that is all the DTD required to syntax-check a
post
<sward> It should be easy enough, given this XML system, to write stuff
to post using the blogger API too
<nlindblad> sward: yeah
<sward> XSLT transform to blogger API XML-RPC... HTTP POST
<sward> well, probably not that simple, but it was an idea :)
<nlindblad> when the basic XML is completed and the parsing is also done
<nlindblad> extending will be very easy
* nlindblad wonders whether a XML-validator in Python would require
hours and hours of work
<resiak> I'm sure that one exists
<sward> if not, the various XML libs are a good way there
<nlindblad> I've done some simple thing with SAX
* sward -> pub -> home
<nlindblad> http://pastebin.com/683364
<nlindblad> where to go on from here?
<nlindblad> the idea is to make the parsed data ready for output