Skip to content(if available)orjump to list(if available)

How I blog with Obsidian, Hugo, GitHub, and Cloudflare

ipsento606

    > This stack gives me full control: no subscriptions, no vendor lock-in,
    > and no risk of platforms disappearing or changing policies.
I'm not trying to dunk on the author, but this sentiment encapsulates a tremendous paradigm shift in the meaning of "full control", compared to say:

* Writing in obsidian

* Syncing files via git

* Publishing via nginx hosted on the cheapest possible vps (with https via let's encrypt)

Running a static blog is one of the easiest scenarios to self-host, because even if you get slashdotted, nginx should be able to handle all the requests even if you're host it on a potato

It's not free, but you can get a VPS for $20-$30 a year.

This isn't the best fit for everyone, but it seems weird to talk about "full control" and "no risk of platforms disappearing" when you're relying on the free tier of two external companies

lolinder

The point is that because of the way they structured their blog it would be trivial to do exactly this if they ever needed to. There's no complicated export from a locked in application, you just move your blog files from one host to another (maybe to your own VPS).

The overhead of switching from Cloudflare to a VPS if they needed to is really not that much larger than switching from one VPS to another, so they likely figured it wasn't worth paying $30/yr to own the whole stack, as long as they architected it such that they could own the whole stack if they needed to.

anon7000

Similarly, Obsidian is just a markdown editor. So you're not even relying on their free tier; you could use any other markdown editor on the planet with the same results. Or any cloud file syncing tool.

y42

Been there, done that. Had my personal blog hosted on a machine like that. Even a little more sophisticated with nginx, virtual hosts and stuff like that. I ended up with almost the same setup as OP is presenting here: Hugo, GitHub Pages and Obsidian (or VS Code).

While I know how to maintain a server, as I worked as a SysOp for many years supervising way bigger infrastructures, I just didn't want to spend my free time also with maintaining some remote host, installing security updates, checking fail2ban and so on.

Self hosting is always more than just "instaling nginx".

>> but it seems weird to talk about "full control" and "no risk of platforms disappearing" when you're relying on the free tier of two external companies

This ignores the fact, that OP is actually storing the content on it's own devices. Sure, OP is using some cloud services to sync them around and GitHub/Cloudflare to eventually publish it to the world. But there's no real dependency. OP could always and easily (!) move to another similar setup.

gexla

You don't have so much platform risk when you're hosting a static site. It's not like spending a fortune on development time to build on AWS just to find that the platform is a liability for the company, but you're locked in to the vendor.

taurath

It has more to do with Obsidian vs Notion or OneNote or Google Keep I'm gonna guess

intalentive

Do you even need https for static content?

linmob

Yes.

(For "social reasons": If you have any feedback channel on your static site, people won't stop breaking your balls until you add https.)

7thpower

Easy problem to solve.

pembrook

Great stuff, looking forward to your next blog post in 1 year: “How I rebuilt my blog on…”

A fun hobby of mine is Googling “how I built this blog with [next.js/Gatsby/etc etc]” and going to page 10 of the Google results.

It’s just hundreds of developer blogs with no blog posts other than the ones announcing how the blog was built.

freetonik

I’ve noticed this a lot, too, and made this drawing as a joke: https://rakhim.org/honestly-undefined/19/

bewuethr

I love that graph! So many occurrences of "that's me" or "I know somebody exactly like that".

rsync

Oh, you put me on your graph!

"Weird Dude Who Writes Raw HTML"

My most recent example:

https://kozubik.com/items/wago_audio/

gen220

Just a small word of unasked-for-advice... consider compressing your images further! Even ignoring bandwidth concerns, a 1.3MB image takes a while to paint :)

y42

*scnr:

ooof.. this chart is making my day, not because of it's content, but it's presentation. Apparently it only works if you have very different scales for x and y axis. As you have the same metrics on both of them (number of posts), it only worked if like x axis is from 1 to 10 while y axis is either log or from 1 to 100 or so. Or you choose a differnt metric for the x axis, like "share of posts about blog setups".

freetonik

My thoughts exactly! Originally I wanted to also add a 2nd vertical axis on the right to signify "share of posts about blog setups".

janandonly

Can I use this image on my blog?

I will off course link to you site. It’s to illustrate a point about my blogspot blog haha…

I’ve been looking to switch over to something else. But I’ve been actively blogging since 2006 and I haven’t found a good enough way and platform to switch over to.

freetonik

>I’ve been looking to switch over to something else. But I’ve been actively blogging since 2006 and I haven’t found a good enough way and platform to switch over to.

Would you consider participating in a private beta of https://exotext.com/, a simple blogging platform I'm building? (example blog: https://rakhim.exotext.com/)

If so, please send me an email: hello at rakhim.org

freetonik

Of course, go ahead! Please, share a link to your blog, I'm gonna add it to minifeed.net :)

(I'll update my website soon and will make the licensing clearer.)

ceautery

I'm in the "old-ass blogger.com site" category, with posts going back to '05.

martylamb

Literally just posted my newly hogoized site that dates back to 2003 THIS MORNING. :)

realprimoh

This is hilarious, and so true

nickjj

I started with and used Jekyll for almost ~10 years and ~500 posts before switching to Hugo.

I have a 7,000 word blog post on how and why I switched which I didn't publish yet because I wanted to wait 6+ months with Hugo to make sure I ironed out all of the kinks. I guess I'm the anti-case for this one! Maybe I should post this one next week. It's been quite stable.

ChadMoran

This reminds me of people who will make an entire YouTube series on crafting the perfect Notion architecture. Only to not actually use it.

mmsimanga

I am in a worse group. Changed my blogging platform, wrote the obligatory post detailing why I changed platform and couldn't even get that obligatory post out. I hang my head

BeetleB

A bit unfair to the OP, given that he actually does write posts on his blog.

Lord_Zero

Unfair in general. Building and hosting a blog is a cool learning experience and worth blogging about to remember and teach others.

barrenko

It's our Hello World of sorts.

netsharc

I remember someone presenting a development framework and saying something similar to this, "Of course, I used it to build a blogging platform..."

wolfgang42

I’ve been through a couple of different tools for my personal blog, and, having seen this trap, every time I did the migration I made sure to write a blog post about something completely unrelated instead. A few years ago I built my own static site generator and I vowed that I would never try to publish it for other people to use, another trap[1] that often springs on enthusiastic developer-blogger types.

[1] https://news.ycombinator.com/item?id=21616774

ingav

Haha, been there. But this setup’s actually working really well for me. It’s not chasing the "hot new thing," it’s going back to stuff that’s proven and solid.

devsda

Haha. I guess discovering & teaching how to do X is more rewarding than doing X. It applies to blogging, PKM and productivity too.

Is there a name for this phenomenon where this actually turns out to be true? Closest I can think of is "During a gold rush, sell shovels".

Vingdoloras

Cool setup, but the choice of Obsidian is kind of weird in this context (in an interesting way, see next paragraph). Instead of opening a subfolder of the Hugo project in Obsidian, one could just open the entire thing in VSCode or a similar IDE, enjoy a good markdown editing experience, AND use git integration and the integrated terminal (and possibly set up automated tasks) to run your local testing and deployment workflows.

Note that Obsidian's markdown editing experience is _different_ from (but not necessarily better or worse than) what you'd get in a typical IDE. So while the choice seems weird to me, it absolutely makes sense if the author prefers the feature set that Obsidian offers. Being supported by so many different editors is one of markdown's strengths, after all, and this kind of editor-portability fits right in with the other parts of "Fully Owned" from the blog post.

anon7000

I mean, Obsidian is just a markdown editor. You could keep an identical publishing setup and use any text editor on the planet :P

But I honestly despise writing raw markdown in an IDE. If I'm writing (not coding), I need it to be somewhat visual, which means I want WYSIWYG -- and Obsidian is an excellent markdown editor, even if you don't use the other features.

My reasons for not liking writing "raw" markdown:

- Long links take up too much space. I put it in text so it'd be hidden

- No syntax highlighting in code blocks

- Text wrapping/font is typically not configured for easy reading of text

- A ton of markdown features are for visual formatting. Highlighting, bold, underline, strike-through, inline code, etc. If you stay in raw IDE no-preview, you never get the visual benefits.

- When I'm using markdown, I'm often mostly reading, and doing some writing, but even when I'm writing, I'm re-reading what I wrote constantly. It's annoying to switch to preview mode. Writing mode in IDEs isn't a pleasant reading experience unless you do a lot of configuration. (depending on the IDE of course)

I mean, writing raw md is fine for tiny little things. But because reading & writing are so linked, I don't like separate modes for each. I want to write in the visual mode I read in.

mrbombastic

I find it annoying that I can get stuck in a mode when I am editing and the app is trying to render at the same time (e.g. I write some backticks to make a code block and Obsidian tries to be smart and add the second set and it encapsulates a bunch of lines I don't want it to) but to each their own I suppose. Vscode for what its worth has a preview that you can keep open side by side to see the visuals as you edit.

nottorp

> If I'm writing (not coding), I need it to be somewhat visual, which means I want WYSIWYG

<cough> You didn't grow up with WordPerfect 5.1 for DOS with reveal codes on, did you? :)

klank

Holy cow! 10 year old me learned word processing first with wordperfect. I looked for reveal codes in other processors for years after that and was always disappointed when I couldn't find it.

Young me was like "how can you edit a document if you can't see the codes?!" Still to this day I wish I had it in word processors.

fallinditch

Another benefit of using an IDE like VSCode for writing and publishing your blog is you can use the copilot AI to fill in the front matter details for you, easily add a table of contents, or add a cohesive structure of subsections. Don't forget the shift + CMD + v command to see see a preview within VSCode.

Hugo is a great choice for an SSG, I find it logical and intuitive. As for extending it with a CMS front end, I looked at Decapcms.org - formerly Netlify CMS - it gives you the WYSIWYG editor and you can hook it up to an asset management platform like Cloudinary for images.

BTW just checked Cloudinary pricing - generous free tier looks like plenty for most blogs.

rcarmo

This is what I do, mostly. I try not to rely on Obsidian for anything but drafts (just because it’s convenient and less distracting than VS Code).

vunderba

I have a very similar setup, but I went a step further by writing a custom Obsidian plugin that handles compressing assets / transforming frontmatter / pushing the bundle up to my Github blog repo.

Github has an automated action that then uses Pelican (a python based static site generator) to convert to HTML and deploys it to my VPS where it is served by Caddy.

Makes it very easy to have a WYSIWYG interface, the blog pages look basically identical to Obsidian.

https://mordenstar.com/blog/obsidian-to-pelican-exporter

Pelican static site generator:

https://github.com/getpelican/pelican

BeetleB

Upvote for Pelican. I never understood why so many people don't consider it and jump straight to Jekyll/Hugo.

lylejantzi3rd

Nice! I especially like the automatic compression of assets. It's such a pain to do it manually that I don't bother most of the time. I cross my fingers and hope the reader has a fast internet connection.

vunderba

Haha yeah I get that. I probably get the most savings from the animation compressor which checks if GIFs are over a certain threshold (> 1mb) and then seamlessly converts to autoplaying muted MP4 files which function nearly identically.

I really wanted to use animated WebP but the iOS decoding is SUPER unreliable often resulting in choppy inconsistent framerates.

One thing I don't do but I know is more common is using <Picture> elements to serve scaled assets depending on if the user is coming from mobile vs desktop.

Depending on what you use for your blog, you might look and see if the SSG has plugins for media optimization. By the time I figured that out, I had already handrolled my own. :p

ValtteriL

VSCode has been good enough for markdown blogging for me. Hugo compiles pages on save so its quick to iterate. The markdown preview plugin brings same experience to misc markdown editing.

No new editors to learn and one gets instant access to copilot etc.

_verandaguy

Why would you need copilot for blogging? Isn't the whole appeal of a blog that it's something you, a human created?

wolfgang42

Personally, I’m a lot better at recognizing good writing than producing it, and LLMs are great at being a “calculator for words.”[1] Writing posts became a lot easier once I got an automated editor I could tell to “break up this run-on sentence to make it less confusing” or “rearrange these paragraphs so I introduce concepts before I start using them”. The end result is still the same, but this way I save a lot of time I used to spend glaring at Roget, Strunk, and White.

[1] https://simonwillison.net/2023/Apr/2/calculator-for-words/#c...

x187463

Copilot is helpful for handing formatting and repetitive structural stuff. It doesn't need to actually create the content to be useful.

angristan

I found it very useful for proofreading. It's easier than copying/pasting the content into ChatGPT or similar, as it's right in the editor. I disabled the autocomplete though, as I found it breaks my flow of thoughts

(Wrote about this: https://stanislas.blog/2025/02/writing-workflow-llm/)

ingav

I just like keeping all my writing in one place, separate from coding. Obsidian gives me that focused space, and I’ve set it up with a nice font and minimal theme that fits how I like to write.

jagged-chisel

> … and no risk of platforms disappearing or changing policies.

Those risks still exist. GitHub and Cloudflare can do these things at any moment.

connicpu

I think the point was more about mitigating the risk of being locked in to a platform with bespoke authoring tools. GitHub and Cloudflare are very convenient with their generous free services, but if you had to a hugo blog could still be hosted on any web server in the world.

nuker

> GitHub and Cloudflare can do these things at any moment

I hosted mine in AWS S3 with CloudFront for Https and custom domain. Using Hugo too. I wrote Cloudformation template for whole setup [0], just create the CFN stack using template in AWS. Then copy public html to S3 using "aws s3 sync" and done!

[0] https://github.com/neutor/bite-sized-aws/blob/main/static-s3...

Brajeshwar

Strikingly similar to mine, except Jekyll instead of Hugo. I don't even build it locally these days. So, Obsidian > Github > Cloudflare.

Jekyll is slow for large content (my blog is huge), Hugo is fast. But I want to stay as mobile and lean as possible. I've tried and with a few changes in the template, I can move from Jekyll to Hugo in a weekend. I've also tried to stay as decoupled as possible from any templating engine (Jekyll), and hence rely mostly on pure HTML + CSS, while Jekyll is used more as the task runner. All the posts are separated by "YYYY" as folders and none of the posts have frontmatter.

I can also move between Github Pages, CloudFlare Pages, Netlify, or Vercel within hours if not minutes by just pointing the DNS to the ones that I want. I did this when Github Pages went down quite a few times about 3 years ago.

I almost went Markdown > Pandoc + Make but not worth it right now.

hk1337

I've started recently working on setting up the "special" public profile repository in GitHub to be my blog central and wanted to keep the files to a minimum. So, I really like using themes as modules in Hugo, then your blog repository will be just your content directory, go.mod, go.sum, hugo.toml, and any layouts you want to override or add.

    .
    ├── .devcontainer
    │   └── devcontainer.json
    ├── content
    │   └── posts
    │       ├── 1718983133-post-1.md
    │       ├── 1720321560-post-2.md
    │       └── 1740070985-post-3.md
    ├── go.mod
    ├── go.sum
    ├── hugo.toml
    └── README.md
3 directories, 8 files

ashishb

> So, I really like using themes as modules in Hugo, then your blog repository will be just your content directory

`themes` are small in size, why not copy them into your repository to keep the build hermetic?

sureglymop

Just out of curiosity, what would the Hugo toml file look like and do you use multiple themes?

hk1337

I found this as a source. Just like most Hugo.toml with the added module.imports and you have to use the full import name, not just the theme name.

https://discourse.gohugo.io/t/how-to-add-a-theme-using-modul...

I don’t have any but I’ve been swapping out to see which I like better and trying to make my own too.

tiffanyh

Or just use Obsidian Publish (and eliminate Huge, Github and Cloudflare)

https://obsidian.md/publish

bryanhogan

Very nice post!

I do almost the same, but instead I use Astro.

I use Obsidian, with a GitHub submodule for the content, and host it all as a static page. I wrote about that here if anyone is interested: https://bryanhogan.com/blog/obsidian-astro-submodule

J_Shelby_J

Same. I even built this for my GF to use. You don’t even need to download vscode as you can run it in a free dev container in browser: https://github.com/easy-astro-blog-creator/easy-astro-blog-c...

The only thing I want is to implement a gui for adding and editing posts.

bryanhogan

What you built is actually so great! Was also thinking of building something that makes blogging for less technical people easy without the downsides of a walled system.

Haven't heard of dev containers like that before, but cool to see that they can be used like that.

caboteria

I'm curious about the pros and cons of Cloudflare pages versus GitHub pages. Given that you're using GH as a repo, would it be simpler to also use it to serve pages?

seanwilson

https://docs.github.com/en/pages/getting-started-with-github...

> GitHub Pages is not intended for or allowed to be used as a free web-hosting service to run your online business, e-commerce site, or any other website that is primarily directed at either facilitating commercial transactions or providing commercial software as a service (SaaS).

Not finding a similar mention for Cloudflare... commercial sites are fine there?

semi-extrinsic

The way I understand this is not that Github Pages can't be used for commercial purposes, but that it's not OK for something like ecommerce with many users every minute which generates a lot of load?

So a small company could host a static landing page with generic info and "contact us" etc., and that would be fine, I think?

It also mentions that breaking the rules will result in getting a "polite email suggesting ways to reduce load on Github".

flanbiscuit

So a personal website with a personal blog is ok then.

Curious though how it handles a surge in requests, like from being on the front-page of HN. But many open source projects host their doc pages with Github pages and some of those get a lot of traffic so I'm sure that it's not an issue

simonw

GitHub Pages runs everything through a Fastly CDN. You can tell like this:

  curl -i https://simonw.github.io/
I get this:

  HTTP/2 200 
  server: GitHub.com
  content-type: text/html; charset=utf-8
  permissions-policy: interest-cohort=()
  last-modified: Wed, 16 Nov 2022 21:38:29 GMT
  access-control-allow-origin: *
  etag: "63755855-299"
  expires: Wed, 23 Apr 2025 18:20:50 GMT
  cache-control: max-age=600
  x-proxy-cache: MISS
  x-github-request-id: 3D02:22250F:11BEDCA:123BE7A:68092D2A
  accept-ranges: bytes
  age: 0
  date: Wed, 23 Apr 2025 18:10:50 GMT
  via: 1.1 varnish
  x-served-by: cache-pao-kpao1770029-PAO
  x-cache: MISS
  x-cache-hits: 0
  x-timer: S1745431851.518299,VS0,VE110
  vary: Accept-Encoding
  x-fastly-request-id: 0df3187f050552dfde088fae8a6a83e0dde187f5
  content-length: 665
The x-fastly-request-id is the giveaway.

jerf

The "front page of HN" has not scaled like the rest of the computing hardware has scaled. The smallest VM you can get serving static content will yawn at the full power of an HN surge. Unless you have a very 200x-era bandwidth limit, or you're trying to be on the front page of HN with a 250MB web page (which does happen), it's not anything to be concerned about anymore.

ingav

I already have several other projects and DNS managed in Cloudflare, so it made sense to keep everything in one place. GitHub Pages would definitely work too.

igravious

Where in the process do you integrate your custom domain (ingau.me) ???

ingav

I connect the custom domain in the Cloudflare Pages dashboard. Once the site is deployed, you can assign a domain under Pages > Custom Domains, and since I already manage DNS in Cloudflare, it's just a couple of clicks to route it.

_joel

If you're using cloudflare already then it makes sense, closer to the edge and all that, plus there's integration to make that all very seamless from gh.

tjoff

Zero cost is an antifeature.

It is just centralizing the web. You can do a lot with a $4 droplet if a single board computer isn't your cup of tea. Not "buying" into icloud/cloudfare is alone worth that cost. Also much more meaningful stack to learn.

Nothing against the post/author, I just feel the creativity to "exploit" features of the giants that is put in place just to undermine alternatives is misplaced.