Live data from Hacker News

Ask HN: What is setup for your static blog generator?

news.ycombinator.com

31–40 of 98 posts

Re: Ask HN: What is setup for your static blog generator?

#32
We use https://processwire.com for our blog and future more content sections. It's kind of a static generator which creates JSON-Files with meta-information and the rendered HTML-maincontent. The static processing is made with ProCache module and a python script which loads an sitemap and requests all sites each 1-2 hours.

we choosed this setting because we wanted the content-heavy parts in an easy to handle CMS (from a editor perspective). We wanted to integrate the content in our main webshop and not with a subdomain and between our main header and footer coming from our main webshop system (sap hybris).

show hn: https://www.blue-tomato.com/blue-world/

Re: Ask HN: What is setup for your static blog generator?

#33
For building the site I use Jekyll with a free theme I found online + some minor CSS modifications. I wanted to have js/css bundling/minification and html minification, but after spending an entire day trying to get webpack to work I gave up (what a joke). Instead I use a Rakefile that runs `jekyll build`, then does some bundling/minification - it works great.

For hosting I use cloudfront -> lambda -> s3. There is a lambda for incoming requests that handles some routing, and a lambda for responses from s3 that applies various security headers (HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Expect-CT, X-XSS-Protection).

I also have certbot (an ACME/LetsEncrypt client) running in a lambda once a day - if my TLS certificate has The whole thing is serverless, can handle arbitrary amounts of traffic & is very fast, and no maintenance at all. It costs me about $1.50 per month.

Re: Ask HN: What is setup for your static blog generator?

#35
A static site generator is just a build tool. You need some way to say what your output files are, and what source files are needed to create them. This is usually hardcoded (with some parameters and ad-hoc hooks) in something like Jekyll, but could be specified with Make. I wrote a very simple timestamp checker in a couple of dozen lines of Python.

Then your scss/less->css is probably best done with the command line compiler, driven from your build tool.

And for HTML, take a template language you enjoy and write a simple driver script. If you want multiple templates, add metadata to your source files. In my case I want Markdown->HTML, using various templates, so I use YAML for the metadata, then Python's markdown compiler, and finally Jinja2 for templating. Again you can write the driver in a few dozen lines for your own purpose.

My build tools then calls The AWS API to send it to its S3 bucket, in most cases. But in one it commits to a github pages branch and pushes.

It is exceptionally simple to code your own static site generator, if you can do basic command line scripting. And doing it that way allows you to be very flexible and add things like uploading, version control, etc.

I think it's better off seen as a command line tool, than a special 'static blog generator' task. In general I think we are erring too far on the 'build a niche vertical app' rather than 'automate powerful general-purpose tools'.

Re: Ask HN: What is setup for your static blog generator?

#36

For building the site I use Jekyll with a free theme I found online + some minor CSS modifications. I wanted to have js/css bundling/minification and html minification, but after spending an entire day trying to get webpack to work I gave up (what a joke). Instead I use a Rakefile that runs `jekyll build`, then does some bundling/minification - it works great. For hosting I use cloudfront -> lambda -> s3. There is a…

You can use AWS Certificate Manager to generate a free auto-renewing certificate and associate that with your CloudFront distribution.

Will simplify your stack a little by removing the LE step

Re: Ask HN: What is setup for your static blog generator?

#37

For building the site I use Jekyll with a free theme I found online + some minor CSS modifications. I wanted to have js/css bundling/minification and html minification, but after spending an entire day trying to get webpack to work I gave up (what a joke). Instead I use a Rakefile that runs `jekyll build`, then does some bundling/minification - it works great. For hosting I use cloudfront -> lambda -> s3. There is a…

You can use AWS Certificate Manager to generate a free auto-renewing certificate and associate that with your CloudFront distribution. Will simplify your stack a little by removing the LE step

At the time that I built it ACM only supported email verification. Also I'm quite fond of LetsEncrypt :)

Re: Ask HN: What is setup for your static blog generator?

#38
post #15

I use Hugo ( https://gohugo.io ) on my local machine to create the website and upload the resulting static site to the server via rsync. The website templates and CSS sheets are all custom, so I get total control over the result.

For anyone interested I created a privacy focussed theme for Hugo, with no third party scripts or assets:

https://github.com/lucaspiller/hugo-privacy-cactus-theme

I wanted a minimalist theme that's fast to load, but a lot of commonly cited examples are too extreme or look too dated for my liking. I wanted the same results, but something a bit more up to date and with code highlighting. You can see the end result on my blog (total network transfer 78kB):

http://www.stackednotion.com/blog/2016/07/09/setting-up-a-ne...

Re: Ask HN: What is setup for your static blog generator?

#39
I wrote my own for http://www.daemonology.net/blog/ . Basically it's a few template files, a /posts/ directory where I write the content of blog posts (one per file), and a shell script which generates all the html output.

Happy to share with anyone who wants it. Some day I'll get around to putting it up on github.

Re: Ask HN: What is setup for your static blog generator?

#40
I use Gutenberg (https://www.getgutenberg.io/) which provides built-in Sass compilation and live-reloading in a single binary. I just write Markdown and generate posts with Tera (https://github.com/Keats/tera ) templates for my HTML, so if I ever wanted to migrate to something else it would be trivial, but I'm a happy camper now.

When I'm ready to publish I just copy the public directory right to my webserver, but I could just as easily publish to GitHub or the like if I didn't enjoy maintaining my own domain.

Post reply on HN