SlenderSite documentation
SlenderSite generates web pages in a directory of your choice, starting from text files, one or more templates, and optional configuration. See the reference for technical details.
System requirements
- PHP, preferably version 8.1, 8.2 or newer; others are untested
- (optionally) a processor for Markdown or some such
Installation
SlenderSite comes as a single PHP script. On Linux you can simply make it executable and copy it to /usr/local/bin. The examples below assume that.
It’s safe to keep a copy in your site directory and run it with php. SlenderSite will exit with an informational message if you try to load the script through a web server.
Quick start
SlenderSite is a command-line program (sorry):
mkdir my-site
cd my-site
slender --init _site
slender _site
(You can omit _site since it’s the default name for the source directory.)
Or to shoot from the hip:
mkdir my-site
cd my-site
echo "Hello, world!" > index.md
slender .
Web pages are generated in the current directory by default. You can also put your source files there, but be careful! Better to keep them separated.
Frequently Asked Questions
How to make a post instead of a page?
Make sure the file name starts with an ISO date, like this: 2026-04-19-hello-world.md; there doesn’t need to be anything after that, but if there is it will act as default post title.
How to add a list of recent posts to a given page?
- Save the default template to a new file, say
blog.htmlor some such. - Edit this new template to include the
{recent}variable somewhere. - Attach it to a given page with an entry like this in
conf.ini:
[index]
title = Home
template = blog
That should do it. You can do something similar with {archive}.
How to automatically show the date on a blog post?
Create a new template as above, named post.html for example, and set it as the default for all posts:
[SITE]
template2 = post
Then simply use the {date} variable. It only has a value for posts.
Do pages and posts have to be written in Markdown?
Absolutely not! SlenderSite can use any markup format with a suitable command line tool; markdown is the default due to its popularity, and lowdown or cmark are drop-in replacements. You can also try txt2tags for example by setting markup to txt2tags -t html --no-headers -o -, but it’s untested.
Tip: use the cat system command (type on Windows I think) as processor and *.htm as a file extension to write your site in plain HTML.
What inspired SlenderSite? Why yet another SSG?
Because I want options, and existing solutions just don’t cut it.
The seeds of this idea were planted when I saw Portable PHP. That’s a neat gimmick, but has some downsides that bothered me. SlenderSite has very similar features, except it outputs separate files, because that’s easier and scales better.
Another major inspiration was zs. I like the idea, and James is cool, but zs needs a 30MB executable to do… little more than the SlenderSite prototype did in 25 lines of PHP after a day of work.
Last but not least, there’s Hyde – the Chicken Scheme one (there are two by that name). Hyde is intriguing, but I don’t want to write Scheme just to put together a trivial page template. Plus, it has a ton of dependencies. And I’m still unclear on how to add blogging support.