Hello from a blog that answers back

What changes when every post can summarize itself, translate itself and answer questions, with no server behind the site.

1 min readmetaai

This blog is the demo site for Astro AI Starter. It looks like a normal static blog, and it is one: Markdown in, HTML out, hosted on GitHub Pages. The difference is a row of buttons at the top of every post.

What the buttons do

TL;DR writes a three-sentence summary of the post you are reading. Translate rewrites the post in place in the language you pick, keeping headings and code where they were. Ask the author opens a small box where you can ask a question; the answer is written in my voice, from this post only, and says so when the post does not cover it.

Under the post, Read next picks three other posts that follow on from this one and tells you why. Select any sentence and an Explain button appears. Every code block gets an Explain this code button.

How it works without a server

Each feature is a call to onetag.ask(prompt, input) from the browser. The page sends the post text and a prompt to OneTag AI with a public key, and streams the answer back. The key can only spend this site’s free allowance (1,000,000 tokens), so it is safe to ship in the HTML, like an analytics ID.

<script src="https://onetagai.com/v1.js" data-key="YOUR_ONETAG_KEY"></script>
<script>
  const text = await onetag.ask("Summarize in three sentences", document.querySelector("article"));
</script>

The script loads only the first time you press a button, so the page stays as fast as any other Astro site.

Without a key

Clone the starter and deploy it with no key, and you get a normal blog. The buttons show, and they tell the reader the site owner has not set up AI yet. Add a key and they start working. Nothing else changes.

Read next

Three posts that follow on from this one, picked from the whole blog with a reason each.