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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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, `TaxonomyTerm` has the following fields:
  9. ```ts
  10. name: String;
  11. slug: String;
  12. permalink: String;
  13. pages: Array<Page>;
  14. ```
  15. and `TaxonomyConfig` has the following fields:
  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 gets 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. // The lang of the current page
  37. lang: String;
  38. ```
  39. ### Single term (`single.html`)
  40. ```ts
  41. // The site config
  42. config: Config;
  43. // The data of the taxonomy, from the config
  44. taxonomy: TaxonomyConfig;
  45. // The current full permalink for that page
  46. current_url: String;
  47. // The current path for that page
  48. current_path: String;
  49. // The current term being rendered
  50. term: TaxonomyTerm;
  51. // The lang of the current page
  52. lang: String;
  53. ```
  54. A paginated taxonomy term will also get a `paginator` variable; see the [pagination page]
  55. (@/documentation/templates/pagination.md) for more details.