mirror of
https://github.com/ClementTsang/bottom.git
synced 2026-08-23 11:56:45 +00:00
bug: fix schema links + link generation (#2194)
Fixes the version link generation + current links that were missing the `v`.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/0.12.0/bottom.json",
|
||||
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/v0.12.0/bottom.json",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Schema for bottom's config file (v0.12.0)",
|
||||
"description": "https://bottom.pages.dev/0.12.0/configuration/config-file/",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/0.13.0/bottom.json",
|
||||
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/v0.13.0/bottom.json",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Schema for bottom's config file (v0.13.0)",
|
||||
"description": "https://bottom.pages.dev/0.13.0/configuration/config-file/",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/0.14.0/bottom.json",
|
||||
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/v0.14.0/bottom.json",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Schema for bottom's config file (v0.14.0)",
|
||||
"description": "https://bottom.pages.dev/0.14.0/configuration/config-file/",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/0.14.7/bottom.json",
|
||||
"$id": "https://github.com/ClementTsang/bottom/blob/main/schema/v0.14.7/bottom.json",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Schema for bottom's config file (v0.14.7)",
|
||||
"description": "https://bottom.pages.dev/0.14.7/configuration/config-file/",
|
||||
|
||||
@@ -61,33 +61,28 @@ fn generate_schema(schema_options: SchemaOptions) -> anyhow::Result<()> {
|
||||
}
|
||||
|
||||
let version = schema_options.version.unwrap_or("nightly".to_string());
|
||||
schema.insert(
|
||||
"$id".into(),
|
||||
format!("https://github.com/ClementTsang/bottom/blob/main/schema/{version}/bottom.json")
|
||||
.into(),
|
||||
);
|
||||
|
||||
schema.insert(
|
||||
"description".into(),
|
||||
format!(
|
||||
"https://bottom.pages.dev/{}/configuration/config-file/",
|
||||
if version == "nightly" {
|
||||
"nightly"
|
||||
} else {
|
||||
version.as_str()
|
||||
}
|
||||
)
|
||||
.into(),
|
||||
);
|
||||
|
||||
let description_version = if version == "nightly" {
|
||||
let version_with_v = if version == "nightly" {
|
||||
"nightly".to_string()
|
||||
} else {
|
||||
format!("v{version}")
|
||||
};
|
||||
|
||||
schema.insert(
|
||||
"$id".into(),
|
||||
format!(
|
||||
"https://github.com/ClementTsang/bottom/blob/main/schema/{version_with_v}/bottom.json"
|
||||
)
|
||||
.into(),
|
||||
);
|
||||
|
||||
schema.insert(
|
||||
"description".into(),
|
||||
format!("https://bottom.pages.dev/{version}/configuration/config-file/").into(),
|
||||
);
|
||||
|
||||
schema.insert(
|
||||
"title".into(),
|
||||
format!("Schema for bottom's config file ({description_version})").into(),
|
||||
format!("Schema for bottom's config file ({version_with_v})").into(),
|
||||
);
|
||||
|
||||
println!("{}", serde_json::to_string_pretty(&schema).unwrap());
|
||||
|
||||
Reference in New Issue
Block a user