Apple checks a company's website when you sign up as an organization. So a real website was high on my list. Here is how I built this one.
The stack
- Next.js with the App Router.
- Cloudflare Workers to run it, with the OpenNext adapter.
- next-intl for languages.
- Tailwind CSS for styles.
I use the same stack for every website: this one, and the website for each app. One way of doing things means less to remember and less to break.
Three languages from day one
The site started in English, Traditional Chinese and Simplified Chinese. English has no prefix (/blog), the others do (/zh-Hant/blog). All text lives in one JSON file per language, never inside the components. Adding a language later is one new file.
Later I tested that promise and added Japanese and Korean. Each one was a new file, plus a rounded font to match the rest of the site.
No database, no CMS
Blog posts are just files in the code. To write a post, I add a file and deploy. For one person, this is simpler than any CMS, and there is nothing to hack or pay for.
Analytics with (almost) no code
I want to know which posts people read. The site uses Google Analytics 4 through Cloudflare's tag manager, Zaraz. GA4 is set up in the Cloudflare dashboard, not in my code, so I can change it without a new deploy.
Two surprises
1. Zaraz didn't show up. Zaraz is supposed to add its script to every page by itself. On my site it didn't. My pages come from a Worker, and the script was never added. The fix was one line in the page head: <script src="/cdn-cgi/zaraz/i.js">. Now it loads on every page.
2. The cookie window blocked the whole page. Visitors from the EU and the UK must say yes before analytics runs. Zaraz has its own consent window, but it covers the whole page, it doesn't match my design, and its language follows the browser, not the page. So I built a small banner at the bottom instead, in every language of the site. Zaraz still saves the choice. The site only asks the question, and "Reject" is as easy as "Accept".
Both problems only showed up on the live site. Lesson: read the docs, then test the real thing.
The cost
The Workers paid plan is $5 a month, and it covers all my sites. The domain was $1 for the first year.
Simple, cheap and fast. That's all a small company website needs.
Want the next post? Follow @allright_eric on X or subscribe to the RSS feed.