Configuration

Configure LSSG via TOML comments at the start of markdown files. Resources (CSS, JavaScript, images, fonts, videos) are automatically discovered through links and copied to the build directory.

Resource Locations

Resources can be:

All discovered resources are automatically included in the build output without manual configuration. Glob) patterns are supported too, so you can reference sets of files with patterns like images/*, assets/**/*.js, or fonts/*.{woff,woff2}.

Configuration Options

OptionTypeDefaultDescriptionInherited*
rootBooleanfalseDisable parent inheritanceN/A
titleStringFirst H1Page title for browser tab and SEOYes
languageString"en"HTML language attributeYes
section_linksBooleantrueShow link icons on h2 headers on hoverYes
metaObject{}Custom meta tags (key-value pairs)Yes
headArray[String][]Custom HTML elements for <head>Yes
[nav] Navigation Options
nav.kindString"breadcrumbs"Navigation type: "breadcrumbs", "sidemenu", or "none"Yes
nav.include_rootBooleanfalseInclude root page in side menu (sidemenu only)Yes
nav.name_mapObject{}Custom display names for pagesYes
nav.ignoreString[][]Ignore certain pages from navigationYes
[footer] Footer Options
footer.itemsArray[String]["Generated by Lssg"]Footer HTML elements or textYes
footer.customString-Custom footer HTML (replaces items)Yes
[post_config] Post Config Module
use_fs_datesBooleanfalseUse filesystem dates instead of manual datesYes
[post] Post Page Module
renderBooleantrueEnable post-specific renderingNo
created_onString-Publication date (ISO or YYYY-MM-DD)No
modified_onString-Last modification date (ISO or YYYY-MM-DD)No
tagsArray[String][]Post tags/categoriesNo
summaryString-Post summary/excerptNo
[rss] RSS generation from posts
rss.pathString"feed.xml"RSS feed output filenameYes
rss.titleString"Feed"RSS feed titleYes
rss.descriptionString"My feed"RSS feed descriptionYes
rss.hostString-Base URL (required for RSS)Yes
rss.languageString-RSS language codeYes
rss.last_build_date_enabledBooleantrueAdd the lastBuildDate key to RSS feedYes
[media] Media Module - Images
enabledBooleantrueEnable media moduleYes
optimize_imagesBooleantrueEnable image optimizationYes
image_qualityInteger (1-100)85JPEG/PNG compression qualityYes
convert_to_webpBooleantrueConvert images to WebP formatYes
webp_qualityInteger (1-100)95WebP quality (≥95 is lossless)Yes
max_widthInteger1920Maximum image width in pixelsYes
max_heightInteger1080Maximum image height in pixelsYes
resize_threshold_bytesInteger1000000Min file size (bytes) to trigger resizeYes
optimize_videosBooleantrueEnable video optimizationYes
use_ffmpegBooleantrueUse FFmpeg (must be installed)Yes
video_crfInteger (0-51)25Video quality (lower = better, 18-28 recommended)Yes
[external] External Module
hrefString (URL)-URL to ZIP file containing HTML site to importNo

Configuration Inheritance

Inheritance means configuration settings automatically flow down from parent pages to their children based on your site's directory structure.

How It Works

Configuration options set in a parent page (e.g., docs/index.md) automatically apply to all child pages in subdirectories (e.g., docs/tutorials/tutorial1.md) without needing to repeat them.

Example directory structure:

docs/
  index.md          ← parent (sets language="de", nav.kind="sidemenu")
  tutorials/
    tutorial1.md    ← child (inherits both settings)
    tutorial2.md    ← child (inherits both settings)

Key Behaviors

Practical Example

Parent page sets site-wide defaults:

<!-- docs/index.md -->
<!--
language = "nl"
[nav]
kind = "sidemenu"
[footer]
watermark = true
-->

Child page inherits everything:

<!-- docs/tutorials/tutorial1.md -->
<!-- Automatically has language="de", nav.kind="sidemenu", footer.watermark=true -->
# Tutorial 1

Child page overrides specific values:

<!-- docs/tutorials/tutorial2.md -->
<!--
language = "en"  # Override: use English instead of inherited German
-->
# Tutorial 2
<!-- Still inherits nav.kind="sidemenu" and footer.watermark=true -->

This inheritance system eliminates repetition and makes site-wide changes easy—just update the parent configuration.

Example

<!--
title = "My Blog Post"
language = "en"
section_links = true

[meta]
description = "A great post about Rust"
author = "Your Name"

[nav]
kind = "sidemenu"
include_root = true
name_map = { home = "Home Page", post = "Post Posts" }

[post]
created_on = "2025-01-03"
tags = ["rust", "tutorial"]
summary = "Learn about static site generators"

[media]
optimize_images = true
image_quality = 85
convert_to_webp = true

[footer]
items = ['<a href="/about">About</a>', '<a href="/contact">Contact</a>']
watermark = true
-->

# Page Content