Skip to content

Branding & Styling

leafpress supports full branding customization via leafpress.yml or environment variables.

Set logo_path to a local image file or a remote URL:

# Local file (relative to leafpress.yml)
logo_path: "./logo.png"

# Absolute path
logo_path: "/usr/local/share/branding/logo.png"

# Home directory path
logo_path: "~/assets/logo.svg"

# Remote URL
logo_path: "https://example.com/logo.png"

Supported formats: PNG, SVG, JPEG.

The logo appears on the cover page of every format (and in the DOCX page header). It is scaled to fit within the header area.

The logo is embedded in each output file, so documents stay self-contained: a remote logo is downloaded once at build time (public hosts only, up to 10 MB) rather than linked. A logo that is missing, isn't a real image, or can't be downloaded is skipped with a warning, and the conversion carries on.

SVG logo compatibility

SVG logos render in PDF (via Cairo/librsvg), HTML (native browser support), EPUB, and ODT (embedded as SVG). DOCX only supports raster images, so an SVG logo is skipped there with a warning. For full format compatibility, use a PNG or JPEG logo.

Colors

Two color values control the branding palette:

primary_color: "#1a73e8"    # Used for headings, cover page accents, footer rule
accent_color: "#ffffff"      # Background/contrast color

Both must be 6-digit hex values (e.g. #1a73e8). The # prefix is optional. Values are normalized to lowercase.

Cover page metadata

The cover page is assembled from these fields:

company_name: "Acme Corp"       # shown as subtitle / organization
project_name: "Platform Docs"   # main document title
subtitle: "Internal Documentation"
author: "Engineering Team"
author_email: "team@example.com"
copyright_text: "Copyright © 2026 Acme Corp"

Git version info (tag, commit, branch) is also shown on the cover page if the project is a git repository. See Git Integration.

The footer appears on every page in PDF, DOCX, and ODT, at the end of HTML output, and as a closing chapter in EPUB:

footer:
  include_tag: true             # git tag (e.g. v1.2.0)
  include_date: true            # date of the HEAD commit (YYYY-MM-DD)
  include_commit: true          # short commit hash
  include_branch: false         # branch name
  include_render_date: false    # append "Generated YYYY-MM-DD" to footer
  custom_text: "Confidential"   # static text, always shown if set
  repo_url: "https://github.com/org/repo"  # linked repository URL

Every format assembles the footer the same way, in this order, joined by -:

  1. custom_text
  2. repo_url
  3. The version field: the enabled parts of tag, commit, commit date, and branch, joined by |
  4. Generated YYYY-MM-DD (if include_render_date)
  5. The credit Made with LeafPress · leafpress.dev
Confidential - https://github.com/org/repo - v1.2.0 | a1b2c3d | 2026-03-08 - Made with LeafPress · leafpress.dev

With include_render_date: true:

Confidential - https://github.com/org/repo - v1.2.0 | a1b2c3d | 2026-03-08 - Generated 2026-03-11 - Made with LeafPress · leafpress.dev

The render date can also be toggled via the CLI:

leafpress convert . --footer-date      # enable generation date
leafpress convert . --no-footer-date   # disable generation date

Environment variable overrides

Most branding fields (names, logo, colors, footer, watermark) can be set or overridden via LEAFPRESS_* environment variables; pdf and docx options are YAML-only. See the full table in Configuration.

export LEAFPRESS_PRIMARY_COLOR="#e53935"
export LEAFPRESS_COMPANY_NAME="Acme Corp"