Back to blog

Example post with interactive data

By Abel Rodriguez

Table of contents

This is a sample post so you can see every blog feature. To write your own, copy posts/example-interactive-post.md, change the name and the text, and delete this file before you launch the blog.

What a post can do#

Everything below is plain Markdown. The extras are the callouts, the copy button on code, and the interactive charts.

Note

Callouts come in four kinds: NOTE, TIP, WARNING and IMPORTANT.

Tip

Hover or tap a chart to read exact values, or focus it and use the ← and → keys.

Weekly mileage#

A line chart with one series, written the longer way as JSON. The table underneath is always there for readers who prefer numbers, and for people without JavaScript.

Weekly mileage
View as a table
LabelMiles
Wk 122 mi
Wk 226 mi
Wk 329 mi
Wk 424 mi
Wk 531 mi
Wk 634 mi
Wk 728 mi
Wk 820 mi

Week 4 and week 8 were recovery weeks.

Typing data like a spreadsheet#

You don't have to write JSON. Put a few settings at the top, a line of three dashes, then paste rows straight from a spreadsheet. The first row names the series, and each row after it is a label followed by one value per series. Times like 9:45 are understood, so a pace chart is easy to type.

Average pace per mile
View as a table
LabelEasy runsTempo runsLong runs
Jun9:458:1810:05
Jul9:388:149:58
Aug9:328:099:51
Sep9:268:059:46
Oct9:218:019:40

Click a name in the legend to hide that line. Lines differ by dash pattern and marker shape, and are also labelled at their right-hand end, so they are easy to tell apart without relying on colour.

Comparing categories#

Long run distance by race build
View as a table
CategoryLongest runAverage long run
Build 118 mi13.5 mi
Build 220 mi15 mi
Build 322 mi16.5 mi

Showing commands#

Code blocks get a copy button:

npm run build

Leaving the table of contents out#

Posts with three or more headings get a table of contents automatically. Add toc: false to the top of the file to turn it off.