top | item 19947068

Host Your Own Blog with Gitlab and Netlify

220 points| cimnine | 6 years ago |brainfood.xyz | reply

85 comments

order
[+] wildmindwriting|6 years ago|reply
You know, I've been using the Bitbucket & Netlify ecosystem for my Wild Mind[1] website for a little over a year. I moved from a self-install of WordPress on Digital Ocean to the Victor Hugo[2] boilerplate and then used my own theme. It's been an absolute joy to build with and I've actually been excited to continue to write because the friction to doing so is largely gone. Really can't recommend Netlify or Hugo enough.

[1]: https://www.wildmind.io

[2]: https://github.com/netlify-templates/victor-hugo

Edit: formatting

[+] indigodaddy|6 years ago|reply
Your site is very easy to look at. Well done. I read your "about me" and like your writing style as well. And agree, Netlify is pure gold.
[+] giglamesh|6 years ago|reply
Beautiful! I've been loving Hugo for a while now, using it for a neighborhood organization, but I've yet to find a non-technical front-end for managing the content. I built this great thing but no-one else in the non-profit can contribute because they (understandably) don't want to or can't take the time to learn Markdown. Have you (or anyone) found a Hugo friendly front end?
[+] tomcam|6 years ago|reply
That’s one of the best-designed websites I’ve ever seen. Good writing too. But wow, Medium should just hire you to do a redesign.
[+] theNJR|6 years ago|reply
I’ve been self hosting word press for my blog since 2006. What made you switch? And why do you like it better?
[+] egman_ekki|6 years ago|reply
Enjoyed reading your essays. Thanks.
[+] ilaksh|6 years ago|reply
It's not using a blog hosting service but it's also not really hosting your own since Netlify is actually hosting it.
[+] jjeaff|6 years ago|reply
I think even using WordPress.com would be considered "hosting your own" in this context.

I think most of the time, "host your own" means you can do more or less whatever you want with your site. Rather than putting your content somewhere like medium or Facebook or Instagram where you are in a closed and controlled system.

[+] phillc73|6 years ago|reply
Also did something similar two weeks ago.[1] It's a big work in progress!

I'm using Rstudio's Distill framework[2], writing RMarkdown, hosting on Gitlab and publishing on Netlify.

Netlify is dead simple to setup, even the domain name and DNS re-direction. I'm also using one of their contact forms.

[1] https://goodinplaces.net/

[2] https://rstudio.github.io/distill/

[+] als0|6 years ago|reply
I'm interested to know what the advantage of using Netlify is over simply using Github Pages.
[+] deftturtle|6 years ago|reply
You can receive form submissions, which is very nice for some websites. You can also bundle assets and minify CSS, JS, etc. You can set header rules and cache settings. All of this is not possible with Github as far as I know.
[+] anater|6 years ago|reply
idk if GH pages has added this, but Netlify lets you determine your build command and environment for deployments. You can also have different deployments per branch with easy rollback functionality. In short, its built for this exact problem where GH pages is a tacked on feature for repos.
[+] rahimnathwani|6 years ago|reply
This is a nice write-up, and it's great that it includes instructions for things like creating a GitLab account, which may be unfamiliar for non-developers.

But if you're going to maintain a blog as a set of markdown files, it'a worth considering using Netlify CMS (a web-based CMS for managing markdown files in a git repo).

This is especially the case if you don't use a command line or git often, e.g. if you're not a developer or sysadmin.

A good starter repo for a blog based on Gatsby, git and Netlify CMS:

https://github.com/alxshelepenok/gatsby-starter-lumen

I used the above for my blog, with only minor changes:

https://www.encona.com/

[+] neon_me|6 years ago|reply
Why u dont use just regular Gitlab Pages without Netlify?
[+] gcells|6 years ago|reply
Well Netlify does give you an option to add custom headers, redirects etc. Add CDN and cache busting along with branch deploys, that's something you cannot do with gitlab pages or github pages. Also github pages takes a long time to get live for the first time (at least it did for me).
[+] noja|6 years ago|reply
Anyone know?
[+] pierreprinetti|6 years ago|reply
I am loving Netlify!

However:

> The site will have free TLS and IPv6

Unfortunately, the DNS provider (dns1) does not expose DNS over IPv6. Therefore your site is exposed over IPv6 by Netlify, but it will not be reachable by a (probably non-existant) IPv6-only client.

Try:

dig AAAA dns1.p04.nsone.net

[+] indigodaddy|6 years ago|reply
This not correct. The auth DNS resolves ipv6 records for that domain:

bash-4.4$ dig @dns1.p04.nsone.net AAAA brainfood.xyz +short 2604:a880:400:d1::8b0:4001

[+] cimnine|6 years ago|reply
Yes. And no. It depends on the resolver. If the resolver is IPv6-only as well, then yes.

But thanks for pointing this out!

[+] lixtra|6 years ago|reply
Why would you do this? Who else does it? And how is it superior to just signing up with a hosted Wordpress (like 30% of the Internet)?

EDIT: Feel free to downvote but please answer. TFA does not answer it.

[+] Xylakant|6 years ago|reply
My mother for example does this. She’s writing her travel blog in Botswana, where internet connectivity is not a given and often spotty. She uses middleman as static site generator, hosted on an S3 bucket. That gives her the option to write the post, check it, commit and upload it. If the push doesn’t go through, try again (another day or hour sometimes). Try doing that with hosted wordpress.

We do it for our company website. Markdown makes it easy to have a pull-request-based workflow for reviews. It’s neat and uses the tools we as developers are used to. Another advantage is that the end result is static pages. We can literally host them anywhere, though we’re currently using netlify for convenience. They don’t need security patches either.

Does that make it superior to hosted WordPress? For our needs: yes. For other people’s needs? Don’t know.

[+] somada141|6 years ago|reply
I do that myself for a personal travel-blog I recently started (https://blog.nomakuma.com/) entirely for free using: - GitHub - Hugo with the Casper-Two theme (https://github.com/eueung/hugo-casper-two) - Netlify - TinyLetter (https://tinyletter.com/) for newsletter signups and distribution - Disqus for comments - Forestry (https://forestry.io/) to allow for less-technically inclined people to author posts without touching Git

I think the appeal is that you have complete control over your site/blog and should you choose to somehow monetise the content, e.g., adding singups and subscriptions to premium content or even ads, you can have complete control. With a combination like this you start at 0$/m for ever (or at least until Netlify stops offering free services) and take it from there. I probably won't do this for a travel-blog but its nice to have the choice and to be honest I wanted to try out a combination of the tech mentioned above and see how far I can take it for 0$.

I still have an old blog on Wordpress (http://pyscience.wordpress.com) and its done very well but I never liked the fact that Wordpress just sticks ads wherever it wants to unless I get the premium subscription.

[+] skilled|6 years ago|reply
A lot of people do it. Performance and minimal maintenance are among the reasons.

WordPress is good, but some see it as overkill.

[+] indigodaddy|6 years ago|reply
You'd be very surprised just how many people are doing this (sort of thing). A ton. Netlify itself is a revelation.
[+] scruffyherder|6 years ago|reply
I have no idea. But I do know that I'm not giving control to some walled garden that can yank it at a moments notice.

Might as well be a Facebook page.

Why is the youth so adverse to owning their own data?

[+] Brajeshwar|6 years ago|reply
For WordPress, I’ve to be always worried that it might go down unless hosted with a good dedicated provider. Unless it is complex and I want to do lots of things besides just writing/blogging, I try to choose something static than WordPress.

For the many many static sites that I throw out with either Jekyll or just plain HTML/CSS/JS, I know that once I drop them to something like S3 + CloudFront fronted by Cloudflare, it will very very unlikely go down.

They all have their time, places and circumstances.

[+] dictum|6 years ago|reply
Please avoid "why would you do X?" when discussing some tool or workflow. It's needlessly confrontational (and through that, restrictive of diversity, as different groups can have different needs and preferences), devoid of information (it doesn't explain the converse, why you shouldn't do X), and lacking in imagination (establishes tradition as a hard principle, and not just a guideline that can be broken depending on the context).

It's good to want to know why some people want to do X, but try to ask it in a way that doesn't make a negative assumption about the people taking a certain approach.

[+] snicker7|6 years ago|reply
Here's why I don't do it: Wordpress.com does not allow for custom Javascript.
[+] cs02rm0|6 years ago|reply
Isn't Wordpress the most hacked software on the web?

This is free (domain aside), doesn't require managing upgrades and presumably has some redundancy.

[+] dickeytk|6 years ago|reply
some people (especially HNers) prefer a simple and DIY approach
[+] OrgNet|6 years ago|reply
That is pretty cheap ($10/year with own domain), but I pay $12/year for a full-blown VPS and it is pretty stable (would not use it if my life depended on it though but it is more stable then my Comcast Internet service)... found it here: https://www.lowendstock.com/
[+] skinnyarms|6 years ago|reply
I've hosted several small apps with Netlify, and I recently setup my first blog/brochure type site using Netlify CMS. It's awkward, but it's amazing to me what you can accomplish with a (free) build server, a couple small 3p services, and a CDN with so little effort.

Great dev experience, great user experience.

[+] greenyouse|6 years ago|reply
I guess this is might be easier to set up but you could get something similar on AWS by posting to an S3 bucket and putting pages into CloudFront CDN. Adding CodeCommit could automate deployment for $1/month or you could write a script to publish new pages for free.
[+] Xylakant|6 years ago|reply
You’ve just reinvented netlify without the polish. But the polish is what makes it great. I’ve moved a few websites off S3 to netlify and the level of integration they offer is great. DNS, TLS certs via let’s encrypt, preview builds for PRs, ..., that’s exactly what I’m willing to pay for. And I know that if they make a business move I don’t like, I can always move off again. No lock-in except the polish.
[+] tkjef|6 years ago|reply
just started using netlify after making my own tool that did something similar and being a holdout for awhile. it was a smooth experience and i am now a happy user. put up a mortgage calculator app: https://www.mortgagecalculator.io/
[+] jjmiv|6 years ago|reply
i've used netlify for a few years, its great.

I use it with github. wanted to use github pages but was tired with having to use submodules in order for it to recognize the docs folder.

[+] tchaffee|6 years ago|reply
Has anyone done something similar with GatsbyJS by any chance?
[+] mothsonasloth|6 years ago|reply
Its cool but I think hosting and configuring your own site/blog can be a rewarding experience.

Only last week I had to figure out why a file called btmp in /var/log was so huge.

Then I discovered fail2ban