Browse Source

Fix tests and add taxonomies to changelog

index-subcmd
Vincent Prouillet 7 years ago
parent
commit
021c99c5f0
4 changed files with 9 additions and 8 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +5
    -5
      components/taxonomies/src/lib.rs
  3. +1
    -1
      components/templates/src/global_fns.rs
  4. +2
    -2
      docs/content/documentation/content/tags-categories.md

+ 1
- 0
CHANGELOG.md View File

@@ -4,6 +4,7 @@


- Add `get_taxonomy_url` to retrieve the permalink of a tag/category - Add `get_taxonomy_url` to retrieve the permalink of a tag/category
- Fix bug when generating permalinks for taxonomies - 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) ## 0.2.2 (2017-11-01)




+ 5
- 5
components/taxonomies/src/lib.rs View File

@@ -188,27 +188,27 @@ mod tests {


assert_eq!(tags.items[0].name, "db"); assert_eq!(tags.items[0].name, "db");
assert_eq!(tags.items[0].slug, "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[0].pages.len(), 1);


assert_eq!(tags.items[1].name, "js"); assert_eq!(tags.items[1].name, "js");
assert_eq!(tags.items[1].slug, "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[1].pages.len(), 2);


assert_eq!(tags.items[2].name, "rust"); assert_eq!(tags.items[2].name, "rust");
assert_eq!(tags.items[2].slug, "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!(tags.items[2].pages.len(), 2);


assert_eq!(categories.items[0].name, "Other"); assert_eq!(categories.items[0].name, "Other");
assert_eq!(categories.items[0].slug, "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[0].pages.len(), 1);


assert_eq!(categories.items[1].name, "Programming tutorials"); assert_eq!(categories.items[1].name, "Programming tutorials");
assert_eq!(categories.items[1].slug, "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); assert_eq!(categories.items[1].pages.len(), 1);
} }
} }

+ 1
- 1
components/templates/src/global_fns.rs View File

@@ -179,7 +179,7 @@ mod tests {
let mut args = HashMap::new(); let mut args = HashMap::new();
args.insert("kind".to_string(), to_value("tag").unwrap()); args.insert("kind".to_string(), to_value("tag").unwrap());
args.insert("name".to_string(), to_value("Prog amming").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 // and errors if it can't find it
let mut args = HashMap::new(); let mut args = HashMap::new();
args.insert("kind".to_string(), to_value("tag").unwrap()); args.insert("kind".to_string(), to_value("tag").unwrap());


+ 2
- 2
docs/content/documentation/content/tags-categories.md View File

@@ -15,9 +15,9 @@ are available at the following paths:


```plain ```plain
$BASE_URL/tags/ $BASE_URL/tags/
$BASE_URL/tag/$TAG_SLUG
$BASE_URL/tags/$TAG_SLUG
$BASE_URL/categories/ $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. It is currently not possible to change those paths or to create custom taxonomies.

Loading…
Cancel
Save