Re: How to render .txt to static .html

will guaraldi <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Ahh...  Ok.  I see what you're trying to do now.

PyBlosxom (like blosxom) allows you to have multiple "flavours" for your
site.  Each flavour can be a different look and feel and is composed of a
series of templates named "content-type", "head", "story", and "foot".
These files are stored at the root of your datadir and the extension of
these files is the flavour name.

Most people have an html flavour.  So they'd have "content-type.html",
"head.html", "story.html", and "foot.html" in the root of their datadir.

Flavours are a bit more than themes in that flavours allow you to
completely change the data output.  PyBlosxom comes with two default
flavours: html and rss.


There are two ways to specify which flavour to use.  The first is using
the querystring:

   http://blahblah.blah/blah/blah/blah?flav=html
                                      ^^^^^^^^^^

The second way is by specifying the extension of the entry:

   http://blahblah.blah/blah/blah/blah.html
                                      ^^^^^

Now, that entry is probably stored in the file /blah/blah/blah.txt (where
the first / is off the root of your datadir).  I only say probably because
there are other entryparsers and they use different file extensions like
".txtl" and ".wiki" and such.

So the answer to your question in theory is that you shouldn't have to do
anything to translate .txt to .html--it should work just fine.  The
extension of the filename dictates which entry parser to use and the
extension of the resource in the url dictates which flavour to render
with.

The answer to the other question "so what's wrong with my blog and why
doesn't it work?" is that I think you're using the wrong template
variables.  Instead of using $base_url/$entry.html, you should use
$base_url/$filepath.html.

Also, you'll notice that when you kick up 404 errors, they're Apache 404
errors.  So valid PyBlosxom paths except for /blog aren't working.  What
does /blog actually point to?  Are you doing url re-writing in your
.htaccess file?  If so, I think the re-write rule probably needs to get
fixed because it seems to direct /blog to your pyblosxom.cgi file, but
nothing else.

/will


On Thu, 27 May 2004, Peter Thorin wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> ok, at my blog http://sani.cowhide.org/blog
> I've got links below my entries that like this: #
> they've got the title: Permalink
> and point to my <base-url>/<entry>.html
> What I want to know is how to create these .html-files, since I only
> hava entries in .txt-files... Hope I made myself more clear...
>
>
> - --
> ~ Peter Thorin
> ~ IT-University of Gothenburg
> ~ e-mail: [email protected]
> ~ alternative: [email protected]
> ~ Fingerprint = B37C CB3A 5C2D BAF7 6B8D  FDCA B061 FF8E 6705 0FED
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iD8DBQFAtfc9sGH/jmcFD+0RAkkTAJ4+aBs6Sh1Th5yoIWTStQ88ZlVYzgCghBFh
> cuwxv4h0ldJExNz6AiiZxb0=
> =SIN3
> -----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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.