8 Shape the home page and the look
Readers decide in seconds whether a site is for them, mostly from its first screen and its look. In OINK neither takes a template: the home page is a YAML file listing sections from top to bottom, and the look is a preset plus a few settings. This chapter gives Acme DB a home page that says what it is and how to install it, then gives the site its own identity.
The home page is data
The Starter’s data/home/en.yaml holds three sections. Replace it with five
that tell Acme DB’s story: what it is, a few facts, where to start, the install
command, and a closing call to action:
To reorder the page, reorder sections; to hide one, write it as
{ type: metrics, enabled: false } and keep its data. Links to your own pages
are site paths without a leading slash, such as docs/operations/, because the
theme adds the language prefix: the same link reaches /zh/docs/operations/
from data/home/zh.yaml, which carries the same structure with Chinese text.
A misspelled section type warns with unknown section type and is skipped, so
read the build output when a section does not appear.
There are 22 section types, among them pricing tables, logo walls, FAQs, a
Markdown source beside its rendered result, and download cards fed from the
release data; Home and landing pages lists
them all. Any other page can use the same sections with layout: landing.
Name, logo and favicon
The name comes from hugo.yaml, which you set in Chapter 3. The mark beside it
is the Starter’s neutral assets/icons/logo.svg until you name your own:
Crop the SVG tightly and give it a viewBox, or it will not line up with the
text beside it, and choose colors that read on both light and dark
backgrounds. Favicons need no setting: put favicon.ico, favicon.svg and
apple-touch-icon.png in static/ and every page links them.
An accent color, per section
The accent color marks where the reader is: the selected sidebar row, the
outline’s current section, focus rings, card borders on hover. Set one for the
site, and give a section its own in a cascade so readers can tell the parts
apart:
This book does exactly that: its root page sets theme_color: '#9a3412', which
is why the selected chapter in the sidebar and the outline marker are orange
here and blue in the Docs. Prose links and inline code keep the preset’s colors
everywhere, so a reader recognizes a link the same way in every section.
A preset, and the reader’s choice
A preset is a complete look in light and dark: palette, fonts, link and table style. Choose the one closest to your brand before changing colors by hand:
| Preset | Look |
|---|---|
paper |
Warm paper, ink text, blue links and accent, Plex Sans and framed tables. The default |
slate |
A cool blue-gray technical look |
github |
GitHub README typography, colors, ruled tables and green buttons. Experimental |
ink |
Written page on warm paper, Palatino and Kai with Fangsong or Song text and vermilion marks. Experimental |
news |
Printed page on grey newsprint, heavy serif and Song headlines, spot blue and double rules. Experimental |
terminal |
Monospace throughout, teal links, amber accents, compact navigation; phosphor screen at night. Experimental |
preset is the site’s look; preset_menu lets readers pick another from the
Appearance menu, and dark_mode adds Light, Dark and System to it. A reader’s
choice is saved in their browser. Try it on this page: press
T to cycle the presets and Y to cycle light and
dark. The orange accent survives every combination, because theme_color wins
in every preset.
Fonts and your own CSS
The Latin typefaces ship with the theme and are served from your own site, so
no page calls a font service; Chinese uses fonts already on the reader’s
system. params.ui.typography: system switches every role to the platform’s
own fonts. For anything the settings cannot reach, write plain CSS in
assets/css/project.css, which loads after the theme’s stylesheet. This
recolors the warm secondary accent used in the footer and landing sections, in
both modes, because each preset sets its own dark value:
It is plain CSS, not SCSS, because Hugo publishes it without compiling. Prefer
a setting over a selector, and a selector over a copied template: an override in
layouts/ stops receiving the theme’s fixes. Brand and appearance
lists the font roles and palette variables you can rely on across releases.
Check your work
- The home page shows the hero, three metrics, three cards, the install command with a copy button, and the closing call to action, in both languages.
- The Quick start button leads to
/docs/get-started/quick-start/in English and/zh/docs/get-started/quick-start/in Chinese. - The blog uses the purple accent and the rest of the site teal.
- The Appearance menu offers six presets and three modes, and every combination stays readable.