Show HN: Publish blog post with a simple Git push
github.com
github.com
One piece of feedback: that gif of the process needs to be recreated. It's far too quick and the erroneous key strokes and typing/deleting is really confusing. Recreate the gif, but make it slower and error free to clearly demonstrate the process.
---
[0]: https://hugotunius.se/2016/01/10/the-one-cent-blog.html
The approach in this post relies on maintaining infrastructure, keeping it up to date and patched which for me is a lot of extra work I'd rather not do. Using a standard VPS it's a lot more expensive too.
If my server had to rebuild after a git push of a new post, I'd have to install all of the tooling on the server. I just commit my post, then run npm deploy which rsyncs all the static assets to the server after building on the client. This also makes it so I can see everything on my client easily before deploying. If I was building a blog for someone else though, this would make sense, stupid client, smart server, commit from anywhere.
I built this in such a way I don't need to think about database backups, server side authentication, using dropbox to sync my unfinished articles.
This architecture offers me freedom to write on my phone (Termux) during commute or sitting in the office and keep track of changes using git and finally publishing the post by simply adding a record into metadata.json.
The build times wouldn't be instantaneous as it would need to regenerate all the pages, but Hugo is still really snappy for even a large site. You probably post less than users access anyway.
This would still check all your boxes:
No database
No server side auth
Non-public drafts (metadata)
Commit from anywhere
Bonus: Dumb serving (only prebuilt static pages)
Optional bonus: Shortcodes, themes, bells whistles
The site would be built on the server so it wouldn't be completely dumb like rsync-ing static pages to nginx or something, but that's the rub if you want to be able to use clients with only git as a dependency.
Yours is a good solution, I'm just throwing an idea out there for a pre-baked alternative. My original use case didn't call for mobile blogging (not a fan), I run my own gitolite server so auth is already in my camp and I have a multi-tooled build that I didn't want on the server. If something breaks, it happens on my machine instead of on my server.
Also just a tip, maybe you want to put a <noscript> tag around an expanded copy of your hamburger menu. Without javascript, your website navigation is broken because you can't expand the menu.
Edit: by client, I mean blog-editing-computer not blog-reader's-computer.
About the menu, I was planning to update it to hamburger icon with animations. For now the icon doesn't change and the menu is injected into adjacent/bottom element based on screen size.
Thanks your feedback though.
It would be nice if Hugo could remember if it touched a file or not. AFAICT it just copies everything over each time and changes the datestamp. Even with rsync this is a lot of useless work.
I've got a script which does a git pull every 5 minutes, with automatic hugo build. It works (Hugo doesn't crash that often) and is simple enough for me.
rsync -a ~/blog/ user@host:~/blog && \
ssh user@host 'cd ~/blog && git add --all . && git commit -m "udpate"'You can use it from any device (without aby app for CLI interface). You can use for example VersionPress[1] for backups to git. And I don't get what's the point of publishing without touching server, since you need to touch the server to view published post.
I think maintaining the LAMP Wordpress stack, extensions, admin panel auth security, whatever versionpress is etc. is more hassle than editing a text file and pushing code. To devs, this editing is second nature.
Also, I'd take my desktop editor to a contentEditable any day.
It uses github webhooks to alert server of any events related to the blogposts repo. The server verifies the events using HMAC authnication ( see github docs for more info) and then updates the local blogposts repo ( git pull)
Same for my CV[1], whenever I change it in gitlab it picks it up, compiles the latex to pdf and replaces the cv.pdf file.
1: https://github.com/rcarmo/sushy 2: https://github.com/rcarmo/yaki
I see that you use keybase.io, can you send me an invite if that's okay for you?