Notes

November 20, 2024 at 4:54 PM

Upload.shortcut

This site is powered by Apple Notes.


After trying various blogging platforms, Notion, Obsidian Publish, writing HTML and publishing it to a VPS, JavaScript edge scripts, etc., I found Apple Notes to be the easiest way to maintain a website. It lacks most of the fancy features of the other tools but makes up for it with its simplicity. I spent an incredible amount of time (~2 weeks) trying to get the workflow to be as seamless as possible so that I never have to think about it again. Shortcuts made that process both super easy and incredibly frustrating. However, I feel I’ve finally achieved my perfect system (almost… I’ll get to that later). If you’re not a technical person but you still want to use this or you are a technical person and just don’t care, skip to the section entitled How can I use it?


How does it work?

Shortcuts seemed like the obvious choice because it has access to so much of the device and its facets. I knew that I could probably work my way around the fact that Apple Notes are notoriously hard to export. After testing quite a few methods, I figured out that I could absolutely do that. It’s a bit of a roundabout method but it works; first, I grab the text passed into the Shortcut via Share Sheet and split it by new lines to get the first item - the title. I then use the find notes action to grab notes by title (as well as an additional filter for the tag public to ensure I’m grabbing the right one) and then get the actual Note item back from it. From there, I remove the summary (the second line which includes the public tag and the slug) and parse the body into HTML. The provided HTML parser sucks, so I extract the styles and body from the output using regex. I then put that into my own template, and encode it. If there are any images, I loop through them and encode them as well. Everything gets sent to the GitHub API to be turned into a blob and committed as a tree; GitHub Pages does the rest. That’s it!


How can I use it?

You need three things: a GitHub account, repository, and access token. Here’s how you can do each of these:

  1. Creating an account on GitHub
  2. Creating a new repository
  3. Creating a GitHub Pages site
  4. Creating a personal access token


After you’ve done all of the above, you can import the Shortcut. Add it here:


Upload.shortcut


When you import it, it’ll ask you to fill in your GitHub username, repository name, and access token. Then all you have to do is write a note and hit the Share button. It’ll show up below the normal things such as “Copy” or “Print” - hit “Upload” and it’ll do all the work for you!


What works?


What doesn’t work?


Roadmap