Journaling on iOS With Shortcuts
Draft 3 minutes readI want to keep a journal, I have two requirements:
- The data must be stored as plain text and pain images on disk.
- The entries must have date, time, location and ideally weather information.
- I want to be able to pick an image, and create a journal entry from it. The entry should use the image’s metadata.
I first started journaling with Day1, but then it got sold, and I have lost faith in its future. Since they use some proprietary database with limited export options, I’m trying to avoid it.
Apple’s Journal looks interesting, but it does not satisfy my conditions 1 and 3.
I looked into self-hosted options:
- Journiv1 — terrible frontend, database instead of markdown, asinine features like “reflect now” that can not be turned off.
- Obsidian — would be great but does not support 3 and on iOS doesn’t nicely sync outside of their paid sync service.
Diar - iOS shortcuts for authoring journal entries
Squinting at what I wanted I realized that I could probably cook something up. What I need is a Hugo2 blog with a login and different syntax + some goodies, and a couple of iOS shortcuts.
First, I’ve decided on the syntax of my entries:
In a file named 2006-01-02T150405.md:
This is an entry inside my journal, as you can observe it just starts as a plain text.
You can use markdown here, but for a journal you should be good with a blockquote here and there.
---
/images/a-nice-illustration.jpg
#rhea #journaling
Home, France
@48.8687162,2.2219584
17°C, Cloudy
All of the footer entries are optional.
Then it was easy to create two shortcuts in iOS to:
- Grab the current location, weather and address and write a new note with current timestamp as filename with this information. Then open the file immediately with iA Writer.
- Receive an image, use it’s exif to get the time and location. If the date is today, grab the weather. Copy the image into the desired location, create the note and open it in iA Writer.
The advantage of handling images this way is that iA Writer supports displaying them in preview mode.
Rhea - Go server to render the journal in a nice way
Since I knew Hugo was almost what I wanted, I decided to learn Go language to write my server.
My design goes roughly this way:
- Fully server-rendered html page.
- No static rendering, live-running server only.
- Single user, take credentials as parameters.
The program should do the following.
- On startup look into the directory that contains the entries.
- Iterate over the entries.
- If the entry contains an image, generate a thumbnail for it if it hasn’t been done and store it in a cache directory.
- If the entry contains a location, use MapBox to fetch the map, and store it.
- Start watching the entries directory and update the in-memory representation if anything is added or changed.
- Start a webserver that serves:
/- At root show list of all entries, show the location map if the location changed from previous entry by more than 50km. Show images as thumbnails./entries/ID- Show a detailed entry with full size images and a more detailed location map./images,/thumbails,/tiles- Just serve the images./login- Render this page if there is no valid session cookie set.
And that’s about it. Cook this with some nice templates and a bit of CSS and we have a journaling app.
If you would like the source code feel free to ask, I am no longer publishing my repositories publicly.
-
https://www.journiv.com/ - looked promising but the setup is too cumbersome. ↩︎
- ↩︎