Live data from Hacker News

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

fillmem.com

31–40 of 201 posts

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

#31

Might be a little off-topic but hopefully relevant enough. I'm rather new to web dev but currently have a static website hosted on AWS S3. My current workflow is to code the HTML and CSS files using Sublime Text then upload these files into a bucket manually via the AWS console. Is there a more efficient way to do this? And is there a simple way to enable HTTPS?

If you have multiple HTML pages, using a templating engine saves a lot of copy/pasting when you change headers, menus etc. (in the article they're using Hugo).

You can automate the uploading of files by writing a script to upload the files to the bucket so you can deploy in a single command (it gets trickier if you want to do a sync and delete files).

Personally I use rake [0] to create build and deploy tasks so I can do `rake build` and `rake deploy:prod`.

[0] https://github.com/ruby/rake

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

#32
post #30

Another nice feature on top of this type of setup is to set up CI hooks on your repo to check for broken links on every push, e.g. with https://github.com/gjtorikian/html-proofer . Example: https://github.com/mizzao/andrewmao.net/blob/master/Rakefile

Checking for broken links is probably something you want to run every X days or something like that, rather when you push your update, unless you only want to check if you accidentally wrote a link wrong, rather than if the link itself broke.

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

#33
post #25

I had really hoped that this was about building a static site, but again you'll end up with a blog. I've created an actual static site myself, but it takes a bit extra - especially from the theme. Also, I don't understand why you'd use Hugo with Github when it already supports Jekyll?

hugo builds are faster than jekyll, or so it was atleast the one time I experimented with it...

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

#34

Might be a little off-topic but hopefully relevant enough. I'm rather new to web dev but currently have a static website hosted on AWS S3. My current workflow is to code the HTML and CSS files using Sublime Text then upload these files into a bucket manually via the AWS console. Is there a more efficient way to do this? And is there a simple way to enable HTTPS?

You can try Scotty.js [1].

[1] https://github.com/stojanovic/scottyjs

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

#35

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 ea…

Assuming your blog is technical, this would have been a good chance to get some more traffic by at least mentioning the actual domain, linking to the github repo, or having one or both of those in your profile.

Edit: Not sure why this has been met with a stream of downvotes. Is there something wrong with saying "I use a different approach to publish this blog: [link]," especially if it's technical and would be of interest to HN anyway? I see many people do it constantly, even when it's not relevant to the article or discussion at hand.

Edit 2: I don't generally care where a post is but this went from -2 to +6 pretty quickly. Weird?

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

#38

Can someone explain the use for cloudflare at the end? I thought you can do the same thing just through your domain registrar?

Cloudflare DNS is one of the best authoritative DNS hosters in the world, if not the best already.

https://www.dnsperf.com/

Cloudflare is also a great free CDN and has a crap ton of edge servers to make your static content serve quickly around the world. Has a lot of other great features too.

Anycast ftw.

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

#39

Can someone explain the use for cloudflare at the end? I thought you can do the same thing just through your domain registrar?

>Github pages does not offer secured custom domain name. The best way to get this feature for free is to use Cloudflare.

Quoted from the post. It's used for flexible HTTPS.

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

#40
post #6

Earlier quoted context omitted.

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

It is exactly what the article author suggests in fact: > Github pages does not offer secured custom domain name. The best way to get this feature for free is to use Cloudflare. [The article then proceeds on how exactly do that.]

Yes, but cloudflare issues only shared certificates (that are shared across multiple domains) on their free plan [1]. If I wanted to use a dedicated certificate I'd have to upgrade to a paid plan.

[1] https://support.cloudflare.com/hc/en-us/articles/203349264-A...

Post reply on HN