Categories/tags with filter buttons on homepage #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A large collection of notebooks needs a taxonomy to improve user navigation and content discovery. Several approaches could be proposed for this (tree-based hierarchies, tags, etc.).
I chose to add a "category" attribute in
_data/gallery.yaml
(the notebook metadata). In my example, each of the notebook receives 2 "categories" (or tags) — based on the Monty Python group which gave Python its name.On the home page, a list of buttons shows the available categories. A click on one of them restrict the list of displayed notebooks to those which are associated with this attribute. The filtering was made using a simple javascript tutorial from w3schools, hence the name of the functions. A "show all" button rests on the left of all the categories (I forgot to put it in English).
A live demo of this is displayed on my test website: http://microlearning.fournier-sniehotta.fr/testfiltresvoila/
Possible improvements: