HyperTemplates

Designing a static-site generator for iPhone

What if posting to your website was as easy as sending a text message or posting on social media? That's the question that got us started down the path that ultimately became HyperTexting.1 Today we want to share a sneak peak at the HyperTexting publishing experience and take a closer look at what it means to design a static site generator for iPhone.

Our mission with HyperTemplates and HyperTexting is to
make it easy to @makehypertext.com.

Here's what it looks like to post content to your website using HyperTexting:

The initial implementation of the HyperTexting composer is based on the HyperTexting CMS, powered by HyperTemplates.2 We have effectively bundled the core templating engine and CMS into two complementary packages: a CLI developer tool and a native app.

Download_on_the_App_Store_Badge_US-UK_RGB_blk_4SVG_092917

Architecture

The HyperTexting CMS – including HyperTemplates and the hyperctl CLI – is written in Go. It supports reproducible builds, and it can deploy directly to git and S3 hosting providers. It's also lightning fast, with build times around 1ms per page on Apple Silicon Macs (including my 5-year old M1 MacBook Pro). The HyperTexting CMS engine is packaged as a cross-compiled Binary XCFramework for iOS and MacOS called libhypertexting. We then wrap that XCFramework in Swift package called HyperTextingKit. Outside of HyperTextingKit, the HyperTexting iOS app has very few dependencies - most of which we intend to replace with new features in the HyperTexting libraries themselves for improved parity across the native app and CLI. This architecture was inspired by Tailscale, and more recently, Ghostty.

Static site generator

Our mission with HyperTemplates and HyperTexting is to make it easy to @makehypertext.com. But making things easy means different things to different types of users. For some users that means avoiding unecessary technical details, which heavily influenced the design of the composer (as shown in the first demo video, above).

For very technical users, making something "easy" requires providing direct access to information about how the system is performing. That's why we have started to expose some core SSG functions in the HyperTexting app. For example, if you have a HyperTexting profile setup for a HyperTexting website, you can access a "Builds" menu from the CMS settings view and perform a full-site build, complete with build logs and a shortcut to open the build output in the Files app.

Build times are not quite as fast on an iPhone 16 vs a MacBook Pro, but they are still respectable! In this example I performed a full-site build of my personal website with 86 pages + 42 asset files + 15 feed files in 379ms. That is under 3ms per file written. ⚡️

Development workflows

Since builds generated by HyperTexting are just static websites, and they are accessible on the iPhone file system, you can also do normal website things with them. For example, you can install an HTTP server (e.g. the excellent World Wide Web app by the folks at Icon Factory) and preview your website running locally on your iPhone!

Incremental Builds

Oh and there's one more thing. One of the reasons I build my own #SSG for HyperTexting is because I wanted to be able to generate "incremental builds". In other words, only generate the files needed for a new post. In order to make posting on your website as fast as posting on social media, we need to do as little work as possible over potentially slow mobile networks. For an "unlisted" page that doesn't appear in any RSS feed, that could be as little as a uploading a single HTML file. For a post that appears in one or more RSS feeds and the home page, the #SSG should be able to figure that out (as shown in the next demo).

Here's the build & deployment HT performed for the first video in this thread.

I hope you've enjoyed this sneak peak at the static site generator implementation in HyperTexting. Please visit the HyperTexting CMS documentation and join the @hypertexting.community 💬 to learn more.

✌️

Download_on_the_App_Store_Badge_US-UK_RGB_blk_4SVG_092917

  1. Is HyperTexting the worlds first static site generator for iPhone? We've been reluctant to make this claim even after years of exploring the most obscure corners of the App Store in search of prior art in this space. There are dozens hundreds (thousands?) of apps that enable you to post content to a website in some form or another; especially if you consider that @youtube.com, @instagram.com, @linkedin.com, @threads.com, and @x.com are websites. But all of the examples we've found to date rely on backend services to handle the actual building/processing and publishing/deployment of new content. And if when the backend service goes down, you can no longer post to your website. With HyperTexting we've taken care to embed that backend directly into the app, so when you post new content, the resulting HTML is generated on device and then published directly to one of dozens of supported hosting services↩︎

  2. Support for posting to Wordpress, Ghost, MicroPub (including Micro.blog), and Hugo websites is coming soon. ↩︎

The Newsletter

Get this and other posts delivered to your inbox. No more than one email per week, no fewer than one email per month.