
Using Hugo, Gitlab Pages, and Cloudflare to Create and Run a Free Static Website - tkainrad
https://tkainrad.dev/posts/using-hugo-gitlab-pages-and-cloudflare-to-create-and-run-this-website/
======
usgroup
So far as I can see github pages supports ssl termination with let’s encrypt
certificates all by itself:

[https://github.blog/2018-05-01-github-pages-custom-
domains-h...](https://github.blog/2018-05-01-github-pages-custom-domains-
https/)

~~~
iamnothere
Let's Encrypt for GitLab pages should be coming in the next release though
(finally). It's been in the works forever.

Edit: source [https://gitlab.com/gitlab-org/gitlab-
ce/issues/28996](https://gitlab.com/gitlab-org/gitlab-ce/issues/28996)

------
aleks_me2
I have also chosen gitlab, hugo and netlify. Netlify because they have the
nice feature to use forms in the site. My setup is described in this post.
[https://www.me2digital.com/blog/2017/09/move-from-wp-hugo-
an...](https://www.me2digital.com/blog/2017/09/move-from-wp-hugo-and-netlify/)

------
infominer
Nice Work! I'd will check out GitLab pages soon!

I just wrote a guide on how to migrate from Jekyll-HPSTR to HPSTR-Hugo.

This in-detail guide should help anyone switch from Jekyll to Hugo or even
Hugo to Jekyll.

I didn't notice this before posting:

[https://news.ycombinator.com/item?id=20070203](https://news.ycombinator.com/item?id=20070203)

Direct Link- Migrating from Jekyll-HPSTR to HPSTR-Hugo:

[https://infominer.id/web-work/posts/migrate-jekyll-hpstr-
hug...](https://infominer.id/web-work/posts/migrate-jekyll-hpstr-hugo/)

------
bilal4hmed
What is a good way to get analytics and comments in such a set up ?

~~~
JonLim
Not OP, but you can embed Google Analytics (or Tag Manager) into your Hugo
template, and it's fairly straightforward to do.

Comments I'm not entirely sure of, because I never wanted them on my site in
the first place!

~~~
pmtarantino
For comments you can embed an external service, like Disqus.

~~~
JonLim
Agree! And I'm sure it's also another script to add to the templates, at the
footer of a post template, probably?

------
JonLim
Guess it's having connectivity issues?

Haven't read the post yet, but any advantages to using Gitlab Pages and
Cloudflare with Hugo over using Netlify?

My personal blog[0] is Hugo + Netlify, and it's been a pretty great
experience, so I'm always curious about alternatives! (I'm not a fan of the
Netlify CMS though.)

[0] [https://jonlim.ca/](https://jonlim.ca/)

~~~
jvns
the main advantage for me is that Cloudflare's free tier has no bandwidth
limit. Netlify's free tier has a 100GB/month limit
([https://www.netlify.com/blog/2019/02/26/netlify-and-
bandwidt...](https://www.netlify.com/blog/2019/02/26/netlify-and-bandwidth/)).
I put Cloudflare in front of my Netlify site because of that.

~~~
Gys
Or instead spend some time to optimize your website a little (like not hosting
yourself standard stuff like jquery, Bootstrap and such, compress images,
etc). So you can serve 10s of 1000s visitors without hitting a 100 GB free
tier ;-)

~~~
detaro
You're responding to someone running one of the more well-known developer
blogs and hosting PDFs, it's not exactly surprising she might need a bit more
bandwidth.

------
the_duke
I used to rely on Github + Cloudflare, but now services like netlify.com are a
a simpler/better alternative.

EG netlify gives you a Docker based build environment + CDN, all you need is a
a Github/lab repo with a config file.

~~~
mikro2nd
Gitlab gives you a build environment with a choice of several static website
builders. Personally I'm using Hexo rather than Hugo and it "just works".

------
aries1980
How can you avoid content dupe for search engines?

~~~
dredmorbius
What do you mean?

~~~
aries1980
Gitlab (this is where you host the content) Gitlab Pages and Cloudflare are
public-facing. If e.g. Google starts caching, for Gitlab Pages you might be
able to set the canonical tag to point to the CloudFlare-served hostname, but
I am not aware how to do it for the Gitlab UI.

