Hacker News new | ask | show | jobs
by marban 1896 days ago
The real problem with any SSG is where to host and edit Markdown files and images for flexible spur of the moment content creation. I've built my own Wordpress-export-to-static solution to use the native iOS App as a workaround but it feels somewhat clunky — Same with having to run a headless CMS for this in the background; Surprisingly with all the gazillion of MD editors, no one has ever built one with live editing files in, say, S3 + allowing to upload assets. And no, I don't consider content composition in a terminal window to be an inspiring environment because I'm a sucker for aesthetic apps.

Addendum: Mobile is just an added bonus. Best solution for me would be iA Writer as an editor, native image upload to a bucket like S3 and Apple allowing me to tap into these iCloud hosted .md files via an API. Then use a simple script to put the pieces together and move the stuff to Netlify or wherever.

18 comments

I use GitHub actions for simple, text-only posts.

I set up an action that gets dispatched once an issue with the label "post" is opened. It then takes that, creates a markdown file with that content and creates a commit. The original issue is then closed.

For more convince, I also have an issue template called "Blog Post", which has already the label set etc. Then, you can bookmark/pin a link to the new issue on your phone's home screen.

I found myself using that instead of git, even if I have a fit client and the repository already cloned.

Currently, it does not support issues where the "post" label is added after issue creation (would be useful for drafts). But it would be entirely possible, as well as image/media/file support.

Hey this sounds like a really clever solution, actually, would love to look at it — do you have a link to the action, or have you not released it?
It is not available in public, since it's only a workflow in a private repository that uses four different actions in that order:

- actions/checkout

- A script that edits/changes a file based on the content of the opened issue

- stefanzweifel/git-auto-commit-action@v4

- peter-evans/close-issue@v1

One could make a fully-fledged action out of that. But for my case, this is sufficient.

I also tried a different way, which may also work for you: There are .devcontainers, which can be used for GitHub Code Spaces. It's basically a VSCode in the browser, including a terminal. You can specify which extensions have to be installed, like a spell checker or markdown formatter and use that VSCode in the browser to write posts.

I'm currently not using that because it doesn't work on mobile at all.

Just adding another option to the mix: https://blot.im. I've been using Blot for years. I write/edit in iA Writer on mobile and upload via the git option using Working Copy. You can use git or Dropbox with Blot.
This is my exact feeling. I have a Hugo-powered blog, but like you said, I miss the ability to draft something quickly when I'm inspired. Right now, the best option I have found is self-hosting Ghost with some aggressive Cloudflare caching.

I considered using wp2static[0] before starting with Ghost. Have you published your exporter?

[0] https://github.com/leonstafford/wp2static

Disclaimer: App Author

If your Hugo blog is stored in Git, you could try out GitJournal [0][1]. It's a mobile based Markdown editor integrated with Git. Many people seem to use it for managing their Hugo/Jekyll blogs.

[0] https://gitjournal.io

[1] https://github.com/GitJournal

This looks great! Is it possible to create templates or script workflows in this app?

For example, when publishing new blog entry in my Eleventy site, I have to create a new folder, then create a markdown file in that folder with some specific frontmatter. Can I have GitJournal do that all for me?

Kind of - There is an option to always add specific frontmatter when creating a new file. It's however in the pro version.

I'm yet to implement proper templating support.

Could you please vote on the issue? https://github.com/GitJournal/GitJournal/issues/20

I was in exactly this situation. I had a static site/blog thing on GitHub pages, but the process just wasn't conducive to spur of the moment writing. I nearly went back to WordPress but it's just far too bloated for my needs, so like you I ended up on Ghost. I went with Ghost because it was nice and streamlined, made writing quick and easy and wasn't too bloated. I still need to take some time to develop a super streamlined theme but it's good enough for now!
There's https://www.netlifycms.org/ it has drafts and you are not limited to Hugo with it.
For Windows users, DocxManager (https://docxmanager.com) the Word-document-based static site generator which supports S/FTP uploading (and S3 soon) will be expanded to be a tabbed markdown editor in the near future.

Yes, I'm the developer ;)

People will gladly use classes from tailwind such as mt-1 (margin top 0.25rem) but they will freak out when they see the MsoNormal class. Is there a way to make the styles of the exported site look less like a word export?

Don't get me wrong, amazing work anyway, I just wanted to give some constructive criticism.

@patates, Thanks for the feedback! Yes, I actually noticed the issue, and I do want to address the issue with an appropriate approach (but it still needs more thoughts). Of all the css frameworks tailwind is definitely the best fit as far as I see it, thanks to it's "utility first" concept.
Personally I write to myself on telegram, then take it from there once I'm on a computer. Doing detail editing on a phone is painful anyway.
This makes me think, a Telegram-bot-as-a-CMS would work great for micro blogging.
What is old is new again. This exact idea has floated for pretty much all messaging protocols that have had some kind of programmabilty already.

We can even imagine an email-based microblogging hack. Edit your boop (that's the new tweet) in your favorite MUA: the subject is the short text, the body is the long text. You can even put images and attachements in there. Send yourself this message, with a well-known prefix: it ends up in a specific IMAP folder. Have your third-party server that pulls messages from this folder and displays them in a "nice" view, so that anyone can browse and subscribe. To reply to boops, just reply to it in your MUA along with a copy for yourself and it will be present in your "Timeline" and in theirs. To address someone, send them a copy.

In a perfect world you could anonymously authenticate to anyone's IMAP server and read that "boops" folder, and even subscribe to it if you want. But I don't think any existing provider will ever implement something like that.

Email and RSS have all the fundamental building blocks for so many usecases already, but we keep reinventing the wheel again and again. The abstractions work. Imagine every company had to reinvent the whole TCP/IP stack every single time.

Great write-up. You're absolutely right, without having the protocols required to achieve this already in place, much of the web wouldn't exist today.

I think right now, we will all have to wait for the system that ends all present microblogging platforms. And with what we are seeing right now, this solution must be decentralised, censorship-free, and non-selective with who can participate, for the billions of internet users to even consider switching away from FB, Twitter, and the like.

Tumblr used to have this.
There is something already in place with the 'telegra.ph' site, which is connected with Telegram I believe:

https://telegra.ph

https://telegra.ph/api

Awesome! So 'telegra.ph' allows anyone to post a richly-formatted HTTPS site right from Telegram. Neat!

It should be fairly simple from here, to display contents of said HTTPS site on their own blog or website, so that they can write and edit their site directly from Telegram.

This is exactly what I imagined when I thought of Telegram-as-a-CMS. Thanks!

Something similar was posted on HN before [1], seems to be offline though. There’s an archived copy here: [2]

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

[2] https://web.archive.org/web/20180726143328/https://telepost....

Telepost (which I just found out about from you) would be too expensive an option for a microblogging usecase, in my opinion.

Nevertheless, it is proof that something like that could work, although it would require large infrastructure cost today. Thanks for the links!

I was also thinking of SMS to blog via Twilio — Used to do this in the late 90s from a Nokia Communicator
Here's a nice SMS to blog how-to/setup: https://writxt.fun
Great find, thanks for this!
I do this with email for to-dos ;)
I'd suggest you give Forestry (https://forestry.io) a try. It's a great CMS for static sites (incl. asset management) and it has a really nice preview system.
Tried since day one but it seems dead.
Dead how? I find forestry with integrated cloudinary for asset hosting a really decent solution.
I ended up picking hexo [0], as the hexo admin plugin [1] provides a nice localhost CMS/editor that supports image pasting, tag editing etc (could be hosted online too for remote/mobile access, but wouldn't be truly static/server-less at that point).

> but it feels somewhat clunky

Yeah, still feels like there should be _something_ better out there

[0] https://hexo.io/

[1] https://github.com/jaredly/hexo-admin

Do you still have a regular WordPress host though? Do you use WordPress.com?

I always wanted to do this but every solution requires some non-free PHP hosting alongside the static host. WordPress.com doesn’t let you customize it unless you pay and if you want to use it headlessly you have to build a non-WordPress template elsewhere.

I have a low-traffic low-edit WordPress site I want to staticize, but no solution is server-free.

Yes I use wp.com as a dumb backend with a somewhat blank template so SEs won't find it. Then pull all posts via the API, download images, etc. Render them via Jinja and upload them to Netlify.
Yeah that sounds reasonable. I don’t know if I’ll ever get around to rewriting the templates.

By the way you could just use the images served from WordPress.com I assume… unless the ToS don’t allow that.

wp.com does some hotlinking prevention IIRC so I just download them with Python. Plus, I like hosting assets on my own turf. Peace of mind...
https://www.getlektor.com/

lektor offers some of this functionality. editing is done locally through a browser UI, but there may be a way to host the interface. deployments are easy.

> The real problem with any SSG is where to host and edit Markdown files and images for flexible spur of the moment content creation.

I'm with you there. I have a shortcut to a Google Drive on my phone homescreen that I use as my notebook that's worked out for me. I also have a reMarkable that I've been writing a lot on, but retyping everything has been a point of friction (and my handwriting is apparently so bad that OCR is only ~70% accurate and it takes about as much time to fix as to just retype it

> where to host and edit Markdown files and images for flexible spur of the moment content creation

That, and somehow I don't like drafts to be on a public repo.

Nothing stopping you using a private repo. I use Netlify to host and have it automatically deploy when I merge to main, but my repo is private. I write my drafts in a branch and merge when I'm ready to publish.
Same here. I’ve tried both a self-hosted deployment solution and AWS Amplify. Both of them has used private repositories on Github. No SEO juice to Github, only to my domain :)
GitHub and GitLab has pretty decent browser based editors for basic markdown and image uploading. Certainly not as easy to use as Wordpress but they’ve been good enough when I really need to edit something and can’t get to my workstation with the clone and a decent editor.
I have a cronjob on my vps that pulls the repo every 20 minutes, and if there are changes builds and uploads the site. I don’t write on mobile but if I would, I’d use iA Writer + Working Copy
Doesn't solve the problem with assets.
Well, it does for me as I stuff the assets into the git repo too. Or is the issue with the previews? That's one thing I haven't been able to figure out. (currently I just run the dev server and look on the generated website, but the iA writer preview is image-less)
Good point. However, there is so much innovation in this space right now so I’m pretty sure that something like what you described will emerge.
The combination of Typora (https://typora.io/) for writing markdown + `mkdocs serve` or `hugo serve` is pretty neat. Set up a gitlab-ci.yml that builds and pushes the final site to your hosted destination, that's it.
Image upload in Typora is done via some random hosting service IIRC.
Typora is a markdown editor. Hosting is done in Github, Gitlab etc. Typora is not a hosting solution afaik.
Why can't you work on posts in another editor and export to your repo (copy-paste or whatever) posts when they are ready for publishing? Why does writing and publishing have to be in the same tool?

You can write in something like Bear, or anything else with iCloud support to have cross-device sync.

1. Just use Github to write. 2. Gatsby.js can sync with most CMSs.
Doesn't solve the problem with assets.
a couple years back, github added an 'upload' button when browsing your own repo from the web.
Have you tried Next.js?
I'm going to add my personal take on this issue since I'm currently running a blog that's markdown-ish powered.

In my opinion the best solution is to find some sort of happy medium. Static site generators are excellent in terms of weight and speed but a lightweight file based CMS can be almost as fast while still providing the needed flexibility.

My site currently runs on Kirby (https://getkirby.com) but I write almost everything on iA both on my Mac while I'm at home and on my phone while I'm outside.

Updating the site is not as simple as typing a command on a terminal but it's just a few clicks on a very simple and minimal UI.

Images are hosted on my server like the rest of the content. It's a simply DO snippet with no fancy configuration.

If you want to go down a more automated solution, iA comes with support for micropub so you could in theory set it up so that you can upload a new post without leaving the iA interface.

But imo it's a lot of extra backend setup that needs to be monitored to save very little time in the long run so for me it's personally not worth it.