Create a new site
The independent bilingual project site is a useful reference. Use this procedure to create a smaller site with its own content structure.
Create the site skeleton
Run:
Initialize the site module and pin Oink:
Add minimum configuration
Use this as hugo.yaml:
Commit go.mod and go.sum. Do not add npm mounts or a PostCSS pipeline.
Add bilingual content
Create these files:
Every page needs front matter. For example, content/docs/getting-started.md:
Its getting-started.zh.md translation keeps the explicit heading ID:
Using the same explicit ID in both examples is harmless and makes the intended cross-language contract visible. In a translated existing page, copy the ID from the English rendered HTML.
Preview and build
Run the development server:
Then verify the production build separately:
Check /docs/, /zh/docs/, the language selector, local search indexes, and
the browser console before adding custom layouts.
Add features incrementally
Copy logo and brand assets first, then add repository links and menus. Add diagrams, API documentation, and content components only on pages that need them; OINK will publish their local runtimes on demand.
If a site needs a business-specific shortcode, keep it under the site’s own
layouts/_shortcodes/. Move it into the theme only after its interface is free
of site assumptions and multiple sites can reuse it.
What’s next?
- Expand the basic configuration.
- Learn how to add content.
- Review the OINK architecture.
- Select a deployment target.