Hacker News new | past | comments | ask | show | jobs | submit login
Host Your Own Blog with Gitlab and Netlify (brainfood.xyz)
220 points by cimnine 29 days ago | hide | past | web | favorite | 85 comments



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


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.


What a lovely comment to read. Thank you! Netlify has taken the pain of maintaining a server away.


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?


One click Hugo cms [0] which provides a user friendly front end.

[0] https://github.com/netlify-templates/one-click-hugo-cms


Thanks, but we don't have the budget necessary for Netlify Identity. At least last time I checked, it is only free for a very limited number of users.


There is also netlifycms.


Thanks. I should have mentioned that I did look into that and found the free version too limited in the number of accounts it allowed. We need to have a small, but > 2 number of users accessing the front end. We have no budget to pay for the non-free netlify-cms.


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.


I’ve been self hosting word press for my blog since 2006. What made you switch? And why do you like it better?


I switched because I've done a lot of WordPress development over the years and I wanted to learn something else. Liking it better is because it's a far simpler set-up for me: no database, write in the terminal, don't have to worry about comments or malicious log-in attempts. WordPress is great, don't get me wrong, but using the same platform became boring for me.


I'm adding you to my blog list


Enjoyed reading your essays. Thanks.


It's not using a blog hosting service but it's also not really hosting your own since Netlify is actually hosting it.


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.


I did almost exactly the same yesterday.

https://blog.omerh.me/post/2019/05/17/first_post/


Nice theme, I built one some months ago I found none to my taste, so I modified my own

https://xaviondono.com/

Now I just need to start writing


Plus you've invested a little in finding a nice theme :)


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/


I'm interested to know what the advantage of using Netlify is over simply using Github Pages.


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.


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.


You need "different deployments per branch with easy rollback functionality" to run a blog with a couple markdown files? Talk about over-engineering.


There’s utility for different deployments per branch and rollbacks when you’re connected to a headless CMS (Contentful, Wordpress API) and managing more complex statically-generated web sites.


GitLab


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/


So if you’re not a developer and familiar with git you suggest for people to use the ridiculously complex, react-based gatsy, and still use git too?


Not exactly. I suggest using Netlify CMS, which uses git under the hood, and means git is invisible to you.

One way to set something like this up is to use the gatsby template I linked, which can be used without knowing what React, GraphQL (or even Gatsby) are.


I have never used Gatsby, but another in the space is Hugo. If you want a blog then you can choose from one of the many different templates. In terms of PITA, this isn't far off from a self-hosted Wordpress option. Netlify even gives you the option to drag and drop your entire site rather than using a tool such as Git. Yes, Hugo and all these other tools can get to be a massive headache, but you can get a blog going really easy.


I'm using Hugo for a neighborhood non-profit and really stuck on the non-developer front end. I looked into the Netlify CMS but it allows only one (or a few?) accounts to access a site under the free plan. The non-profit has no budget for kind of thing.


Netlify CMS is released under the MIT Licence.

But if you're using Netlify for hosting, you'll need the 'Netlify Identity' service to allow your users to log in. The free tier has a limit of 5 users (or 1000 if you allow open sign-ups).

Does your neighbourhood non-profit have more than 5 non-developers who need that front-end to add/edit pages?


Oh. Thx. That's a nice find. I started to play with Gatsby a couple of weeks ago. I want to do / maintain my CV via markdown and a straightforward static site.


Why u dont use just regular Gitlab Pages without Netlify?


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).


Afaik you can specify custom headers in Cloudflare - same as CDN/Cache support and you can definitely use custom branches for release and dev in gitlab - all you have to do is specify them in config.yaml ...

I have been running a bunch of generated static pages via GH (and now GitLab) and never seen any disadvantage, but don't take me wrong - I am always learning :)


What does Netlify bring to the table? Gitlab already has CI/CD.

https://docs.gitlab.com/ee/ci/

Deploy a Blog site with Gitlab pages and Cloudflare https://blog.zenggyu.com/en/post/2019-02-08/deploying-a-blog...


I've done such setups as well. E.g. my "personal" website cimnine.ch is set up like that.

Netlify was just a lot quicker to get started. It automatically compresses images, js, etc., if you tell it to. It automatically deploys branches to a special subdomain, so you can share previews of branches with other people. Also, though I haven't used that yet, it has this "Functions" thing that would allow you to add dynamic behaviour to your static website.


Thanks for sharing the links. The GitLab Pages doc [1] and product vision [2] may be an interesting read as well.

[1] - https://docs.gitlab.com/ee/user/project/pages/

[2] - https://about.gitlab.com/direction/release/pages/


Anyone know?


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


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


The thing is that `dig AAAA dns1.p04.nsone.net` does not resolve anything. A pure-ipv6 network would not be able to resolve my domain, as there is no way to contact dns1.p04.nsone.net via IPv6.


Ah, ok I get now.


Yes. And no. It depends on the resolver. If the resolver is IPv6-only as well, then yes.

But thanks for pointing this out!


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.


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.


A lot of people do it. Performance and minimal maintenance are among the reasons.

WordPress is good, but some see it as overkill.


You'd be very surprised just how many people are doing this (sort of thing). A ton. Netlify itself is a revelation.


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?


It's just static pages. All the code is in your Gitlab/GitHub repo. I wouldn't call Netlify a walled garden, but the workflow definitely does not imply a situation where you'd lose your data in the unlikely event that Netlify goes down or closes shop.

I don't see any vendor lock in evident in any of this. Plenty of flexibility to both move your git code to your own self hosted git, and quite easy to host it on your own webserver on DO or wherever instead of Netlify.


What are you referring to as "walled garden" here? (Also, what does this have to do with "youth"?)


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.


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.


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.


try to ask it in a way that doesn't make a negative assumption about the people taking a certain approach.

I feel like there is a LOT in this comment that is reading much more into a question that very likely are not even there, to take the position of scolding someone just because their inquiry was delivered in brevity.


I don't mean to scold, but I understand that it comes across as pedantry.

It's hard to give good advice in a tone that isn't paternalistic, and I should get better at doing that. Sometimes you just want to ask a genuine question without somebody questioning your phrasing.

What prompted me to give out advice is "Feel free to downvote but please answer". I don't believe the comment deserves a downvote, but I assume (and it may be, as you put it, reading too much into it) that some downvotes come from people who are tired of seeing the attitude I describe in my reply (https://news.ycombinator.com/item?id=7650799#7651343).

It's a case of greedy matching /why would you do/.


Actually, I agree with dictum (and appreciate the pointy comment). Many people read my comment confrontational, or it wouldn't be downvoted.

And then I learned that there is a niche (compared to 30% WP) of technical people that have their content in GitHub anyway and profit from simple deployment through netlify. It just fits their workflow. I had the typical business user (another blog post said everyone!) in mind and I don't see them to be able to handle git so it sounded very far fetched which was reflected in the tone.


What if English is the persons second/third/xth language and that's the best way they know to ask?


Here's why I don't do it: Wordpress.com does not allow for custom Javascript.


I wrote my own static page generator [1] because it feels easier to write in markdown in Emacs and less worries about updates/security. I've also managed to keep a continues stream of output for close to 2 months :-) [2]

[1] https://github.com/john-bokma/tumblelog [2] http://plurrrr.com/


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.


Free plugins with awful code usually are, wp itself might be okay if you know how to secure it properly - but that so much more technically demanding that almost no one does it. Being so prevalent makes it to a huge target.

SEO experts and social media marketers will tell you that nothing beats Wordpress, but that's not true I've seen plenty of static sites that are much more engaging, work faster and rank higher when they post good content often.


some people (especially HNers) prefer a simple and DIY approach


We use Django + Distill on Netlify for static output from Django projects. Netlify is awesome. Example: https://github.com/mgrp/django-distill-example


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/


That $12 VPS includes a domain? Because that's the only paid thing in the blog post.


I thought that this $10/year was for using a domain that you already owned... yes I did need to pay another $10 for a domain.


How legit is this? Seems too good to be true and more like a scam. Any experience anyone?


There are few VPS services for $1/month, but if you pay slightly more, like 2-3 USD/month, or have patience to wait for a campaign, or are prepared to pay two years upfront, you will get a high quality vps service, and can expect the same uptime as the major cloud services. If you can afford another 1-3 dollars per month, get an additional VPS on another network, and set up round robin DNS for load balancing. Which for 2-6 USD per month gives you almost close to 100% uptime. And 1-2 TB monthly bandwidth. 1-2 vCPU cores and 256 MB memory is more then enough to handle a static web site.


I'm just a customer ... it is very legit but it is a bit like ebay and amazon so of course the quality varies.


It's legit. Not a scam. I have no idea how Netlify can offer so much in their free tier, but they do. They are likely to get bought out by a Cloudflare, etc, at some point, so time will tell if the free tier will remain so feature-full.


Oh you were referring to lowendstock.com. Yeah, you'll need to be careful when considering low-end price VPS providers in general. Some can certainly be fly-by-night. You can find reviews and discussion at lowendtalk.com and lowendbox.com.

Here's some that are for sure legit and been around for a long time though (does not imply necessarily that providers not listed are not legit though):

Ramnode BuyVM Securedragon Lowendspirit

I personally use BuyVM and Netcup.eu.


The parent asked about Low End Stock, not about Netlify


[flagged]


vultr does not have VPS for <$1/month?


Ha-ha, good one! I did the same but in 2 hours. Really recommend Netlify + GoHugo.

Here is my review of popular static site generators plus hosting: https://medium.com/@tarasmatsyk/how-to-kick-off-a-blog-in-2-...


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.


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.


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.


I have done the same for https://jimmyislive.dev/ (using Github and Netlify). All the code for this site is on GitHub (see the About page)


I just did this for my product website. It’s been wonderful using netlify and Hugo with the universal theme.

https://homemadegrow.com


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/


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.


Has anyone done something similar with GatsbyJS by any chance?


Browse down to rahimnathwani's comment


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




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: