diff --git a/config.toml b/config.toml index 4d2ea1c..e519ad4 100644 --- a/config.toml +++ b/config.toml @@ -1,3 +1,10 @@ +[catalog] +type = "Catalog" # will this be unnecessary once https://github.com/stac-utils/stac-rs/pull/498 is released? +stac_version = "1.1.0" +id = "heystac" +description = "A curated geospatial asset discovery experience™" +links = [] + [catalogs.microsoft-pc] href = "https://planetarycomputer.microsoft.com/api/stac/v1" title = "Microsoft Planetary Computer" diff --git a/src/lib.rs b/src/lib.rs index ba4ebd7..f6495b4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,11 +8,9 @@ use std::{ path::Path, }; -const CATALOG_ID: &str = "heystac"; -const CATALOG_DESCRIPTION: &str = "A curated geospatial asset discovery experience™"; - #[derive(Debug, Deserialize)] pub struct Config { + catalog: Catalog, catalogs: HashMap, } @@ -32,7 +30,7 @@ impl Config { } pub fn write_catalog(&self, path: impl AsRef) -> Result<()> { - let mut catalog = Catalog::new(CATALOG_ID, CATALOG_DESCRIPTION); + let mut catalog = self.catalog.clone(); for (id, catalog_config) in &self.catalogs { let mut link = Link::child(&catalog_config.href).title(Some(catalog_config.title.clone()));