Re: Render pages like pystaticfile, but at arbitrary URLs

Chris G <[email protected]> Tue, 25 Mar 2008 16:41:26 +0000
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <20080325164126.GA20807@th-shell-1>
On Tue, Mar 25, 2008 at 10:37:48AM -0500, Steve Hoelzer wrote:
> I'd like to render some pages just like pystaticfile [1], except I
> don't want the URLs all prefixed with static/. It would be great if I
> could organize my datadir as follows:
> 
> - aboutme/
>   - index.txt
> - blog/
>   - post_1.txt
>   - post_2.txt
>   - post_3.txt
> - projects/
>   - index.txt
>   - project_1
>     - index.txt
>   - project_2
>     - index.txt
> 
> With this setup, I'd want everything in blog/ to be treated normally,
> and everything else processed like pystaticfile. Is there any way to
> make that happen without modifying pyblosxom or pystaticfile?
> 
> Thanks,
> Steve
> 
> P.S. Pyblosxom is currently a "lightweight file-based weblog system".
> If this type of functionality were included in pyblosxom itself, it
> would be a lightweight file-based *website* system.
> 
I started using Pyblosxom in this fashion but I have since migrated to
using a much simpler approach.  I have added the following to my
apache configuration:-

    #
    #
    # Additions to convert reStructuredText files to HTML
    #
    ExtFilterDefine rst-to-html mode=output \
        intype=text/rst outtype=text/html \
        cmd="/home/chris/bin/info2html.py"

    DirectoryIndex index.html overview.rst index.rst index.html.var

    <Directory /var/www/html>
        SetOutputFilter rst-to-html
        AddType text/rst .rst
        ExtFilterOptions DebugLevel=1 LogStderr
    </Directory>

... and as a result any reStructuredText files on my web site are
*automatically* converted to HTML by apache.  I have a little extra
bit in /home/chris/bin/info2html.py that adds a menu in a sidebar but
that's just a luxury!

If anyone wants to look at the results I can give you temporary access
if you like (currently only a few pages on my home system have public
access).

-- 
Chris Green

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/