Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've taken to doing basically this with PHP for static websites. A lot of websites I work on are really just a handful of static pages--- needing logins and a database and a "theme" and to fret about security patches just for that is like swatting a fly with a bazooka.

Here's an example: http://8cities.org/newyork

It's a supporting site for a marriage seminar being put on by a local church---the content on that page is being sourced from http://8cities.org/content/newyork-left.txt and http://8cities.org/content/newyork-right.txt , so it's easy for the staff to make changes to the files without needing a ton of technical know-how, but there's less overhead than with a whole CMS.

Another way to do it that I've found works well is to have a php file with a little <?php ?> block at the top where you set template parameters, etc, and then have the markdown content following in chunks separated by a marker (like #######). Then you include the file in your processing code, use PHP's output buffering to capture the content, split it into chunks, and run markdown and smartypants on it. Then you have HTML blocks in $content[0], $content[1], etc, which can be included into the template PHP file.

An approach like this would work really well with a Dropbox backend.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: