Skip to main content
Documentation
On this page

Install Cirth for Zola

Zola copies static/ into the published site unchanged. Its base template supplies the document head shared by generated pages, so one Cirth link loads the stylesheet globally. get_url can add a cache-busting hash to the file's URL.

Verified with Zola 0.23.6 on

Three steps: add the file, link it and check it.

1 Add the file #

mkdir -p static/css
curl -o static/css/cirth.min.css \
  https://cdn.jsdelivr.net/npm/@cirthcss/cirth@0.17.0/dist/cirth.min.css

In templates/base.html:

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="{{ get_url(path='css/cirth.min.css', cachebust=true) }}">
  <title>{{ config.title }}</title>
</head>

Keep compile_sass for your own Sass if you use it; Cirth is plain CSS and goes in static/.

3 Check it #

Put this forced-dark region in a page or component that uses the global stylesheet:

<section data-theme="dark">
  <article>
    <p>Dark, whatever the system scheme is.</p>
  </article>
</section>

Run the app, then open the page while the system uses a light theme. A dark article proves that Cirth loaded and that data-theme="dark" is working. It remains dark when the system switches to a dark theme.

Customization covers the --cirth-* properties; set yours in a stylesheet linked after Cirth. Package and builds lists the classless, scoped and print entry points. Return to Framework guides for another stack.

Search documentation

Type at least two characters to search.