What I wanted when making it
I just needed to write text, and put pictures or videos on it. Nothing too fancy. Besides that, I would like to write it using markdown, even better if I could just write them on my favorite note taking/Zettelkasten/personal wiki editor Obsidian and just put them online directly.
Well, I found the perfect tool for that.
The thing that generates the website
It’s Quartz. There is a folder inside the installation called content
where you just need to dump your .md files and bada bing bada boom your files are now a website.
It’s still not out there though. Only you can access it (probably on http://localhost:8080
)
How to put it on the world wide web
There’s two ways I considered on how to do this. The first one was to open port 80 on my home router, however my ISP blocks port 80, so that doesn’t work. I could use another port for it but then it would be weird to tell people to go to mywebsite.com:8080 instead of just mywebsite.com. (There is a way to use a redirect on your DNS provider but it made the final url ugly (just numbers) so I didn’t use it)
But I had a VPS lying around so I thought, wait I can just put it there. And so I did, works like a charm. A simple nohup npx quartz build --serve --port 80 &
and the thing is online.
But isn’t moving the files into the VPS a pain?
No! Using the power of Syncthing, my reliable friend of many years, it is a breeze to coordinate everything. I can even write posts from my phone.
Here is the setup: I have a folder called The Archive
. This is my Obsidian vault that I use for literally everything. I use Syncthing to mirror it to all my personal devices. Inside it I have a folder called Blog
, where the folder contents
of quartz live. I use Syncthing to sync Blog
and contents
so any change I make to any note in the Blog
folder of my Obsidian vault is immediately sent to contents
in the VPS.
In the end this means that I can just treat my entire blog as just notes on my Obsidian vault.
What about the DNS?
For now I am using No-IP, it is a very useful free DNS service. One day I’ll actually buy a domain but the current limiting factor is choosing the name lol.
Update:
I bought a DNS as you can probably tell. I got it from porkbun, it’s a good and affordable company from what I’ve seen.
I also got the https thing sorted, but it took a few changes for it to work:
- I put it on nginx, so I’ve stopped using the scuffed
npx quartz build --serve
hack. - I added the TLS key files to nginx
- I’ve also added a redirect from http to https
- I set up a script that watches the files in
quartz/public/content
usinginotifywait
so after every change it builds the website again. - Set up a systemd service for the watcher script so it runs on boot
TODO:
Currently every time the website is built, it stops being served or imcomplete files are served for a second or two.
While its fine for now I want to change the build script to build the website in a different folder, then copy it to the
nginx folder. (idk if this will fix it but its probably an upgrade)