Configuration

LSSG uses a modular architecture where different modules handle specific rendering and processing tasks. Configure them via TOML comments at the start of markdown files.

Resource Discovery

LSSG automatically discovers and copies resources (CSS, JavaScript, images, fonts, etc.) to your build output directory.

How It Works

  1. Automatic Detection: LSSG scans your markdown files and HTML for resource references
  2. Recursive Copy: Resources are copied from your source directory to the corresponding location in the build directory
  3. Relative Path Preservation: The directory structure is maintained, ensuring links remain functional
  4. Supported Resources: CSS, JavaScript, images (JPG, PNG, SVG, GIF, WebP), fonts, videos, and other static assets

Resource Locations

Resources can be:

All discovered resources are automatically included in the build output without manual configuration.

Default Module

Core rendering for markdown and HTML structure. Required for all pages.

Page Options

OptionTypeDefaultDescription
rootBooleanfalseDisable parent inheritance
titleStringFirst H1Page title for browser tab and SEO
languageString"en"HTML language attribute
section_linksBooleantrueShow link icons on h2 headers on hover
metaObject{}Custom meta tags (key-value pairs)
headArray[String][]Custom HTML elements for <head>

Navigation Options

OptionTypeDefaultDescription
nav.kindString"breadcrumbs"Navigation type: "breadcrumbs", "sidemenu", or "none"
nav.include_rootBooleanfalseInclude root page in side menu (only applies to sidemenu)
nav.name_mapObject{}Custom display names for pages (key: page name, value: display name)

Navigation Types:

Footer Options

OptionTypeDefaultDescription
footer.itemsArray[String][]Footer HTML elements or text
footer.customString-Custom footer HTML (replaces default)
footer.watermarkBooleantrueShow "Generated by Lssg"

Inheritance: Child pages inherit parent options. Child values override parent values. Use root = true to disable inheritance.

Blog Module

Blogging capabilities with posts, indexing, and RSS feeds.

Blog Root Options ([blog.root])

For the main blog index page:

OptionTypeDefaultDescription
use_fs_datesBooleanfalseUse filesystem dates instead of manual dates
rss.enabledBooleanfalseEnable RSS feed generation
rss.pathString"feed.xml"RSS feed output filename
rss.titleString"Feed"RSS feed title
rss.descriptionString"My feed"RSS feed description
rss.hostString-Base URL (required for RSS)
rss.languageString-RSS language code
rss.last_build_date_enabledBooleantrueUse most recent post date as build date

Blog Post Options ([blog.post])

For individual blog posts:

OptionTypeDefaultDescription
renderBooleantrueEnable blog-specific rendering
created_onString-Publication date (ISO or YYYY-MM-DD)
modified_onString-Last modification date (ISO or YYYY-MM-DD)
tagsArray[String][]Post tags/categories
summaryString-Post summary/excerpt

Media Module

Automatic optimization for images and videos.

Image Options ([media])

OptionTypeDefaultDescription
optimize_imagesBooleantrueEnable image optimization
image_qualityInteger (1-100)85JPEG/PNG compression quality
convert_to_webpBooleantrueConvert images to WebP format
webp_qualityInteger (1-100)95WebP quality (≥95 is lossless)
max_widthInteger1920Maximum image width in pixels
max_heightInteger1080Maximum image height in pixels
resize_threshold_bytesInteger1000000Min file size (bytes) to trigger resize

Video Options ([media])

OptionTypeDefaultDescription
optimize_videosBooleantrueEnable video optimization
use_ffmpegBooleantrueUse FFmpeg (must be installed)
video_crfInteger (0-51)25Video quality (lower = better, 18-28 recommended)

External Module

Import complete HTML sites from remote ZIP archives.

OptionTypeDefaultDescription
hrefString (URL)-URL to ZIP file containing HTML site

Downloads and integrates ZIP contents: HTML pages, CSS stylesheets, and resources while preserving folder structure.

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", blog = "Blog Posts" }

[blog.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