Extending the theme from a site

· 1 min read

Series: Theme tour

Table of contents
Example series banner

Everything on this page beyond plain Markdown comes from the example site, not the theme: two shortcodes and two hook partials. It doubles as a test that such site code keeps working with the theme.

Hooks

A hook is a partial the theme calls if the site provides it.

  • head-end adds the flash card stylesheet, only on pages that use the cards
  • single-after-content adds the video below this text
    • it reads the youtube value from the front matter
    • the player loads only after a click

Shortcodes

Series banner

The banner above is a linked, responsive image built from a global asset.

Flash cards

  1. The deck is a native <details> element
  2. Each card flips with a checkbox, so no JavaScript is involved
Show flash cards Hide flash cards 2 cards

Back to top