Live data from Hacker News

How to start a blog using Hugo

flaviocopes.com

21–30 of 111 posts

Re: How to start a blog using Hugo

#21
I've been using Hugo for a few years now. Pretty long to set up if you want to addapt one of the available templates to suit your needs, but then it's really great!

I would not advise it to a non-programmer/tech savvy person though.

Re: How to start a blog using Hugo

#22

I keep wanting to use Hugo, and I have made a few attempts. Moving away from Wordpress and its problems would be good. I do think a few features are missing that I find valuable: * Search (you can add it as an external service I haven't found one I trust and like yet. * Comments, there are several third-party comment providers that I can use, I tried out Disqus for a while but I didnt like nor trust them. I look at u…

I'm running my blog (https://muffinman.io) on Jekyll and GitHub pages, and I've run into the same issues.

For search I generate a JSON array, with the name and the url to each post. Then I just client side javascript to search them. It adds a small traffic overhead, but users said they really like the search - it is instant and uses fuzzy matching algorithm.

Here is the code I use to generate the array: https://github.com/Stanko/Stanko.github.io/blob/master/_incl...

For comments I use staticman (https://staticman.net/), and it is brilliant. Instead of having a 3rd party comment system, it will issue a pull request to your repo. You can set it to automatically merge PRs or to merge them manually (and moderate them).

The only problem is that because of changes to the GitHub API quotas, their public instance gets overloaded. But you can easily setup your own instance. I use heroku, and their free tier is more than enough for my usecase (I get more than 100k users a year).

I even wrote a short post how to set it up on heroku: https://muffinman.io/running-staticman-on-heroku/

Hope that helps, happy hacking!

Re: How to start a blog using Hugo

#24
post #14

I like the idea of static blogs. However, I didn't accomplish to find a great workflow to use hugo from my android phone while traveling. Using git on a phone is a pain

Yes this is where I got blocked on this too. I like using the WP Android app to upload photos when travelling. Obviously a static site by its very nature cannot interact with a phone app, so this seems like a difficult/intractable problem.

Re: How to start a blog using Hugo

#25
Anyone looking for a static blog but that wants a decent interface for editing, check out forestry.io. once setup, it commits to GitHub for you, your user is none the wiser. If the service ever goes away, you still have your blog in GitHub. And you can deploy anywhere (s3, netlify, etc). I use this setup for my non technical wife.

Re: How to start a blog using Hugo

#26
The author seems adamant that blog.domain.com is a worse setup than domain.com/blog - I've seen this argument go back and forth a lot, with both sides claiming advantages and disadvantages.

I am interested to hear the consensus from HN users as to which is better, and why.

Re: How to start a blog using Hugo

#27
post #6
post #5

Earlier quoted context omitted.

Similar issues from my side. Cryptic documentation, bad dissorganized forum and configuration,... I love the hugo idea but to find one detail you will get into chaos of strange wording and noise. I am using it but I try to configure as small amount as possible as I always get into some undesired behaviour. It seems like it was from begining build with idea and then continued by patch over patch over patch. Cant recom…

I decided I would make a static site the old fashioned way on neocities.org and happily got started. And then I remembered all the double work you have to do linking and making lists and repeating headers/footers (or use frames) and so on. Now I'm back to looking for some simple script that can output static sites without having to spend a month learning a new tool...

I tried a few about four years back, when I had much less web dev experience than I do today (not a professional developer). I found Jekyll to be the easiest for me. Just powerful enough to make pretty much any static site I could think of, but easy enough that even I could do it. Hosting was easy too, at the time I just FTPd everything to my provider, but I now o use rsync.

Re: How to start a blog using Hugo

#28

The author seems adamant that blog.domain.com is a worse setup than domain.com/blog - I've seen this argument go back and forth a lot, with both sides claiming advantages and disadvantages. I am interested to hear the consensus from HN users as to which is better, and why.

It's not a matter of one being objectively better than the other but which suits your needs.

The basic distinction, from a purely SEO perspective, is that blog.domain.com will be treated as its own entity whereas domain.com/blog will be treated as part of the main domain.com entity.

The question you have to ask yourself is whether you want to bolster the "value" of your main domain or if you want your blog to be an asset in its own right.

There is no right or wrong answer — there is simply what's best for your situation.

Re: How to start a blog using Hugo

#29

The author seems adamant that blog.domain.com is a worse setup than domain.com/blog - I've seen this argument go back and forth a lot, with both sides claiming advantages and disadvantages. I am interested to hear the consensus from HN users as to which is better, and why.

I have some reasons to prefer domain.com/thing now :

- You don't have to add and manage subdomain

- You don't have to stop and restart the reverse-proxy of your VPS

- Only one cert to deal with (I use traefik w/ automatic LE renewal but that implied more things to set up on the chain)

But I still use blog.domain.com because I find it prettier. And when I need to type it in the URL bar it's just $service.domain.

Now the SEO crowd has other requirements that make their choice more valid than my own (one user, one set of idiosyncrasies).

Re: How to start a blog using Hugo

#30

The author seems adamant that blog.domain.com is a worse setup than domain.com/blog - I've seen this argument go back and forth a lot, with both sides claiming advantages and disadvantages. I am interested to hear the consensus from HN users as to which is better, and why.

I feel like x.example.com is preferred over example.com/x because it is simpler to move the files around (when you want the same app/bundle of static files to be y.example.com). Browsers by default will make into x.example.com/foo/bar.html when served from x.example.com, but it won't make it into example.com/x/foo/bar.html when served from example.com/x/; something else has to make sure the URLs are correct. The options available to make links work are to generate correct links in the first place (CGI back in the day provided enough information to make this possible, but modern reverse proxies have no way to convey this), never use absolute paths in links (restrictive), or to have some machinery intercept the document, parse the HTML, and rewrite links (super flaky). If you are always going to be at exmaple.com/x/ and never need to change the base URL, you can make it work. If you are making something reusable that people download and self-host, you will pull all your hair out making the /x/ case work well. Therefore, people tend to prefer the subdomain approach. It's just easier, because of an implicit base URL assumed by browsers (and even things like grpc clients). When you try to override defaults, it's like rolling a stone up an infinitely long hill. This is that, I think.

For your blog, it doesn't matter. You can hard-code the entire URL in every link and it will probably never go wrong. Applications are harder. Applications that various people are going to self-host are hardest.

Post reply on HN