News for hackers. Stuff that matters.
Re:Show HN: Generate a static website from any back end by kfk on Saturday May 02, 2020 @12:58AM (#23049362)
Well I had to do our corporate team site and got so frustrated with SharePoint that I coded a script in python to generate the html from rst files. It was a couple of days of work. It runs behind nginx and automatically updated on GitHub commit of new content. Bootstrap is very well documented and you can use rst directives for “widgets”. I am in the process of moving to markdown + yaml now to make writing content even easier.
Re:Show HN: Generate a static website from any back end by jnbiche on Tuesday May 05, 2020 @03:15AM (#23077336)
> I coded a script in python to generate the html from rst files

There’s an outstanding and fairly flexible static site generator for rst files in Python that’s been around for quite a long time, called Sphinx. It’s basically a docs generator but I’ve used it as a generic static site generator.

Re:Show HN: Generate a static website from any back end by dewey on Saturday May 02, 2020 @02:37AM (#23049831)
Why not just use any other static site generator like Hugo instead of re-inventing it?
Re:Show HN: Generate a static website from any back end by ipieter on Saturday May 02, 2020 @05:12AM (#23050479)
I can answer that, since I also made a small static site generator from scratch in python.

I was using another static site generator (Hexo), but at some point I wanted to change some things and add some custom html to my posts. Since the documentation was ... well ... minimalistic on some aspects, I also spent some time looking at the source code. But at that point I was really wondering what benefit I still had from using that generator.

In the end, all a static site generator does is collecting some markdown or RST files, converting them to html and putting that into a template html file. And generating some lists (index page, RSS, ...) and some metadata for SEO. So it took me a single Saturday to make a working static site generator and now I can do anything I want without looking up documentation or source code, since it's my own dumpster fire :-)

Re:Show HN: Generate a static website from any back end by kfk on Saturday May 02, 2020 @05:45AM (#23050614)
Because my team has an easier time managing our simple code vs a new tool. Also we have a lot of custom components because we use our site to provide navigation for our apps, dashboards and docs. I couldn’t find a generator that would fit all those requirements.
Re:Show HN: Generate a static website from any back end by lowdose on Saturday May 02, 2020 @10:30AM (#23051987)
Google docs also has options to export to markdown.