Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I want to rewrite a simple small (10 page) website and besides a contact form it could be written in pure html. It is currently built with classic asp and Dreamweaver templates.

The reason I'm not simply writing 10 html pages is that I want to keep the layout all in 1 place so would need either includes or a masterpage. I don't want to use Dreamweaver templates, or batch processing (like org-mode) because I want to be able to edit using notepad (or Visual Studio) because occasionally I might need to edit a file on the server (Go Daddy's IIS admin interface will let me edit text). I don't want to use ASP.NET MVC or WebForms (which I use in my day job) because I don't need all the overhead they bring with them when essentially I'm serving up 9 static files, 1 contact form and 1 list of clubs (that I aim to use jQuery to filter). The shared hosting package I have on Go Daddy seems to take a long time to spin up when serving aspx files.

Currently the clubs page is driven from an MS SQL database that I try to keep up to date by manually checking the dojo locator on the main HQ pages and editing the entries myself, this is again way over the top. I aim to get a text file with the club details (probably in JSON or xml format) and use that as the source for the clubs page. There will need to be a bit of programming for this as the HQ site is unable to provide an extract / feed so something will have to scrape the site periodically to update my clubs persistence file. I'd like that to be automated - but I'm happy to have that triggered on a visit to the clubs page so I don't need to worry about scheduling a job. I would probably have a separate process that updates the persistence that has nothing to do with the rest of the site.

Ideally I'd like to use Mercurial (or git) to publish, I know Bitbucket (and github) both serve static page sites so they wouldn't work in this scenario (dynamic pages and a contact form) but that's the model I'd like to use if there is such a thing.

My requirements are:

  1. Simple templating system, 1 place to define header, footers, menu etc., that can be edited using just notepad.
  2. Very minimal / lightweight framework. I don't need a monster for 10 pages
  3. Must run either on IIS7 (shared Go Daddy Windows hosting) or other free host

Edit
There will never be any requirement for additional features, the key thing for me is that this is as lightweight as possible - it is only the templating (so I don't have to edit all 10 files if I want to update the footer) that is preventing me from using plain old pure html.

share|improve this question

closed as off topic by Jarrod Roberson, maple_shaft Jun 9 '12 at 19:45

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
You could probably use javascript if that is your only requirement - then all is done client-side. Maybe check EJS: embeddedjs.com –  nilu Jun 9 '12 at 18:51
add comment

5 Answers

To me it sounds like a simple PHP website would be reasonable - it should be rather easy to achieve what you desire.

However, if you insist on using a framework, I would suggest Flask (a python microframework). It supports Jinja2 templates and should be pretty easy to get into:

http://flask.pocoo.org/

I haven't checked the hosting possibilities, but you should check it out.

share|improve this answer
    
+1 for flask. It's perfect for this type of thing. –  bunglestink Jun 9 '12 at 15:02
    
The site is already a simple ASP website, not much point swapping for php, I can use includes with classic asp... –  Simon Martin Jun 9 '12 at 16:11
add comment

Since you already know ASP.NET MVC, I assume you also know Razor. In that case, you might want to consider Nancy. It is very lightweigth, supports a lot of templating engines (including Razor) and is very easy to use, even if you don't know it.

Want to return a simple string?

public class SampleModule : Nancy.NancyModule
{
    public SampleModule()
    {
        Get["/"] = parameters => "Hello World!";
    }
}

Want to return a Razor page?

public class SampleModule : Nancy.NancyModule
{
    public SampleModule()
    {
        Get["/"] = parameters => 
        {
            return View["index.cshtml"];
        }
    }
}

By default, Nancy ships with a built in view engine known as the SuperSimpleViewEngine, which supports all the necessities such as layouts, partials, models, conditions and iterations. You can use this without any additional dependencies and it serves up .html and .sshtml files.

share|improve this answer
add comment

I would personally scrap the "must be super lightweight" requirement since it is much easier to do admin and future updates on a WP install and you'll get all the RSS/ATOM and database and contact form integration for free on top without having to home hack a solution that will no doubt be sub-par compared to what you would get with mature WP plugins!

Anyway; beyond my personal two cents I respond to your initial request by recommending CodeIgniter if you want to build your own thing; 1) simple templating that is easily updated manually (notepad style) if wanted, 2) very lightweight yet its got all the stuff for data validation / email sending that will drive you crazy if doing plain PHP, 3) a friendly soul have written a great article about setting CodeIgniter up with IIS/MSSQL (see: here).

share|improve this answer
    
A CMS is waaaaay over the top. The page content almost never needs to change, only when I change venue or class times have I changed it in the last 6 years! –  Simon Martin Jun 9 '12 at 12:56
    
@SimonMartin, CMS/WP-wise: well, that's up to you. What about the CodeIgniter recommendation, does those points not add up for you? –  hjhndr Jun 9 '12 at 13:33
    
Taken a quick look at CodeIgniter and it also seems over the top for what I'm looking for. Much the same as ASP.NET MVC - a whole framework just to serve up a few static pages is what I'm seeking to avoid. –  Simon Martin Jun 9 '12 at 13:43
add comment

I wouldn't got for a home-spun solution here, I'd install something like Drupal and customise it from there.

For a web framework, Django is good and will fulfil your needs. Whether it is lightweight enough is a bit meaningless if its easy to understand and get something working using it. You'd be better off with something like this instead of something "lighter" that has too few features.

Both the above will run on Linux based webhosts, and they come very cheap.

share|improve this answer
    
Django and not python? I'm not worried at all about having too few features - the only features I need are the templating and a contact form (but I can use the cgi provided by Go Daddy if I need to avoid any programming on the pages) –  Simon Martin Jun 9 '12 at 13:03
add comment

I personally really like Flask. It does a good job of staying out of the way, but allowing a lot of heavier features to be plugged in later.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.