at 8b03dd8
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "AbbayeConfig", "description": "A full configuration for the Abbaye site generator.\n\nHere's a sample configuration that works well as a starting point for rust projects:\n\n```toml\n[site]\nname = \"Abbaye\"\n\n[version_extractor]\ntype = \"cargo\" # extract version from Cargo.toml\n\n[changelog]\n# let's use the default changelog extractor\n\n[[builders]]\ntype = \"cargo\" # calls `cargo build --release` for each target\ntargets = [\"x86_64-unknown-linux-gnu\", \"x86_64-unknown-linux-musl\"]\n[[builders]]\ntype = \"cargo_doc\" # generates documentation using `cargo doc`\nno_deps = true\n\n[[builders]]\ntype = \"archive\" # creates a compressed tarball of the source code\n```\n\nYou can learn more about each builder type in the [builders module documentation](crate::builders).", "type": "object", "properties": { "builders": { "description": "Builders to run during the build process.", "type": "array", "items": { "$ref": "#/definitions/AnyBuilder" } }, "changelog": { "description": "Configuration for the changelog extractor.", "allOf": [ { "$ref": "#/definitions/ChangelogConfig" } ] }, "output_dir": { "description": "Where to output generated files. Defaults to `public`.", "type": [ "string", "null" ], "default": "public" }, "site": { "description": "Metadata about the site.", "allOf": [ { "$ref": "#/definitions/SiteConfig" } ] }, "version_extractor": { "description": "which version extractor to use to extract the version(s) of the project", "allOf": [ { "$ref": "#/definitions/AnyVersionExtractor" } ] } }, "required": [ "site", "version_extractor", "changelog", "builders" ], "definitions": { "AnyBuilder": { "oneOf": [ { "description": "Creates a `.tar.gz` archive of the source tree, automatically excluding\nfiles and directories matched by any `.gitignore` found in the hierarchy.\n\n```toml\n[[builders]]\ntype = \"archive\"\nsource_dir = \".\" # optional, defaults to CWD\noutput = \"myproject-1.0.0.tar.gz\" # optional, defaults to source.tar.gz\nprefix = \"myproject-1.0.0\" # optional, defaults to source_dir name\n```", "type": "object", "properties": { "type": { "type": "string", "const": "archive" } }, "allOf": [ { "$ref": "#/definitions/ArchiveBuilderConfig" } ], "required": [ "type" ] }, { "description": "Compiles the crate in release mode with `cargo build --release`.\nOne or more target triples can be specified for cross-compilation;\nomitting `targets` builds for the host platform.\n\n```toml\n[[builders]]\ntype = \"cargo\"\ntargets = [\"x86_64-unknown-linux-musl\", \"aarch64-unknown-linux-musl\"]\nmanifest_path = \"Cargo.toml\" # optional\n```", "type": "object", "properties": { "type": { "type": "string", "const": "cargo" } }, "allOf": [ { "$ref": "#/definitions/CargoBuilderConfig" } ], "required": [ "type" ] }, { "description": "Generates API documentation with `cargo doc`.\nReturns the per-crate doc directory (e.g. `target/doc/my_crate`) as an\nartifact so it can be published or archived by a later pipeline step.\n\n```toml\n[[builders]]\ntype = \"cargo_doc\"\nno_deps = true # optional, skip dependency docs\nmanifest_path = \"Cargo.toml\" # optional\n```", "type": "object", "properties": { "type": { "type": "string", "const": "cargo_doc" } }, "allOf": [ { "$ref": "#/definitions/CargoDocBuilderConfig" } ], "required": [ "type" ] }, { "description": "Runs an arbitrary sequence of shell commands and collects declared\noutput paths as release artifacts.\n\nEach script line is passed to `sh -c`; the build fails immediately if\nany command exits with a non-zero status.\n\n```toml\n[[builders]]\ntype = \"script\"\nscript = [\n \"make release\",\n \"strip target/mybin\",\n]\noutputs = [\"target/mybin\"]\n```", "type": "object", "properties": { "type": { "type": "string", "const": "script" } }, "allOf": [ { "$ref": "#/definitions/ScriptBuilderConfig" } ], "required": [ "type" ] } ] }, "AnyVersionExtractor": { "oneOf": [ { "description": "Reads the version from the `version` field in the `[package]` section\nof a `Cargo.toml` file.\n\n```toml\n[version_extractor]\ntype = \"cargo\"\nmanifest_path = \"Cargo.toml\" # optional, defaults to ./Cargo.toml\n```", "type": "object", "properties": { "type": { "type": "string", "const": "cargo" } }, "allOf": [ { "$ref": "#/definitions/CargoVersionConfig" } ], "required": [ "type" ] }, { "description": "Derives the version from the most recent Git tag using\n`git describe --tags --always`.\nSupports stripping a tag prefix (e.g. `\"v\"`) and customising the\nsuffix appended when the working tree has uncommitted changes.\n\n```toml\n[version_extractor]\ntype = \"git\"\ntag_prefix = \"v\" # optional, strips leading \"v\"\ndirty_suffix = \"-dev\" # optional, defaults to \"-dirty\"\n```", "type": "object", "properties": { "type": { "type": "string", "const": "git" } }, "allOf": [ { "$ref": "#/definitions/GitVersionConfig" } ], "required": [ "type" ] } ] }, "ArchiveBuilderConfig": { "description": "Configuration for [`ArchiveBuilder`].", "type": "object", "properties": { "ignore_patterns": { "description": "Glob patterns for files and directories to exclude from the archive.\nEach pattern is matched against every component of a path, so a pattern\nlike `\".git\"` excludes the `.git` directory and all its contents, and\n`\"*.local\"` excludes any entry whose name ends with `.local`.\nDefaults to `[\".git\", \"*.local\"]`.", "type": "array", "default": [ ".git", "*.local" ], "items": { "type": "string" } }, "output": { "description": "Output path for the generated `.tar.gz` archive.\nDefaults to `source.tar.gz` in the current working directory.", "type": [ "string", "null" ] }, "prefix": { "description": "Prefix applied to every entry path inside the archive.\nFor example, `\"myproject-1.0.0\"` produces entries like\n`myproject-1.0.0/src/main.rs`.\nDefaults to the source directory's name.", "type": [ "string", "null" ] }, "source_dir": { "description": "Root directory to archive. Defaults to the current working directory.", "type": [ "string", "null" ] } } }, "CargoBuilderConfig": { "description": "Configuration for [`CargoBuilder`].", "type": "object", "properties": { "bins": { "description": "Restrict collected artifacts to these binary (or cdylib) target names.\n\nWhen empty every artifact produced by a **workspace member or local\npath-dependency** is kept. Use this to avoid picking up extra binaries\nfrom dev-tools or examples that live in the same workspace.\n\n```toml\n[[builders]]\ntype = \"cargo\"\nbins = [\"my_binary\", \"my_cdylib\"]\n```", "type": "array", "default": [], "items": { "type": "string" } }, "manifest_path": { "description": "Optional path to the Cargo.toml manifest.\n\nPassed verbatim as `--manifest-path`. Defaults to the manifest in the\ncurrent working directory when absent.", "type": [ "string", "null" ] }, "targets": { "description": "Cargo target triples to build for (e.g. `\"x86_64-unknown-linux-musl\"`).\n\nEach entry is passed as `--target <triple>` in a separate `cargo build`\ninvocation. When the list is empty, cargo builds for the host target.", "type": "array", "default": [], "items": { "type": "string" } } } }, "CargoDocBuilderConfig": { "description": "Configuration for [`CargoDocBuilder`].", "type": "object", "properties": { "manifest_path": { "description": "Optional path to the Cargo.toml manifest.\n\nPassed verbatim as `--manifest-path`. Defaults to the manifest in the\ncurrent working directory when absent.", "type": [ "string", "null" ] }, "no_deps": { "description": "Skip building documentation for dependencies (`--no-deps`).", "type": "boolean", "default": false } } }, "CargoVersionConfig": { "description": "Configuration for [`CargoVersion`].", "type": "object", "properties": { "manifest_path": { "description": "Path to the `Cargo.toml` to read the version from.\nDefaults to `Cargo.toml` in the current working directory.", "type": [ "string", "null" ] } } }, "ChangelogConfig": { "description": "Configuration for [`ChangelogExtractor`].", "type": "object", "properties": { "directory": { "description": "Directory that contains the `CHANGELOG.md`.\nDefaults to the current working directory.", "type": [ "string", "null" ] } } }, "GitVersionConfig": { "description": "Configuration for [`GitVersion`].", "type": "object", "properties": { "dirty_suffix": { "description": "Suffix appended to the version when the working tree has uncommitted\nchanges. Forwarded verbatim as `--dirty=<suffix>` to `git describe`.\nDefaults to `\"-dirty\"`.", "type": "string", "default": "-dirty" }, "tag_prefix": { "description": "Strip this prefix from the tag name before returning the version.\nFor example, `\"v\"` turns `\"v1.2.3\"` into `\"1.2.3\"`.", "type": [ "string", "null" ] } } }, "OpenGraphConfig": { "description": "OpenGraph configuration for the website.", "type": "object", "properties": { "author": { "description": "Author of the website. Used on release notes pages to indicate the author.", "type": [ "string", "null" ] }, "image": { "description": "URL of the website's image.", "type": "string" }, "image_alt_text": { "description": "Alt text for the website's image.", "type": [ "string", "null" ] }, "type": { "description": "OpenGraph type of the website. It will be used as the `og:type` meta tag.\nNote: by default, the value \"website\" will be enforced for the version listing page and \"article\" for the release notes page.", "type": [ "string", "null" ] }, "url": { "description": "URL of the website. If not set, the `base_url` will be used instead. If `base_url` is not set either, the world explodes. Think of the kittens.", "type": [ "string", "null" ] } }, "required": [ "image" ] }, "ScriptBuilderConfig": { "description": "Configuration for [`ScriptBuilder`].", "type": "object", "properties": { "outputs": { "description": "Paths of the files or directories produced by the script that should be\ntreated as release artifacts (copied to `dist/` and listed on the\nrelease page). Each path is resolved relative to the working directory\nin which `abbaye` is run.\n\nIf a listed path is missing, the build fails.", "type": "array", "items": { "$ref": "#/definitions/ScriptBuilderOutput" } }, "script": { "description": "Shell commands to execute in order. Each line is passed to `sh -c`,\nso any POSIX shell syntax is supported.\n\nThe environment variable `ABBAYE_BUILDING_VERSION` is set to the version\nbeing built. (e.g. the git tag `v0.1.0` or whatever. Not Abbaye's own version)\n\nThe build fails immediately if any command exits with a non-zero status.\n\n```toml\n[[builders]]\ntype = \"script\"\nscript = [\n \"make release\",\n \"strip target/mybin\",\n]\noutputs = [\"target/mybin\"]\n```", "type": "array", "items": { "type": "string" } } }, "required": [ "script", "outputs" ] }, "ScriptBuilderOutput": { "description": "Lets the user specify a path for a script output, optionally with a custom name.\nI need to check but it should enable the user to specify a directory as output.\nIf that's a good idea is an other question.", "anyOf": [ { "type": "object", "properties": { "name": { "type": "string" }, "path": { "type": "string" } }, "required": [ "path", "name" ] }, { "type": "string" } ] }, "SiteConfig": { "description": "General website metadata.", "type": "object", "properties": { "base_url": { "description": "Canonical base URL of the published site (e.g. `\"https://example.com\"`).\nWhen set, the generated `releases.atom` feed will include absolute links\nand proper entry IDs. Trailing slashes are stripped automatically.", "type": [ "string", "null" ] }, "fediverse_creator": { "description": "If you have a Fediverse account, you can set this to your username to enable Fediverse integration. (don't forget the starting '@' !)", "type": [ "string", "null" ] }, "lang": { "description": "An optional language code for the website (e.g. `\"en\"` or `\"fr\"`).\nWhen set, the generated HTML will include a `lang` attribute on the `<html>` tag. Defaults to `\"en\"`.", "type": [ "string", "null" ] }, "name": { "description": "Display name of the project, used in page titles and headings.", "type": "string" }, "opengraph": { "description": "OpenGraph configuration for the website.", "anyOf": [ { "$ref": "#/definitions/OpenGraphConfig" }, { "type": "null" } ] }, "readme": { "description": "Path to the README file rendered on each version page.\nDefaults to `README.md` in the current working directory.", "type": [ "string", "null" ] }, "repo_url": { "description": "URL of the project's repository (e.g. `\"https://git.sr.ht/~ololduck/abbaye\"`).\nWhen set, we will show the repository link in the generated website.", "type": [ "string", "null" ] } }, "required": [ "name" ] } } }