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

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