r/programming • • Oct 19 '26

This Website Is Now Made in Swift

https://sindresorhus.com/blog/swift-website
100 Upvotes

41 comments sorted by

View all comments

13

u/cheezballs Oct 19 '26

Why not just static html and css?

12

u/josephjnk Oct 19 '26

While the article never uses the words, it sounds like this is a static site generator, but written/embedded in Swift. The page only discusses serving html and css, says that the posts are written in markdown, and doesn’t talk about rendering on demand. The GitHub page also says that the app store data is fetched at build time and the static content is all deployed to cloudflare. So I think that post-build time it is indeed just static HTML and CSS.

9

u/chucker23n Oct 19 '26

While the article never uses the words, it sounds like this is a static site generator, but written/embedded in Swift.

I really wish they were clearer about this. Is it an SSG, i.e. precompiled, or does the site run Swift on request?

2

u/josephjnk Oct 19 '26

Agreed. I have wildly different opinions about the quality/appropriateness of this solution based on which one it is.

3

u/cheezballs Oct 19 '26

So this is "write static html and CSS" with extra steps? Why?

7

u/josephjnk Oct 19 '26

Did you read the post/have you maintained a blog? There’s plenty of reasons why people use static site generators. Ensuring that internal links have valid targets, reusing snippets, and being able to restructure the html of posts and pages in a cross-cutting way are all major improvements over editing inline HTML on every page every time you want to make a structural change to a site. This isn’t even getting into things like using plugins to preprocess code blocks for syntax highlighting. Doing that by hand sounds like a nightmare.

1

u/edwards_t7407 Oct 21 '26

If the deployed output is just files, the Swift toolchain only needs to be in the build environment; production can stay a plain CDN setup.