A guide to follow once, from top to bottom, the first time you use Gratilaus Site.
For the commands and how to fix common errors, see QUICK_REFERENCE.md.
Every setting is described in README.md.
0. What you need
Python 3.10 or later. To check, run python3 --version in a terminal (py --version on Windows).
A terminal: Terminal on macOS, Command Prompt on Windows.
Node.js, only for the site search. Steps 1 to 8 work without it.
Steps 1 to 8 run on your own computer and cost nothing. What publishing costs depends on where you publish (step 9).
Paste the commands one line at a time and press Enter.
Where macOS and Windows differ, both are shown.
1. Go into the folder
Unzip the download and go into its folder in the terminal.
Change 1.0.0 to the version number in the zip's name.
cd ~/Downloads/gratilaus-site-1.0.0
You can also type cd and then drag the folder from Finder onto the terminal window.
2. Prepare (the first time only)
This installs the two packages the project uses (Jinja2 and PyYAML) inside this folder only.
In PowerShell, use .venv\Scripts\Activate.ps1 for the second line.
What success looks like: the prompt starts with (.venv), and the last output says Successfully installed.
When you open a new terminal later, run only the cd from step 1 and the second line (activate) again.
3. Build the sample site and look at it
python3 scripts/build.py --no-pagefind
On Windows: py scripts\build.py --no-pagefind. --no-pagefind skips the search index, so Node.js is not needed.
What success looks like: the last line is ✓ done. The site is written to the output folder.
Then look at it in a browser.
python3 -m http.server -d output 8000
On Windows: py -m http.server -d output 8000.
When it says Serving HTTP on, open http://localhost:8000 in a browser.
To stop it, press Ctrl+C in the terminal.
After you change files in the steps below, stop it, run build.py, and start http.server again to see the change.
If you have looked at another site on the same number before, parts of that site may still show. Use another number then (for example 8001).
4. Choose the site's language
An English-only site: leave lang as it is. The files with .ja in their names are not used.
A Japanese-only site: in config/site.yaml, change lang: "en" to lang: "ja".
On a Japanese site, a file with .ja in its name, where there is one, comes first.
What config/site.ja.yaml sets wins over the same setting in config/site.yaml.
content/about/content.ja.html, where it exists, is used instead of content/about/content.html.
What meta.ja.yaml sets wins over the same setting in meta.yaml.
The rule: where a .ja file exists, edit that one.
Changes to the file without .ja do not show on a Japanese site.
A new page needs only the two files without .ja (step 6).
Both English and Japanese: one build makes one language. See "Languages" in README.md.
5. Change the site's name and address
Open config/site.yaml (on a Japanese site, config/site.ja.yaml) and change the following.
Setting
What it is
name
The site's name
short_name
A short name (used when the site is added to a phone's home screen)
tagline
The line under the name
description
The site's description in search results
copyright_holder
The name in the footer's copyright line
name under author
The author's name on articles
label in nav, footer_nav and sidebar_links
The text of the menus
Write the address you will publish at in base_url in config/site.yaml, whatever the language.
For example base_url: "https://www.example.org", with no / at the end.
The home page's title and description are in content/index/meta.yaml (on a Japanese site, meta.ja.yaml). Change them too.
Look for the sample name and the sample address (example.com) anywhere they are left (macOS and Linux).
What success looks like: nothing is printed. A file that is printed still has the sample name or address.
On a Japanese site, search for サンプルサイト instead of Example Site. On Windows, search for both words with your editor's "search in folder".
6. Add, change and remove pages
Each folder in content is one page. The folder's name becomes the address.
For example content/menu/ becomes /menu/.
To add a page, make a folder and put two files in it.
content/menu/meta.yaml:
page_type: page
title: "Menu"
description: "A short description of this page, for search results and shares."
content/menu/content.html holds the body only, in HTML. The title and the dates are added for you.
<p>Today's menu.</p>
A new page does not appear in the menus by itself.
Add a line to nav in config/site.yaml (on a Japanese site, config/site.ja.yaml).
- { label: "Menu", url: "/menu/" }
To add a news article: copy the sample folder content/hello-world and change the copy. That is the quickest way.
To remove a sample page: delete its folder. The check in step 8 finds the links to it that are left on other pages.
Privacy policy and contact:content/privacy-policy and content/contact are samples. Rewrite them for your site. The contact form needs a place to send to (see "Contact form" in README.md).
7. Replace the images
Overwrite each image with one of the same name and the same size.
File
Size
Where it is used
assets/img/logo.svg
Any
The logo at the top left
assets/img/ogp-default.png
1200×630
The picture when the page is shared on social media
static_root/favicon.ico
Any
The icon on the browser tab
The five PNG files in static_root/icons/
As in the file name
The icons on phones
The icons can wait. How to make them is in "PWA icons" in README.md.
8. Check the site
python3 scripts/check.py
On Windows: py scripts\check.py.
What success looks like: the last line is like ✓ all 24 checks passed. (the number depends on the settings).
A problem is listed by kind. In this example, the sample article was removed, but the home page still links to it.
Here, remove that link from the home page's body (content/index/content.html; on a Japanese site, content.ja.html).
Then run check.py again. How to fix common errors is in QUICK_REFERENCE.md.
9. Publish
Before publishing, make sure of these three.
base_url is your own address.
The sample names, pages and images are now yours (steps 5 to 7).
check.py passed (step 8).
About the search: a site built with --no-pagefind has no working search. Before publishing, do one of these.
Install Node.js and build with python3 scripts/build.py, without --no-pagefind.
Do without the search: in config/site.yaml, under features, change search: true to search: false.
Choose one of three places to publish.
A server or static host you already use: put the contents of the output folder at the top of your domain as they are. The server must answer an address like /about/ with about/index.html (most servers do).
A manual deployment (the way without Git) on AWS Amplify Hosting is one of these. How to make the .zip and set up the 404 page is in "Amplify Hosting (manual deployment)" in README.md.
GitHub Pages: put this folder in a GitHub repository, and set Settings → Pages → Source to "GitHub Actions". On every push to main, the included .github/workflows/pages.yml builds, checks and publishes the site.
It works for a site at https://<user name>.github.io/, or for a site with its own domain.
Finder hides the .github folder (Command+Shift+. shows it).
With this method, the language is the one in lang in config/site.yaml.
The other file there, ci.yml, runs this project's own tests on every push. Delete it if you do not want them.
Amazon S3 and CloudFront: the included scripts/deploy.sh needs the AWS CLI, and only uploads the files and clears the cache. It mirrors output with --delete, so files in the bucket that are not in output are removed. Set these up yourself first.
An S3 bucket, a CloudFront distribution, a certificate (an ACM certificate for CloudFront is created in us-east-1), and DNS.
A way to answer /about/ with about/index.html. CloudFront's "default root object" does not apply to subdirectories, so use, for example, the S3 static website endpoint.
When they are ready, copy the settings, fill them in, and first see only what would change.
In config/deploy.conf, set AWS_PROFILE, AWS_REGION, S3_BUCKET and CLOUDFRONT_DISTRIBUTION_ID.
When it looks right, run it again without --dry-run. On Windows: .\scripts\deploy.cmd --build --dry-run.
About the license: the footer's Built with Gratilaus by H.K. is a condition of the license. As long as you leave it, visible and readable (not hidden by your own CSS, and at 4.5:1 contrast or more if you change the colors), there is nothing to do. The conditions for removing it are in "License" in README.md.
A sheet to look things up in, from the second time on. The first time, start with QUICKSTART.md.
Every setting is described in README.md.
Commands
Run the commands in this folder, with (.venv) at the start of the prompt (step 2 of QUICKSTART.md).
On Windows, read python3 as py, / as \, and ./scripts/deploy.sh as .\scripts\deploy.cmd.
To do this
Run
Build the site
python3 scripts/build.py
Build without Node.js (no search; for looking at it locally)
python3 scripts/build.py --no-pagefind
Rebuild one page only
python3 scripts/build.py --page about
Build in a given language
python3 scripts/build.py --lang ja
Look at the built site (Ctrl+C stops it)
python3 -m http.server -d output 8000
Check the site
python3 scripts/check.py
Show every finding of the check, not only the first few
python3 scripts/check.py --all
Show what was checked, passed items included
python3 scripts/check.py --verbose
Before publishing, see only what would change (S3)
./scripts/deploy.sh --build --dry-run
Publish (S3)
./scripts/deploy.sh --build
Every command ends with exit code 0 when it succeeds. build.py and check.py end with 1 when the build stops or the check finds a problem, and with 2 when the command line is wrong (for check.py, also a --out directory that does not exist). deploy.sh and deploy.cmd end with 1 when they refuse to publish (the messages starting with !!), and otherwise with the exit code of the step that failed (build.py or the AWS CLI).
Which file to change
On a Japanese site, where a .ja file exists, edit that one (step 4 of QUICKSTART.md).
To change
File
The site's name, description and author
site in config/site.yaml (on a Japanese site, config/site.ja.yaml)
The address you publish at
site.base_url in config/site.yaml
The site's language
site.lang in config/site.yaml
The menus
nav, footer_nav and sidebar_links in config/site.yaml (on a Japanese site, config/site.ja.yaml)
The colors
theme.colors in config/site.yaml (light and dark pairs; their contrast is checked)
The fonts, the text column's width, spacing and corner rounding
theme.tokens in config/site.yaml ("Design tokens" in README.md)
The layout of the header, sidebar and search box
header_layout, sidebar, sidebar_position, search_position and quickbar in theme in config/site.yaml
A look the settings cannot give
Put your own CSS in assets/css/ and list it in theme.extra_css in config/site.yaml (do not edit main.css)
HTML in a fixed place (analytics, ads, a sources box…)
Create a file in layout/hooks/ (the places are listed in layout/hooks/README.md)
CSS or JavaScript for one page only
page_styles and page_scripts in that page's meta.yaml
The interface's fixed words ("Read more", say)
strings in config/site.yaml (do not edit config/locales/)
Turning features on and off, such as the search and the share buttons
features in config/site.yaml
The home page's title and body
content/index/
One page
content/<page>/meta.yaml and content.html
The logo and the social media picture
assets/img/logo.svg and assets/img/ogp-default.png
The icons
static_root/favicon.ico and static_root/icons/
Where the contact form sends to
mailform.endpoint in config/site.yaml
The settings for publishing to S3
config/deploy.conf (made by copying config/deploy.conf.example)
Your files and the product's files
To move to a new version, you replace the product's files with the new version's. If you edit a product file, you have to redo the edit at every new version, so change the look and the wording with the means in the table above.
Kind
Files
Yours (a new version does not replace them)
config/site.yaml, config/site.<lang>.yaml, config/env/, config/deploy.conf, content/, assets/img/, CSS you added to assets/css/, static_root/favicon.ico, static_root/icons/, files you added to static_root/, files you created in layout/hooks/, a config/locales/<lang>.yaml you added, scripts/content_filters.py, notes/
The product's (replaced when you move to a new version)
In scripts/, build.py, check.py, deploy.py, deploy.sh and deploy.cmd; the .j2 files in layout/ (not those in hooks/); page_templates/; assets/css/main.css and compat-legacy.css; assets/js/site.js and mailform.js; config/site.schema.json; config/locales/en.yaml and ja.yaml; the .j2 files in static_root/; requirements.txt and pyproject.toml; LICENSE and NOTICE; AGENTS.md and the documents such as the README; .github/
The steps are in "Upgrading to a new version" in README.md.
Working with an AI coding agent
AGENTS.md in this folder gives AI coding agents (Codex, GitHub Copilot, Cursor, Claude Code and others) the rules for this project: which files to change, the license's credit, and what to leave to you.
Claude Code (v2.1.277 or later) reads AGENTS.md on its own only when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in this folder or a folder above it. If you keep one, put the line @AGENTS.md at the top of your CLAUDE.md.
Gemini CLI reads GEMINI.md by default. Add "AGENTS.md" to context.fileName in its settings.json.
The smallest page
A page (content/<page>/meta.yaml):
page_type: page
title: "About this site"
description: "A short description of this page, for search results and shares."
A news article (content/<article>/meta.yaml):
page_type: article
title: "The site is open"
description: "A short description of this article, for search results and shares."
published: "2026-12-01T09:00:00+00:00"
section: "News"
category_id: news
section_url: "/category/news/"
tags: [News]
Write the body in HTML in content.html in the same folder. The title, the dates and the author are added for you.
Common errors and how to fix them
Look up an error by its first words.
Message
Cause
Fix
expected <block end>, but found '<block mapping start>'
The indentation (the spaces at the start of the lines) in the YAML does not line up
On the line shown, or the line before it, make the spaces at the start match the lines around it
found character '\t' that cannot start any token
There is a tab in the YAML
Replace the tab with spaces
mapping values are not allowed here
A value has a : in it
Put the value in "..."
expected <block end>, but found '<scalar>'
A " is not closed
Close the " on the line before the one shown
is not a date. Use YYYY-MM-DD ...
The date is written another way
Write it as "2026-12-01" or "2026-12-01T09:00:00+00:00"
a setting has a value it cannot take
A setting with a fixed set of values has another value
Choose one of the values after is not one of on the next line
navigation link(s) point at a page this build did not produce
A menu url leads to no page
Match the url on the next line to a folder in content
unknown page_type
page_type has a wrong value, and the page is not built
Use one of home, article, page, archive, error404
the search index was not built
Node.js is missing
To look at the site locally only, add --no-pagefind. To publish, install Node.js, or set search under features to false
broken internal link -> /…/
A link to a page that does not exist (check.py)
Fix that link in the body or the menu of the page shown on the next line
missing resource -> …
A page loads an image or file that does not exist (check.py)
Add the file, or fix the path
is written twice (first on line …)
A key appears twice in one YAML mapping (two title:, two features: blocks)
Keep one of the two lines shown
not saved as UTF-8
The file was saved in another encoding (such as Shift_JIS)
Save it as UTF-8 in your editor
mailform.endpoint must be an https:// URL
The contact form's endpoint is not an https:// URL
Write the URL Gratilaus Form printed (https://…/contact)
!! a page has a contact form with no endpoint
The sample contact page is still there and mailform.endpoint is not set (the deploy script)
Set mailform.endpoint, or delete content/contact and the menu items that point to it
!! no configuration file
There is no config/deploy.conf
Copy config/deploy.conf.example to config/deploy.conf and fill it in
!! S3_BUCKET is still the example value
The publishing settings are still the sample
Write your bucket's name in config/deploy.conf
!! site.launch_date is still "pending"
The launch date is not set yet
Set launch_date in config/site.yaml to the day you go live (for example "2026-12-01"), and build again
Mistakes that give no error: check them yourself
The build and the check both pass with these mistakes.
base_url is missing or in the wrong form: the addresses given to search engines and shares are broken. Start it with https://, and do not end it with /.
On a Japanese site, you edited a file without .ja: the change does not show. Edit the .ja file.
A meta.yaml has no title: the page's title becomes the site's name.
tags is not a list:tags: News, Demo is split into single letters. Write tags: [News, Demo].
A misspelled category_id: a page for another category appears.
A folder with no meta.yaml: it does not become a page.
The license's credit
You may use, modify and redistribute it, including for commercial use, on the same terms as Apache-2.0 (the patent grant too). However, on top of the Apache-2.0 terms, every page of the site you build must visibly show Built with Gratilaus by H.K. (H.K. a link to https://hidekazu-konishi.com/) (Section 4A).
By default this credit is in the footer. As long as you keep credit.enabled: true in config/site.yaml and leave the credit visible, there is nothing to do.
Visible means: on every page (error pages and redirect-only pages aside), on every screen size and color scheme, without a click or hover. Do not hide it with your CSS or scripts, do not make it smaller than the smallest other text in the same area, and keep a contrast of at least 4.5:1 against its background (mind this when you change the colors). The link has to take a visitor to https://hidekazu-konishi.com/.
The conditions for removing it or changing its words (rewording or translating; it may not suggest that the author endorses the site) are in "License" in README.md.
When you give a site or its files (including the built output) to someone else, include the license (LICENSE) and tell them about the credit condition (Section 4A).
Terms
Term
Meaning
Terminal
The window you type commands into: Terminal on macOS, Command Prompt on Windows
Virtual environment (venv, .venv)
A way to install packages inside this folder only, apart from your other Python work
YAML
How config/site.yaml and meta.yaml are written: name: value, one per line, with indentation for nesting
Build
Making the files to publish, in output/, from content/ and config/
base_url
The address the site is published at (like https://www.example.com), the base of the addresses given to search engines and shares
Pagefind
The site search. Its index is made with Node.js at build time
Static host
A place that serves the built files as they are (GitHub Pages, Amazon S3 with CloudFront, Amplify Hosting, and others)
OGP image
The picture shown when a page is shared on social media (assets/img/ogp-default.png)
Credit
The footer's Built with Gratilaus by H.K., a condition of the license
ライセンスについて: フッターの Built with Gratilaus by H.K. は、ライセンスの条件です。見える形のまま(自分の CSS で隠さず、色を変えるならコントラスト 4.5:1 以上で)残せば、何もしなくてかまいません。消したいときの条件は、README.ja.md の「ライセンス」にあります。