The Problem
Creating a personal website formerly requires either an immensely complex folder tree of HTML files or an overblown CMS that does way beyond what the average user needs.
The Solution
Extend on XHTML such that a single file can describe not only a single page, but an entire website. SWS merely requires PHP5, and can optionally use mod_rewrite for pretty URLs. You don't even need access to a database.
A Hello World
template.sws<site title="John Doe" template="default.tmpl" css="main.css">
<page link="" name="Home">
<header>My Home Page</header>
<content>
<p>Hello World!</p>
</content>
</page>
<page link="Contact me">
<header>To contact me</header>
<content>
<p>choose a medium</p>
</content>
<subpages>
<page link="Email">
<header>Email</header>
<content>
<p>superhappyfuntime@me.com</p>
</content>
</page>
<page link="IM">
<header>IM</header>
<content>
<p>IM superhappyfuntime</p>
</content>
</page>
</subpages>
</page>
</site>
default.tmpl
<html>
<head>
<title />
</head>
<body>
<div id="alllinks" />
<h3 id="header" />
<div id="content" />
</body>
</html>
main.css - Your run of the mill CSS stylesheet (empty for this example)
ResultFeatures
- No maintaining a file tree. Want a new page? Add a page element to the site tag.
- No compiling required
- Automatic clean URL generation (assuming you have mod_rewrite enabled)
- Automatically generated links (and nested links)
- Templatizing of standard HTML - no new syntax required
- Virtually infinite nested pages
- Static file generation if you need it
History
Fall quarter my sophomore year at Stanford (2007), I took CS145 - Introduction to Databases. This class spent about half of its time on RDBMS and half its time on XML. I understood why we were covering RDBMS, but I had never actually seen any usage of XML beyond XHTML and nasty Java configuration files, and no real examples of XPath being used anywhere. At this point in time I was using a shared hosting provider that provided little beyond PHP5, MySQL, and PHPMyAdmin (ie. no ssh). I imagined that other people were often not even fortunate enough to have access to an SQL database. My website needed updating and thus I decided to build my website around an XML document, queried with XPath, and hence SWS was born.
SWS happily kept my personal website up for a couple years and eventually enough people told me I should open source it that I bunkered down for a couple days over christmas 2009 and completely rewrote it from scratch to allow for a lot of more advanced features (namely recursive page trees), and then released it. And here it is, under a BSD license (a la Django).