Skip to content
DataLeaf

Documentation

Installation

DataLeaf requires Hugo 0.158.0 or later (standard or Extended edition) and Git. Hugo 0.158 introduced the language locale, label, and direction APIs used by the theme. No Sass pipeline or Extended-only functionality is required. Hugo Modules also requires Go 1.22 or later.

Check your Hugo installation:

bash
hugo version

Git submodule

#

From the root of an existing Hugo site:

bash
git submodule add https://gitlab.com/DiogoRibeiro7/dataleaf.git themes/dataleaf

Then enable the theme in hugo.toml:

toml
theme = "dataleaf"

To update later:

bash
git submodule update --remote --merge themes/dataleaf

Hugo module

#

Initialize Hugo modules in your site if you have not already:

bash
hugo mod init example.com/my-site

Add DataLeaf as a module import:

toml
[module]
  [[module.imports]]
    path = "gitlab.com/DiogoRibeiro7/dataleaf"

Then resolve the module:

bash
hugo mod get

The public DataLeaf repository needs no credentials. If you use a private fork, authenticate Git for its host and set GOPRIVATE to the fork’s module path, such as GOPRIVATE=gitlab.com/your-group/*, so Go bypasses the public module proxy and checksum service. Never put credentials in site configuration.

Minimal configuration

#

A small working configuration is:

toml
baseURL = "https://example.com/"
title = "My site"
theme = "dataleaf"
defaultContentLanguage = "en"

[languages.en]
  locale = "en-US"
  label = "English"
  direction = "ltr"

[pagination]
  pagerSize = 10

[taxonomies]
  tag = "tags"
  category = "categories"

[params]
  description = "Technical notes and long-form articles."

When installing DataLeaf as a Hugo module, omit the theme line and use the module import instead.

Mathematics

#

If you want DataLeaf’s mathematical render hook, enable Goldmark passthrough delimiters:

toml
[markup]
  [markup.goldmark]
    [markup.goldmark.extensions]
      [markup.goldmark.extensions.passthrough]
        enable = true

        [markup.goldmark.extensions.passthrough.delimiters]
          block = [['\[', '\]'], ['$$', '$$']]
          inline = [['\(', '\)']]

By default DataLeaf renders supported mathematics at Hugo build time.

Verify the site

#

Run:

bash
hugo server

For a production check:

bash
hugo --gc --minify

Continue with the Configuration reference.