From 021c99c5f054e374a5d136670648a950ae5ca189 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Mon, 20 Nov 2017 19:22:04 +0100 Subject: [PATCH] Fix tests and add taxonomies to changelog --- CHANGELOG.md | 1 + components/taxonomies/src/lib.rs | 10 +++++----- components/templates/src/global_fns.rs | 2 +- docs/content/documentation/content/tags-categories.md | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b01d5d1c..4e2f4189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Add `get_taxonomy_url` to retrieve the permalink of a tag/category - Fix bug when generating permalinks for taxonomies +- Change names of individual taxonomies to be plural (ie `tags/my-tag` instead of `tag/my-tag`) ## 0.2.2 (2017-11-01) diff --git a/components/taxonomies/src/lib.rs b/components/taxonomies/src/lib.rs index 3745e591..e85eb6c1 100644 --- a/components/taxonomies/src/lib.rs +++ b/components/taxonomies/src/lib.rs @@ -188,27 +188,27 @@ mod tests { assert_eq!(tags.items[0].name, "db"); assert_eq!(tags.items[0].slug, "db"); - assert_eq!(tags.items[0].permalink, "http://a-website.com/tag/db/"); + assert_eq!(tags.items[0].permalink, "http://a-website.com/tags/db/"); assert_eq!(tags.items[0].pages.len(), 1); assert_eq!(tags.items[1].name, "js"); assert_eq!(tags.items[1].slug, "js"); - assert_eq!(tags.items[1].permalink, "http://a-website.com/tag/js/"); + assert_eq!(tags.items[1].permalink, "http://a-website.com/tags/js/"); assert_eq!(tags.items[1].pages.len(), 2); assert_eq!(tags.items[2].name, "rust"); assert_eq!(tags.items[2].slug, "rust"); - assert_eq!(tags.items[2].permalink, "http://a-website.com/tag/rust/"); + assert_eq!(tags.items[2].permalink, "http://a-website.com/tags/rust/"); assert_eq!(tags.items[2].pages.len(), 2); assert_eq!(categories.items[0].name, "Other"); assert_eq!(categories.items[0].slug, "other"); - assert_eq!(categories.items[0].permalink, "http://a-website.com/category/other/"); + assert_eq!(categories.items[0].permalink, "http://a-website.com/categories/other/"); assert_eq!(categories.items[0].pages.len(), 1); assert_eq!(categories.items[1].name, "Programming tutorials"); assert_eq!(categories.items[1].slug, "programming-tutorials"); - assert_eq!(categories.items[1].permalink, "http://a-website.com/category/programming-tutorials/"); + assert_eq!(categories.items[1].permalink, "http://a-website.com/categories/programming-tutorials/"); assert_eq!(categories.items[1].pages.len(), 1); } } diff --git a/components/templates/src/global_fns.rs b/components/templates/src/global_fns.rs index 41437f09..44284ff8 100644 --- a/components/templates/src/global_fns.rs +++ b/components/templates/src/global_fns.rs @@ -179,7 +179,7 @@ mod tests { let mut args = HashMap::new(); args.insert("kind".to_string(), to_value("tag").unwrap()); args.insert("name".to_string(), to_value("Prog amming").unwrap()); - assert_eq!(static_fn(args).unwrap(), "http://a-website.com/tag/prog-amming/"); + assert_eq!(static_fn(args).unwrap(), "http://a-website.com/tags/prog-amming/"); // and errors if it can't find it let mut args = HashMap::new(); args.insert("kind".to_string(), to_value("tag").unwrap()); diff --git a/docs/content/documentation/content/tags-categories.md b/docs/content/documentation/content/tags-categories.md index 43ecaddf..20eae9e8 100644 --- a/docs/content/documentation/content/tags-categories.md +++ b/docs/content/documentation/content/tags-categories.md @@ -15,9 +15,9 @@ are available at the following paths: ```plain $BASE_URL/tags/ -$BASE_URL/tag/$TAG_SLUG +$BASE_URL/tags/$TAG_SLUG $BASE_URL/categories/ -$BASE_URL/category/$CATEGORY_SLUG +$BASE_URL/categories/$CATEGORY_SLUG ``` It is currently not possible to change those paths or to create custom taxonomies.