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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. +++
  2. title = "Taxonomies"
  3. weight = 40
  4. +++
  5. Zola 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. and a `TaxonomyConfig`:
  16. ```ts
  17. name: String,
  18. slug: String,
  19. paginate_by: Number?;
  20. paginate_path: String?;
  21. rss: Bool;
  22. ```
  23. ```
  24. ### Taxonomy list (`list.html`)
  25. This template is never paginated and therefore get the following variables in all cases.
  26. ```ts
  27. // The site config
  28. config: Config;
  29. // The data of the taxonomy, from the config
  30. taxonomy: TaxonomyConfig;
  31. // The current full permalink for that page
  32. current_url: String;
  33. // The current path for that page
  34. current_path: String;
  35. // All terms for that taxonomy
  36. terms: Array<TaxonomyTerm>;
  37. ```
  38. ### Single term (`single.html`)
  39. ```ts
  40. // The site config
  41. config: Config;
  42. // The data of the taxonomy, from the config
  43. taxonomy: TaxonomyConfig;
  44. // The current full permalink for that page
  45. current_url: String;
  46. // The current path for that page
  47. current_path: String;
  48. // The current term being rendered
  49. term: TaxonomyTerm;
  50. ```
  51. A paginated taxonomy term will also get a `paginator` variable, see the [pagination page](./documentation/templates/pagination.md)
  52. for more details on that.