-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get term fn #1964
Get term fn #1964
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good except the name and that it needs a rebase
@@ -180,6 +180,23 @@ items: Array<TaxonomyTerm>; | |||
|
|||
See the [Taxonomies documentation](@/documentation/templates/taxonomies.md) for a full documentation of those types. | |||
|
|||
### `get_term` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we call it get_taxonomy_term
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll rename in next day or so.
@Keats updated as requested. |
|
||
`lang` (optional) default to `config.default_language` in config.toml | ||
|
||
`include_pages` (optional) default to true. If false, the `pages` item in the `TaxonomyTerm` is replaced with `page_count`, an integer with the number of pages for this term. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at it again, I think page_count
should be additional field that is always passed and this arguments just make pages an empty array.
Thanks! |
* Add new `get_taxonomy_term` global function * Update per @Keats feedback to make `page_count` available all the time.
As discussed in #1897, this adds a new
get_term
global function which returns a singleTaxonomyTerm
item instead of the entire site. In the personal site discussed in that issue, this results in a 4x improvement in rendering speed (5.4s vs 22.1s).Code changes
next
branch?If the change is a new feature or adding to/changing an existing one: