diff --git a/schema/v0.12.0/bottom.json b/schema/v0.12.0/bottom.json index 4db69989..8ebfb178 100644 --- a/schema/v0.12.0/bottom.json +++ b/schema/v0.12.0/bottom.json @@ -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/", diff --git a/schema/v0.13.0/bottom.json b/schema/v0.13.0/bottom.json index bb74baf1..a28e29af 100644 --- a/schema/v0.13.0/bottom.json +++ b/schema/v0.13.0/bottom.json @@ -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/", diff --git a/schema/v0.14.0/bottom.json b/schema/v0.14.0/bottom.json index 3b0d9321..5806e189 100644 --- a/schema/v0.14.0/bottom.json +++ b/schema/v0.14.0/bottom.json @@ -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/", diff --git a/schema/v0.14.7/bottom.json b/schema/v0.14.7/bottom.json index 1b780592..630a466a 100644 --- a/schema/v0.14.7/bottom.json +++ b/schema/v0.14.7/bottom.json @@ -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/", diff --git a/scripts/schema_gen/src/main.rs b/scripts/schema_gen/src/main.rs index f0ecd049..6dd0a761 100644 --- a/scripts/schema_gen/src/main.rs +++ b/scripts/schema_gen/src/main.rs @@ -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());