Hacker News new | past | comments | ask | show | jobs | submit login

My website is constructed (and deployed) by a Makefile with a crappy find-and-replace script masquerading as a templating system. More or less this:

    all: $(addprefix $(OUTDIR)/, $(addsuffix .html, $(PAGES))) $(addprefix $(OUTDIR)/, $(notdir $(wildcard imgs/*)))  $(OUTDIR)/styles.css 

    $(OUTDIR)/%: imgs/% | $(OUTDIR)
        ln $< $@

    $(OUTDIR)/%.html: pages/%.page template | $(OUTDIR)
        $(BUILDER) template $< $@

    $(OUTDIR)/styles.css: styles.css
        ln $< $@ 

    deploy: 
       rsync -avh $(OUTDIR)/ $(DEST)



Yes, but it gets tricky real quick.

You might want to have all html pages added to a <ul> in an index.html.

Then you might want a sitemap (similar solution to above).

Then you might want an RSS feed (and an atom feed).

Then you might want height and width attributes automatically set in <img> tags.

It's all doable, but soon your build script is a classic static site generator and dwarfs the Makefile in functionality and complexity.


Indeed, but that's overkill for most personal sites...


That isn't really true. Adding things like image width and height attributes are basic essentials for any content drive website. If you push new content regularly then an RSS feed is very useful for visitors. If you want to be found in Google then you need a sitemap.

If you're not going to do the absolute minimum for your site's users why bother making a site in the first place?


I wouldn't say any of those qualify as "absolute minimum", particularly for personal sites which owe nothing to their visitors. Omitting img dimensions will cause nothing worse than reflow, while a "what's new" section can be a partial alternative to RSS. As for Google, I'd presume a properly linked (internally) site should be fully crawled even without a sitemap. Maybe not as efficiently, but again, for a personal homepage it is sufficient. Of course in that case one can ask why not just use WP or a SSG that gives you those for free. The downside is of course the time you need to invest upfront in learning those tools and then keeping up to date with their changes and breakages. In contrast, simple HTML, CSS and JS can be safely expected to work for decades at the very least.


In contrast, simple HTML, CSS and JS can be safely expected to work for decades at the very least.

'make' is older than html by almost 20 years.


What $(BUILDER) are you using? Could be GNU m4 (been there, done that) or something more (or less?) evolved.


Nothing fancy, just a python script that parses each page's "header" (a set of '='-delimited KVPs), interprets the rest as the main content, and then does some text substitution in the template (in practice, I only have a KVP for the page title that's used in the template).


Okay, you get nerd points for that.

I write my website in Emacs org mode, then export to html. I like to think that I win on nerd points :-)


I tried that but couldn't grok how to set an arbitrary page structure. The default org html export is awful and it seems very opinionated about the workflow, but the docs weren't clear about what those opinions were.

Now I'm using a Frankenstein's monster of org-pandoc and `cat`


> I tried that but couldn't grok how to set an arbitrary page structure.

I don't know what this means - I write a normal org document with headings and suchlike, and then export. For site structure I store each page as a separate org file and the html-export exports the links correctly.

It might just be that I am happy with the output so I didn't try to change anything, so didn't run into the problem you did.


What do you do if you want to change the layout of the rendered html?

For example, suppose you wanted a sidebar, or an absolute-positioned floating navbar or something.


> For example, suppose you wanted a sidebar, or an absolute-positioned floating navbar or something.

I suppose that I would have to specify that I wanted to export a ToC with a maximum depth of 1. Currently all my css rules are in a different file (not managed by emacs/org) and I would modify the css in that file to ensure that the ToC appears in a left positioned div, or a floating absolute div, etc.

To be honest, I think that that will only work for a ToC. If you asked "how would you specify a list for the sidebar and another for the top menu navbar" I won't be able to give you an answer[1].

[1] Hey, maybe it can be done, but not as far as I know.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: