Python tools for managing static websites?

C

Chris Pearl

Are there Python tools to help webmasters manage static websites?

I'm talking about regenerating an entire static website - all the HTML
files in their appropriate directories and sub-directories. Each page
has some fixed parts (navigation menu, header, footer) and some
changing parts (body content, though in specific cases the normally
fixed parts might change as well). The tool should help to keep site
editing DRY every piece of data, including the recurring parts, should
exist only once.

The above should be doable with any decent templating tool, such as
those forming part of most CMSes and full-stack web-frameworks.
Normally I might have just resorted to a CMS/web-framework, running
locally on the webmaster's station, with the only addition being a
mechanism for generating all pages composing the site and saving them
as files.

But such a solution might not be enough, as the system I'm looking for
must be able to control the physical traits of the website as a
collection of files - e.g., creation and distribution of files among
several physical directories and subdirectories.

Any advice would be appreciated,
-Chris
 
U

UrsusMaximus

Firedrop2 is a content management system for static web sites. I have
used it to manage www.awaretek.com for 3-4 yearts now. it is perfect
for what you descibe. You can mkae a change in format and apply it to
all pages in a flash. It is very stable, and it is easy to use. It is
written in Python, actively maintained by Michael foord, and you can
easi;ly extend it with Python plugins. Open source, free as in beer,
etc.

http://www.voidspace.org.uk/python/firedrop2/

Ron Stephens
 
F

Fuzzyman

Chris said:
Are there Python tools to help webmasters manage static websites?

rest2web is a tool designed specifically for creating and managing
static websites. It uses templates and has built-in tools to aid with
creating side bars and navigation trails.

It allows you to store your pages in reStructured Text or HTML format.
It gives you full control of the 'shape' (in terms of directories) of
both your source files and target files (the html it generates).

http://www.voidspace.org.uk/python/rest2web/

Fuzzyman
 
C

Carl Banks

Chris said:
Are there Python tools to help webmasters manage static websites?

I'm talking about regenerating an entire static website - all the HTML
files in their appropriate directories and sub-directories. Each page
has some fixed parts (navigation menu, header, footer) and some
changing parts (body content, though in specific cases the normally
fixed parts might change as well). The tool should help to keep site
editing DRY every piece of data, including the recurring parts, should
exist only once.

The above should be doable with any decent templating tool, such as
those forming part of most CMSes and full-stack web-frameworks.
Normally I might have just resorted to a CMS/web-framework, running
locally on the webmaster's station, with the only addition being a
mechanism for generating all pages composing the site and saving them
as files.

But such a solution might not be enough, as the system I'm looking for
must be able to control the physical traits of the website as a
collection of files - e.g., creation and distribution of files among
several physical directories and subdirectories.

Chris,

If you don't mind me pimping my own static website generator, you might
find HRL useful:

http://www.aerojockey.com/software/hrl

On one hand, it's like an ordinary templating engine in that you can
define macros and variables and such, and stick them into documents.
For example, define a sidebar macro in the file macro.hri:

<macro name="sidebar">
<ul>
<li>First menu entry</li>
<li>Second menu entry</li>
<li>Thrid menu entry</li>
</ul>
</macro>

This creates a new "sidebar" tag that expands to the macro definition.
You can use this macro in your main document file:

<include file="macro.hri">
<sidebar>

However, HRL is much more powerful than a simple templating system,
because it can embed Python code to be run during page generation.
Here's a very simple example:

<python>
import time
hrl.doc.write("Page last generated on %s" %
time.asctime(time.localtime()))
</python>

Thus, unlike most templating engines, HRL can adapt very well to
unusual situations. You can embed the Python "scriptlet" into macro
definitions to create very powerful macros. For instance, you could
write a sidebar macro to automatically disable the link to the current
page--impossible with a simple text-substitution engine. Even more
powerful uses are possible. You could write a macro that inserts
information from a database into the page (which sounds kind of like
what you mentioned).

On the downside, it's not exactly hip to the latest web trends. It
uses sgmllib for input, bleagh. The list of HTML tags it knows about
is vintage 1998. (One of my design goals was freedom to be sloppy with
closing tags. HRL keeps track of and automatically closes tags when
appropriate, but it doesn't know about tags like embed.) And it's not
any sort of enterprise-quality content management. It's just a
templating engine with power.


Carl Banks
 
C

Chris Pearl

Thanks to everyone who have contributed to this thread. Several of the
posted suggestions definitely warrant a closer look. I'm going to
review those and publish my final choice - including the reasons for
it - if anyone's interested.

-Chris
 
B

Ben Finney

Chris Pearl said:
Thanks to everyone who have contributed to this thread. Several of the
posted suggestions definitely warrant a closer look. I'm going to
review those and publish my final choice - including the reasons for
it - if anyone's interested.

Yes please.
 
F

Florian Diesch

Chris Pearl said:
Are there Python tools to help webmasters manage static websites?

I'm talking about regenerating an entire static website - all the HTML
files in their appropriate directories and sub-directories. Each page
has some fixed parts (navigation menu, header, footer) and some
changing parts (body content, though in specific cases the normally
fixed parts might change as well). The tool should help to keep site
editing DRY every piece of data, including the recurring parts, should
exist only once.


Tahchee <http://www.ivy.fr/tahchee>

SUMMARY = "Automated static and dynamic web site creation tool"
DESCRIPTION = """\
Tahchee is a tool for developers and Web designers that makes it possible to
easily build a static Web site using the Cheetah template system. It is used to
fill in the gap between bare template and macro processing system and dynamic
template-based Web sites. It acts both as a build system (à la "make") as well
as an extension to the Cheetah template that makes it really easy to build small
to medium-sized sites. It is ideal for writing open source project or small
company Web sites.\
"""



Florian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top