Configuration #
Glaze reads project configuration from glaze.neon in your project root. It uses NEON format – the same format used for page frontmatter.
A glaze.neon file is optional. Start minimal and add settings only when you need them.
Full example #
pageTemplate: page
site:
title: My Site
description: Notes on web, PHP, and experiments.
baseUrl: https://example.com
basePath: /blog
meta:
robots: index,follow
og:type: website
images:
driver: gd
presets:
thumb:
w: 320
h: 180
fit: crop
hero:
w: 1200
h: 630
taxonomies:
- tags
- categories
contentTypes:
blog:
paths:
- match: blog
createPattern: blog/{date:Y/m}
defaults:
template: blog
draft: false
docs:
paths:
- match: docs
defaults:
template: docs
extensionsDir: extensions
djot:
codeHighlighting:
enabled: true
theme: nord
themes:
dark: github-dark
light: github-light
withGutter: false
headerAnchors:
enabled: false
symbol: "#"
position: after
cssClass: permalink-wrapper
ariaLabel: Anchor link
levels: [1, 2, 3, 4, 5, 6]
autolink:
enabled: false
allowedSchemes: [https, http, mailto]
externalLinks:
enabled: false
internalHosts: []
target: _blank
rel: noopener noreferrer
nofollow: false
smartQuotes:
enabled: false
locale: null
mentions:
enabled: false
urlTemplate: '/users/view/{username}'
cssClass: mention
semanticSpan:
enabled: false
defaultAttributes:
enabled: false
defaults: {}
build:
clean: false
drafts: false
vite:
enabled: false
command: "npm run build"
assetBaseUrl: /
manifestPath: public/.vite/manifest.json
defaultEntry: assets/css/site.css
devServer:
php:
host: 127.0.0.1
port: 8080
vite:
enabled: false
host: 127.0.0.1
port: 5173
url: http://127.0.0.1:5173
injectClient: true
defaultEntry: assets/css/site.css
command: "npm run dev -- --host {host} --port {port} --strictPort"
pageTemplate #
Default Sugar template name used to render pages. The value is a template name without the .sugar.php extension, resolved relative to templates/.
pageTemplate: page
This means pages render with templates/page.sugar.php unless a per-page template frontmatter value overrides it.
site #
Global site metadata. All values are available in templates as properties on the $site object.
-
title– site name; used in<title>tags and headings -
description– default meta description -
baseUrl– canonical base URL (used for sitemaps, feed links, etc.) -
basePath– URL prefix for subfolder deployments (e.g./blog); prepended to all generated links
images #
Controls League Glide image transform behavior.
images.driver #
PHP image processing driver. Supported values: gd (default), imagick.
images:
driver: imagick
images.presets #
Named transform presets. Each preset is a map of Glide parameters. Use a preset in content or templates with ?p=name (or ?preset=name).
images:
presets:
thumb:
w: 320
h: 180
fit: crop
hero:
w: 1200
h: 630
fm: webp
Raw query parameters still work when presets are defined. Raw values override preset values when both are present in the same URL.
taxonomies #
Lists which frontmatter keys are treated as taxonomy fields. Values are extracted from page frontmatter and made available through collection query helpers.
taxonomies:
- tags
- categories
With this config, tags: [php, oss] in a page’s frontmatter becomes accessible via $this->taxonomyTerm('tags', 'php') in templates.
contentTypes #
Classifies pages by path prefix and optionally applies metadata defaults.
contentTypes:
blog:
paths:
- match: blog
createPattern: blog/{date:Y/m}
defaults:
template: blog
draft: false
paths #
Each entry under paths is a rule with two keys:
-
match(required) – path prefix; pages whoserelativePathstarts with this value are assigned to this type -
createPattern(optional) – path template used byglaze newwhen creating a page of this type
createPattern supports the {date:FORMAT} placeholder, which is replaced with today’s date formatted using PHP date format characters:
createPattern: blog/{date:Y/m}
# creates pages under: blog/2026/02/
createPattern: posts/{date:Y}
# creates pages under: posts/2026/
Shorthand path entries (a plain string instead of a map) are also supported and behave as a match-only rule with no createPattern:
contentTypes:
docs:
paths:
- docs
defaults #
A metadata map merged into all pages of this type, before page frontmatter is applied. Page frontmatter always wins over type defaults.
defaults:
template: blog
draft: false
meta:
layout: wide
Explicit type override in frontmatter #
A page can declare its type directly in frontmatter, bypassing path matching:
---
type: blog
title: My post
---
The resolved type is available in templates as $page->type.
djot #
Djot rendering configuration namespace. Grouping options under djot keeps the file organized and leaves room for future Djot-specific features.
djot.codeHighlighting #
Controls syntax highlighting for fenced code blocks. Powered by Phiki.
djot:
codeHighlighting:
enabled: true
theme: github-dark
themes:
dark: github-dark
light: github-light
withGutter: true
-
enabled– enable or disable highlighting (defaulttrue) -
theme– single Phiki theme name (defaultnord); used whenthemesis not set -
themes– optional named theme map (name: theme) for multi-theme output (for exampledark/light) -
withGutter– show line-number gutter beside code (defaultfalse)
When themes is configured, it takes precedence over theme. Glaze passes both named themes to Phiki, which emits CSS variables per named theme so you can switch colors in CSS.
Example with explicit dark/light mapping:
djot:
codeHighlighting:
themes:
dark: github-dark
light: github-light
djot.headerAnchors #
Injects anchor permalink links into headings during Djot rendering, powered by the vendor HeadingPermalinksExtension.
djot:
headerAnchors:
enabled: true
symbol: "#"
position: after
cssClass: permalink-wrapper
ariaLabel: Anchor link
levels: [2, 3, 4]
-
enabled– enable or disable heading anchor injection (defaultfalse) -
symbol– anchor text shown inside the heading link (default#) -
position– link placement, eitherbeforeorafterheading text (defaultafter) -
cssClass– CSS class added to each anchor link (defaultpermalink-wrapper) -
ariaLabel– accessibility label for anchor links (defaultAnchor link) -
levels– heading levels that get anchors (defaults to[1, 2, 3, 4, 5, 6])
djot.autolink #
Automatically converts bare URLs in the document into anchor links.
djot:
autolink:
enabled: true
allowedSchemes: [https, http, mailto]
-
enabled– enable or disable autolinking (defaultfalse) -
allowedSchemes– URL schemes to linkify (default[https, http, mailto])
djot.externalLinks #
Adds configurable attributes to external links. Internal hosts are excluded.
djot:
externalLinks:
enabled: true
internalHosts: [example.com]
target: _blank
rel: noopener noreferrer
nofollow: false
-
enabled– enable or disable external link enrichment (defaultfalse) -
internalHosts– list of hostnames treated as internal; matching links are left unchanged -
target–targetattribute added to external links (default_blank) -
rel–relattribute added to external links (defaultnoopener noreferrer) -
nofollow– appendnofollowto therelattribute (defaultfalse)
djot.smartQuotes #
Replaces straight quotation marks with typographic curly quotes. Locale-based defaults are applied when no explicit characters are given.
djot:
smartQuotes:
enabled: true
locale: en
-
enabled– enable or disable smart quote conversion (defaultfalse) -
locale– locale used for quote character defaults, e.g.en,de,fr(defaultnull) -
openDouble– explicit opening double-quote character; overrides locale default (defaultnull) -
closeDouble– explicit closing double-quote character; overrides locale default (defaultnull) -
openSingle– explicit opening single-quote character; overrides locale default (defaultnull) -
closeSingle– explicit closing single-quote character; overrides locale default (defaultnull)
djot.mentions #
Converts @username references into links using a configurable URL template.
djot:
mentions:
enabled: true
urlTemplate: '/users/view/{username}'
cssClass: mention
-
enabled– enable or disable mention expansion (defaultfalse) -
urlTemplate– URL template for mention links;{username}is replaced with the matched username (default/users/view/{username}) -
cssClass– CSS class added to rendered mention links (defaultmention)
djot.semanticSpan #
Promotes spans with special class attributes to their semantic HTML equivalents.
Supported mappings: {mark=...} → <mark>, {ins=...} → <ins>, {del=...} → <del>, {kbd=...} → <kbd>.
djot:
semanticSpan:
enabled: true
-
enabled– enable or disable semantic span promotion (defaultfalse)
djot.defaultAttributes #
Injects default HTML attributes onto Djot elements at render time.
djot:
defaultAttributes:
enabled: true
defaults:
heading:
class: my-heading
paragraph:
class: prose
-
enabled– enable or disable default attribute injection (defaultfalse) -
defaults– map of element type names to attribute maps; keys are Djot node type names (e.g.heading,paragraph,code_block), values are attribute name → value maps
djot Table of Contents #
Glaze can generate a table of contents from Djot headings in a single render pass.
Inline TOC directive
Place [[toc]] as a standalone paragraph in your Djot source to inject the table of contents at that position:
[[toc]]
## Introduction
## Installation
Template access
The $page->toc property holds the collected TocEntry list in document order:
<?php foreach ($page->toc as $entry): ?>
<a href="#<?= $entry->id ?>"><?= $entry->text ?></a>
<?php endforeach; ?>
Each TocEntry exposes:
-
$entry->level– heading level (1–6) -
$entry->id– anchor id matching the rendered heading element -
$entry->text– plain-text heading label
extensionsDir #
Directory Glaze scans for classes decorated with #[GlazeExtension]. Relative to the project root. Defaults to extensions.
extensionsDir: extensions
Any invokable class carrying the #[GlazeExtension('name')] attribute found in this directory is auto-registered and callable from templates as $this->extension('name'). See Extensions for full details.
devServer.php #
Optional defaults for glaze serve host and port.
devServer:
php:
host: 127.0.0.1
port: 8080
-
host– default host interface for the PHP built-in server -
port– default port for the PHP built-in server
CLI options override these values (--host, --port).
devServer.vite #
Optional settings for glaze serve --vite in live mode.
devServer:
php:
host: 127.0.0.1
port: 8080
vite:
enabled: false
host: 127.0.0.1
port: 5173
url: http://127.0.0.1:5173
injectClient: true
defaultEntry: resources/js/app.ts
command: "npm run dev -- --host {host} --port {port} --strictPort"
-
enabled– opt-in default for Vite integration (falseby default) -
host– Vite host interface -
port– Vite port -
url– explicit Vite dev server URL used by template integration (optional; defaults tohttp://{host}:{port}) -
injectClient– inject@vite/clientautomatically in development mode (trueby default) -
defaultEntry– default entry used bys:vitewhen no entry argument is passed -
command– command template used to start Vite;{host}and{port}are replaced at runtime
CLI options always override these values (--vite, --vite-host, --vite-port, --vite-command).
build #
Optional defaults for glaze build options.
build:
clean: false
drafts: false
vite:
enabled: false
command: "npm run build"
assetBaseUrl: /
manifestPath: public/.vite/manifest.json
defaultEntry: assets/css/site.css
-
clean– clean output directory before build (trueby default;--nocleanalways disables) -
drafts– include drafts during build (equivalent to--drafts) -
vite.enabled– opt-in default for Vite build integration (falseby default) -
vite.command– command used to run Vite build in the project root -
vite.assetBaseUrl– base URL for emitted production assets in template tags -
vite.manifestPath– path to Vite manifest used for production template rendering -
vite.defaultEntry– default entry used bys:vitein production mode
CLI options override these values (--noclean, --drafts, --vite, --vite-command).
build.vite #
Nested Vite build settings under build.
build:
vite:
enabled: false
command: "npm run build"
assetBaseUrl: /
manifestPath: public/.vite/manifest.json
defaultEntry: css/site.css
-
enabled– opt-in default for Vite build integration (falseby default) -
command– command used to run Vite build in the project root -
assetBaseUrl– base URL used for generated script/link tags in production mode -
manifestPath– manifest file path for Vite production assets -
defaultEntry– default entry used whens:vitereceives no explicit entry
Vite scaffold + template integration #
Glaze can scaffold and wire Vite support with one command:
glaze init my-site --vite
This creates vite.config.js, package.json, and enables Vite defaults in glaze.neon.
In templates, use Sugar’s s:vite directive:
<s-template s:vite="'assets/css/site.css'" />
Live mode (glaze serve --vite) renders dev server tags, while static build mode renders production tags from the configured manifest.
Notes #
-
A missing
glaze.neonis valid; Glaze uses sensible defaults. - Unknown top-level keys are ignored.