Magazine template. Spectrum
A magazine arranged by topic, with its own colour for each topic, a spectrum bar of every topic under the masthead, a row of each topic's newest posts on a band of its colour, and the same colour on the topic's posts and its page.
Free and open source, built into Khalid.
khalid init blog --template spectrum
The home page, a post and a phone.
What it shows.
Spectrum is a template for a magazine arranged by topic. Each topic gets its own colour. The front page gives every topic a row of its newest posts on a band of that colour, and the same colour follows the topic to its posts and its page.
What the front page shows
- Your magazine's name large, the
taglineunder it, and the spectrum bar: one coloured block per topic, each with its name, linking to that topic's row lower down. - Lead story: your newest post marked
featured: true, or your newest post, with a large picture, its topic, the title, its description and the writer. - Latest posts beside it on wide screens: the newest other posts with their dates.
latest_countsets how many. - One row per topic, up to six, each on a band of the topic's tint with a strong rule on top. The topic's newest post shows large with its description, and up to three more as rows with a small square picture. On a phone those rows are words only, so a phone loads one picture per topic. Each row ends with an "All in" link to the topic's page. The lead story is not repeated in its row, unless it is the topic's only post.
- The newsletter form and your call to action, when you set them.
With [[reader.home_sections]] in site.toml, those sections become the rows, in your order. Later pages of the front page show the posts as cards.
What a post shows
- A band across the page in the colour of the post's topic, with the topic, the title, the post's description, the writer and the date.
- The lead picture under the band, as wide as the page.
- The post in one column of about 37rem, which holds 60 to 75 characters a line, with a folded contents list for long posts.
- The tags, the share links and the author box.
- Related posts as cards, each with a rule in its own topic's colour.
Its options.
Set any of these under [template.options]. An option you leave out takes the default shown.
| Option | Default | What it changes |
|---|---|---|
tagline |
none | One line under the magazine's name on the front page. |
latest_count |
5 |
How many of the latest posts show beside the lead story, from 0 to 10. |
logo |
true |
The header shows your logo from [brand] logo in place of the site's name. |
breadcrumbs |
false |
Each page shows the trail of links from the home page to it. |
dek |
true |
A post shows its description under its title. |
updated_note |
false |
An updated post says why it was updated, from its updated_note. |
cards |
"image" |
The shape of the cards on shared pages such as search: image, text, row, compact or ranked. |
pagination |
"numbered" |
numbered links to each page near this one; pages shows only newer and older. |
related_count |
3 |
How many related posts show, from 3 to 10. |
contents |
"inline-folded" |
Where a long post's contents go: inline, inline-folded, side-end, side-start or none. |
header_search |
"button" |
What the header's search does on a served site: button, link or none. |
contents_numbers |
"none" |
How the contents are numbered: none, numbered or nested. |
share |
"end" |
Where a post shows its share links: none, top, end or both. |
share_networks |
["facebook", "whatsapp", "email"] |
The networks the share links go to, in order. |
newsletter |
"both" |
Where the newsletter form shows: none, post, home or both. |
cta_band |
"home" |
Where your call to action shows as a band: none, post, home or both. |
cta_button |
false |
The header shows your call to action as a button. |
topic_tabs |
false |
Tabs on the front page, one per topic, each with its four newest posts. Spectrum's rows show every topic already, so most sites leave this off. |
video_section |
false |
A row of the newest posts with a video. |
podcast_section |
false |
A row of the newest posts with a sound player. |
Deploy guides.
A free blog on Cloudflare
Build the blog as static pages and serve them on Cloudflare's free plan.
Running Khalid on a server
Run Khalid on your own server, beside your website or at its own address.
The full Spectrum guide
Sizes, spacing and every detail, in Khalid's docs.
Run your blog on Khalid.
Free and open source. One program, with SEO built in.