You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

taxonomies.md 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. +++
  2. title = "Taxonomies"
  3. weight = 40
  4. +++
  5. Gutenberg will look up the following files in the `templates` directory:
  6. - `$TAXONOMY_NAME/single.html`
  7. - `$TAXONOMY_NAME/list.html`
  8. First, a `TaxonomyTerm` has the following fields:
  9. ```ts
  10. name: String;
  11. slug: String;
  12. permalink: String;
  13. pages: Array<Page>;
  14. ```
  15. ## Non-paginated taxonomies
  16. If a taxonomy is not paginated, the templates get the following variables:
  17. ### Single term (`single.html`)
  18. ```ts
  19. // The site config
  20. config: Config;
  21. // The data of the taxonomy, from the config
  22. taxonomy: TaxonomyConfig;
  23. // The current full permalink for that page
  24. current_url: String;
  25. // The current path for that page
  26. current_path: String;
  27. // The current term being rendered
  28. term: TaxonomyTerm;
  29. ```
  30. ### Taxonomy list (`list.html`)
  31. ```ts
  32. // The site config
  33. config: Config;
  34. // The data of the taxonomy, from the config
  35. taxonomy: TaxonomyConfig;
  36. // The current full permalink for that page
  37. current_url: String;
  38. // The current path for that page
  39. current_path: String;
  40. // All terms for that taxonomy
  41. terms: Array<TaxonomyTerm>;
  42. ```
  43. ## Paginated taxonomies