Glance Schema
June 4, 2026 ยท View on GitHub
A JSON schema detailing the Glance config file.
Note
Currently represents version: v0.8.5. Now supports validation of split config files using $include!
Usage
The schema is available at: https://raw.githubusercontent.com/not-first/glance-schema/master/schema.json
This schema works with any editor that supports JSON schemas. The examples below use VS Code, but similar configuration can be applied to other editors.
Main Config File (glance.yml)
For your main glance.yml configuration file:
- Install the YAML extension for VS Code.
- At the top of your
glance.ymlfile, add this line:# yaml-language-server: $schema=https://raw.githubusercontent.com/not-first/glance-schema/master/schema.json
Split Config Files
The schema now supports validating split config files using the $include directive. Here are examples for common use cases:
Widget Files
Widget files should always be arrays, even for a single widget (this is the official Glance recommendation):
# yaml-language-server: $schema=https://raw.githubusercontent.com/not-first/glance-schema/master/schema.json#/definitions/widget
- type: weather
location: New York, United States
Page Files
Page files should also be arrays, even for a single page:
# yaml-language-server: $schema=https://raw.githubusercontent.com/not-first/glance-schema/master/schema.json#/definitions/page
- name: Home
columns:
- size: full
widgets:
- type: rss
title: News
Using $include in Your Main Config
Example glance.yml with includes:
# yaml-language-server: $schema=https://raw.githubusercontent.com/not-first/glance-schema/master/schema.json
server:
port: 8080
pages:
- $include: pages/home.yml
- name: Inline Page
columns:
- size: full
widgets:
- $include: widgets/weather.yml
- $include: widgets/rss.yml
- type: clock
Automatic Schema Application for Folders
For projects with dedicated folders for widgets and pages, you can configure VS Code to automatically apply the appropriate schema without adding comments to each file.
Add this to your .vscode/settings.json:
{
"yaml.schemas": {
"https://raw.githubusercontent.com/not-first/glance-schema/master/schema.json": ["glance.yml"],
"https://raw.githubusercontent.com/not-first/glance-schema/master/schema.json#/definitions/widget": ["widgets/*.yml"],
"https://raw.githubusercontent.com/not-first/glance-schema/master/schema.json#/definitions/page": ["pages/*.yml"]
}
}
This configuration:
- Applies the main schema to
glance.yml - Applies the widget schema (array) to all
.ymlfiles in thewidgets/folder - Applies the page schema (array) to all
.ymlfiles in thepages/folder
Known Limitations
Some error messages can be autogenerated by the schema validator and are unhelpful in figuring out what is wrong. These can be customised in the schema once they are located, so please create an issue if you experience one.