The Idea
Imagine you have a value that appears on every page of your website. The site name. The URL. A description used in search results. Now imagine that value needs to change.
You could search through every file and update each one. Or you could put the value in one place and let the build handle the rest.
How Tokens Work
In our source files, you will see things like {{SITE_NAME}} and {{SITE_URL}}. These are tokens. They are placeholders that the build script will replace with real values.
The real values live in a file called config.json. It is a simple list of names and their values. SITE_NAME is "Light School". SITE_URL is our web address. SITE_DESCRIPTION is the text that shows up in search results.
What Happens During the Build
The build script reads config.json first. It loads every name and value pair into memory. Then, as it processes each HTML file, it scans for the double-curly-brace pattern. Every time it finds one, it swaps in the real value from the config.
By the time the file is written to the output folder, every token is gone. Only real values remain. A visitor to the site would never know tokens were used.
Why One Config File Matters
If we ever changed the site name, we would edit one line in config.json and rebuild. Every page would update. Every meta tag, every title, every footer reference. One change, applied everywhere.
Without tokens, that same change would mean opening every HTML file and hunting for the old name. Some files might get missed. Some might have typos in the replacement. Tokens remove that risk.
A Pattern You See Everywhere
Token replacement is one of the oldest ideas in software. Mail merge does it with letters. Template engines do it with web pages. Environment variables do it with server settings. The concept is always the same: define a value once, use it in many places.
Our version is about as simple as it gets. Read the config, find the tokens, swap them out. No special syntax beyond the curly braces. No logic or conditions. Just plain substitution, and it is enough.