andrew is the name of a partial site generator I'm building.

I want the site author to be able to write website content by hand, in html and css and javascript. I want andrew to dynamically generate a set of listings of the html pages inside the directory structure of the website.

I'm not sure yet whether andrew should offer to serve a site (makes it a one-stop solution!) or whether it should write files on the file system, but a mentor noted to me recently that there are plenty of site generators that offer both.

The only functionality I need is generating an index.html, where I want the links to child pages to be. It's a pain in the arse to track all these as I write web pages.

Really, no second piece of functionality. Don't be smart about trying to handle default styling; that's neat and I'm glad tools do that, but I want to have as vanilla an experience as possible, just writing html and javascript and css, but not manually tracking every page.

I started thinking I could completely generate index.html, and serve the whole page from a binary I write, but that immediately hit a set of problems in this code:

    <head>
        <script type="text/javascript" src="../main.js"></script>
    <head>
            

I don't want this index.html generator to care about my file system layout, but the head element needs to include a path sourced from the file system. A child in website/projects/andrew/page.html needs to know it's four levels deep, so it can include the stylesheet and javascript files stored in my content root directory.

My current solution is to use go html templates, so that a file can own its own head elements, but the stuff I'm annoyed by maintaining is autogenerated, like this:

    <head>
        <script type="text/javascript" src="../main.js"></script>
    </head>
    <body>
        {{ .AndrewGeneratedIndex }}
    </body>