Live data from Hacker News

Building a fast, secured and free static site in less than three hours

fillmem.com

11–20 of 201 posts

Re: Building a fast, secured and free static site in less than three hours

#11
The author has done a great job of documenting all the low-level details about even how to use git to push stuff to the GitHub repo. Kudos for the excellent documentation.

I use Hugo + Gitlab + Netlify (free https). I use Emacs as my development environment, and Magit (https://magit.vc) has come as a boon to me. All the git shell scripting mentioned in this post reduce to few key strokes with the help of Magit. I'm not intending to divert the topic, but couldn't help mentioning that the Magit Kickstarter [1] needs some love.

Coming back to the Hugo topic, I believe that the 3 hours is a good practical estimate for someone who has never dabbled with git/github, domain control tweaks, CNAME, etc.

So don't take that 3 hour mention as a negative, and jump right into the post. Once you have the whole setup, updating your site is a simple git commit + git push (hardly a minute -- not counting the time it takes to gather content for a new post :)).

[1]: https://www.kickstarter.com/projects/1681258897/its-magit-th...

Re: Building a fast, secured and free static site in less than three hours

#12
post #3

As far as I know, Github pages doesn't support https for custom domains [1]. A better option for free hosting would be netlify, which supports Let's encrypt for custom domains. [1] https://github.com/isaacs/github/issues/156

+1 for Netlify, and their amazing customer service via chat.

Re: Building a fast, secured and free static site in less than three hours

#13
I really like the speed of Hugo but I find the template language unintuitive and hard to read e.g. "if or condition1 condition2" and "lt 1 2". I wish you could swap it out for something else like Liquid templates...is that possible?

I'd just go for Netlify as well for hosting. It'll build Hugo sites for you when you push commits, they have a CMS you can connect with most static site generators, they deal with SSL setup for you and tons more features. Self-hosting anything eats up time and it wouldn't be as robust.

Re: Building a fast, secured and free static site in less than three hours

#14
This is the path I choose for most of my websites nowadays. Usually a combination of static generated website (I created my own generator), Firebase hosting (which offers the same free autogenerated SSL + url rewriting), and Cloudflare. Like this, it's fast, SEO friendly and most of all completely free.

Re: Building a fast, secured and free static site in less than three hours

#15

I really like the speed of Hugo but I find the template language unintuitive and hard to read e.g. "if or condition1 condition2" and "lt 1 2". I wish you could swap it out for something else like Liquid templates...is that possible? I'd just go for Netlify as well for hosting. It'll build Hugo sites for you when you push commits, they have a CMS you can connect with most static site generators, they deal with SSL set…

I have learnt that you can throw in parentheses for readability..

    if (or cond1 cond2)

Re: Building a fast, secured and free static site in less than three hours

#16
After many different iterations, I'm now using netlify (with middleman). Really hard to beat.

GitHub pages are amazingly fast and a pretty good default choice. With cloudflare it's a pretty solid combo.

But netlify's awareness/integration between the content and the cdn is really compelling. Imagine they'll be able to do a lot more with it down the line too.

Re: Building a fast, secured and free static site in less than three hours

#17
I host mine on Digital Ocean. I commit the code to github, dev branch is deployed to stg.mydomain and master is deployed to mydomain.

In terms of deployment, I use Caddy which, with ~3 lines of config will auto-TLS your site using Lets Encrypt, and handle renewing the certs for you each month. Caddy also automatically pulls your changes, builds them with hugo and deploys them with ~2 more lines of config.

It's the easiest solution (as a developer) I've come across where I just commit to Github and my blog is updated, and Caddy deals with my cert renewals.

Re: Building a fast, secured and free static site in less than three hours

#18

I really like the speed of Hugo but I find the template language unintuitive and hard to read e.g. "if or condition1 condition2" and "lt 1 2". I wish you could swap it out for something else like Liquid templates...is that possible? I'd just go for Netlify as well for hosting. It'll build Hugo sites for you when you push commits, they have a CMS you can connect with most static site generators, they deal with SSL set…

I have learnt that you can throw in parentheses for readability.. if (or cond1 cond2)

The next logical step is to mark with parentheses the two branches of the if expression:

  (if (or cond1 cond2) (then) (else))
although i suppose it's not really hugo anymore..

Re: Building a fast, secured and free static site in less than three hours

#19
post #18

Earlier quoted context omitted.

I have learnt that you can throw in parentheses for readability.. if (or cond1 cond2)

The next logical step is to mark with parentheses the two branches of the if expression: (if (or cond1 cond2) (then) (else)) although i suppose it's not really hugo anymore..

Is there a reason something more standard like "if cond1 or cond2 then x else y" isn't supported? Parsing speed?

Re: Building a fast, secured and free static site in less than three hours

#20
post #3

As far as I know, Github pages doesn't support https for custom domains [1]. A better option for free hosting would be netlify, which supports Let's encrypt for custom domains. [1] https://github.com/isaacs/github/issues/156

We use cloudflare on our Github pages custom domain, so you can easily get https support that way.

People need to stop calling Cloudflare's offering HTTPS support. It's snake oil.
Post reply on HN