Solo is a Jekyll theme. It does single-page websites only, and it does them well. Yes, it’s responsive. This page is a pixel-for-pixel port of Solo to Eleventy — same layout, same fonts, same elements — plus one thing Solo never had: color themes.

Try the two controls in the upper right corner.

Solo is useful if…

This page runs on Solo. It comes from one markdown file.

What this port adds

The port leaves Solo’s layout, type and spacing alone. Everything below is new:

Usage

You need Node.js. Clone the repository, then:

npm install
npm start

Eleventy serves the site at http://localhost:8080 and rebuilds on save. npm run build writes the finished site to _site.

You edit src/index.md. It becomes the page.

Other Files

Don’t use <h1> tags

Skip <h1> tags in src/index.md. The site title owns that level.

Color themes

Two controls sit in the upper right. They work on separate axes, the same split yolo-11ty uses:

Every palette ships a light and a dark rendering, so the two controls compose. Pick Matrix Green, then toggle to dark, and you get Matrix Green’s dark variant. The browser keeps both choices in localStorage.

Solo’s own palette compiles into css/main.css. It paints before a line of JavaScript runs, in the exact colors of the original Jekyll theme. The other 67 live in src/_data/palettes.json, and a script applies them as CSS custom properties on <html>. Each palette is twelve colors per mode:

{
  "id": "matrix-green",
  "name": "Matrix Green",
  "light": {
    "bg": "#F0FFF4", "text": "#003B00", "heading": "#006400",
    "link": "#008000", "primary": "#00C853", "surface": "#ffffff",
    "border": "#A5D6A7", "shKeyword": "#008000", "shString": "#2E7D32",
    "shFunction": "#00C853", "shVariable": "#1B5E20", "shComment": "#81C784"
  },
  "dark": { "...": "..." }
}

expand() in src/_includes/theme-init.njk widens those twelve. It fills the ~50 custom properties the stylesheet uses, down to the whole Pygments/Rouge syntax palette. Add an entry to any group in palettes.json and it shows up in the menu. Delete one and it’s gone.

For a different default, set theme.default in src/_data/site.json to any palette id, and theme.mode to light, dark, or auto. Set theme.switcher to false and both controls disappear. The page then matches Solo byte for byte.

Markdown elements

Everything below is plain markdown, and the theme renders it. Treat it as a proving ground. Switch palettes while you scroll to see every element in every theme.

Headings

The site title owns <h1>, so headings on the page start at level 2. Level 2 has its own size. Levels 3 through 6 share a single style.

Heading level 4

Heading level 5
Heading level 6

Text

A plain paragraph, with emphasis, strong emphasis, both at once, strikethrough, inline code, and a link.

Typographic replacement is on, the way kramdown had it. “Double quotes” and ‘single quotes’ curl. An en dash – and an em dash — fill in. An ellipsis… collapses to one character.

Two trailing spaces end a line
and force a hard break, with no new paragraph.

A backslash escapes markdown syntax, so *this* keeps its asterisks.

Lists

Unordered, nested three deep:

Ordered, with a nested ordered list:

  1. First
  2. Second
    1. Second, first
    2. Second, second
  3. Third

A list can start at any number:

  1. Seven
  2. Eight

Task lists work too:

A loose list puts blank lines between the items. Markdown then wraps each item in a paragraph, which widens the spacing:

Definition lists

Definition lists come from kramdown, and Solo styles them, so they are here:

Term
The definition. dd carries a 1.5rem left margin.
A second term
Its first definition.
A second definition for the same term.

Blockquotes

A blockquote takes the muted text color and a quarter-rem rule in the border color.

It can hold more than one paragraph. The last one drops its bottom margin, so the box closes tight.

Blockquotes nest:

and the inner one picks up the same border and color again.

Code

Inline code sits on the --code-bg background. Every fenced block gets a header bar, borrowed from yolo-11ty. The label names the language. Click anywhere on the bar to copy the block.

A fence with a language gets highlighted at build time, and takes its label from the language:

const palettes = require("./palettes.json");

// Widen twelve colors into the fifty the stylesheet wants.
function expand(palette) {
  return Object.assign({}, palette, {
    muted: mix(palette.text, palette.bg, 0.75),
  });
}
def kramdown_slug(text):
    """The heading ids Solo's pages used."""
    return re.sub(r"[^a-z0-9 -]", "", text.lower()).replace(" ", "-")
.container {
  max-width: 30rem;
  margin: 0 auto;
}

Anything after the language becomes a custom label, so ```yaml Front matter gives this:

layout: layouts/default.njk
permalink: 404.html

A fence with no language gets the same frame, no highlighting, and a plain Text label:

$ npm run build
[11ty] Wrote 3 files in 0.06 seconds

An indented block — four spaces — works the same way:

git clone https://github.com/corbtastik/solo
npm install

Tables

Styled after yolo-11ty. The header row takes the theme’s accent, the same one the code block header uses, and every internal rule is drawn in it. Click any column header to sort. Click again to reverse.

Player BA HR
Hank Aaron .305 755
Babe Ruth .342 714
Mookie Wilson .274 67

Numeric columns sort as numbers. So 67 lands below 714, not between .305 and 714.

Columns take alignment from the separator row:

Left Centered Right
Hank Aaron Right-fielder .305
Babe Ruth Outfielder .342
Mookie Wilson Center-fielder .274

And a plain reference table:

Element Token Shows up in
Body text --text Paragraphs, lists
Links --link Anchors
Rules --rule <hr> and blockquote borders
Code --code-bg <pre> and <code>

An inline link, a link with a title, a bare autolink https://www.11ty.dev/, and a reference link defined below.

The theme centers images and caps them at the column width:

An example image

Footnotes

Footnotes are another kramdown feature.[1] They collect at the bottom of the page, under a rule.[2]

Horizontal rules

Three or more hyphens, asterisks, or underscores make a rule:


Inline HTML

Raw HTML passes straight through. So ⌘ + K, marked text, H2O, 210, and CSS all work.

Markdown images

Plain markdown images take the default <img> styling. The theme centers them and caps them at the column width, so a photo of any size drops in without overflowing:

![BIG yawn Bucky](big-tongue-bucky.jpg "Sleepy Bucky")

BIG yawn Bucky

Styled images

For a set size, reach for the size and ratio classes. They are the same set yolo-11ty uses. Markdown’s ![]() has nowhere to put a class, so write a raw <img>:

<img class="is-256" src="bluebonnet.jpg" alt="Bluebonnet">

Each class sets a width and an aspect ratio. object-fit: cover crops the photo to fill the box, so nothing gets squashed.

Thumbnail

128px square. Use the thumbnail class.

Bucky

Square

Classes: is-16 through is-512.

The Granada Theater

Circle

Classes: is-circle-16 through is-circle-512.

Bucky

4:3 ratio

Classes: is-100-by-75 through is-640-by-480.

Bluebonnet

3:4 ratio

Classes: is-75-by-100 through is-480-by-640.

Bluebonnet

16:9 ratio

Classes: is-112-by-63 through is-640-by-360.

Bluebonnet

9:16 ratio

Classes: is-63-by-112 through is-360-by-640.

Bluebonnet

Image grid

The grid shows images inline. Click one to enlarge it, click again to shrink it. The arrows and the left and right keys step through the set, and Escape closes it. The grid comes from yolo-11ty, down to the data format — its ig-*.yml files drop straight in.

  1. Add images to src/_data/ig-images.yml.
  2. Use the imageGrid shortcode.
{% imageGrid %}
The Granada, Alpine TX.Mesa on guard.Red dirt, blue sky.
Peak on the horizon.Desert castle.Mountain dead ahead.
Green hills, open road.Rolled in, stayed put.Outlaw hideout.
Who lives here?Desert fireworks.Up close and pointy.
The Granada, Alpine TX.

The Granada, Alpine TX.

Mesa on guard.

Mesa on guard.

Red dirt, blue sky.

Red dirt, blue sky.

Peak on the horizon.

Peak on the horizon.

Desert castle.

Desert castle.

Mountain dead ahead.

Mountain dead ahead.

Green hills, open road.

Green hills, open road.

Rolled in, stayed put.

Rolled in, stayed put.

Outlaw hideout.

Outlaw hideout.

Who lives here?

Who lives here?

Desert fireworks.

Desert fireworks.

Up close and pointy.

Up close and pointy.

❮❯

Custom file and column count

Any file in src/_data/ with an ig- prefix works. The second argument sets the column count:

{% imageGrid "ig-camping", 2 %}
Bucky on the rocks.Copilot reporting for duty.
Maximum blep.Fire's going.
Bucky on the rocks.

Bucky on the rocks.

Copilot reporting for duty.

Copilot reporting for duty.

Maximum blep.

Maximum blep.

Fire's going.

Fire's going.

❮❯

Videos

Embedded video, after yolo-11ty. Add entries to src/_data/videos.yml, then call the shortcode:

{% video %}

Pet Friends 2020, a bad year for people, purfect for pets!

Some kitties chase lasers, this one chases cursors.

Each entry is name, src and description. The src is an embed URL. For YouTube that is https://youtube.com/embed/<id>. Pass a different data file as an argument, the way the image grid does: {% video "talks" %}.

Author

corbtastik built this Eleventy port.

corbtastik

Credits

Solo is the original — a Jekyll theme for single-page websites. Shu Uesugi wrote it and released it under the MIT License in 2014. The layout, the 30rem column, the type scale, the spacing, the two typefaces and the syntax palette on this page are all his work. This port only moves them to a different generator. None of the design is mine.

Reference Link
Original theme github.com/chibicode/solo
Original demo chibicode.github.io/solo
Author Shu Uesugi (@chibicode)
Successor theme Duo, which Shu recommends over Solo

Also carried over or borrowed:

License

MIT, the same license Solo carries.


  1. The note itself. It can hold code and links. ↩︎

  2. A second note, to show how they stack. ↩︎