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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. ### Taxonomy list (`list.html`)
  24. This template is never paginated and therefore get the following variables in all cases.
  25. ```ts
  26. // The site config
  27. config: Config;
  28. // The data of the taxonomy, from the config
  29. taxonomy: TaxonomyConfig;
  30. // The current full permalink for that page
  31. current_url: String;
  32. // The current path for that page
  33. current_path: String;
  34. // All terms for that taxonomy
  35. terms: Array<TaxonomyTerm>;
  36. ```
  37. ### Single term (`single.html`)
  38. ```ts
  39. // The site config
  40. config: Config;
  41. // The data of the taxonomy, from the config
  42. taxonomy: TaxonomyConfig;
  43. // The current full permalink for that page
  44. current_url: String;
  45. // The current path for that page
  46. current_path: String;
  47. // The current term being rendered
  48. term: TaxonomyTerm;
  49. ```
  50. A paginated taxonomy term will also get a `paginator` variable, see the [pagination page](./documentation/templates/pagination.md)
  51. for more details on that.