Using Nunjucks ‘If Expressions’ in 11ty to create a simple active navigation state

In this tutorial, we’ll set up a simple navigation, identify what page navigation item we need to activate based on URL parts and add an active class to that element with no need of an if tag


This content originally appeared on Bryan Robinson's Blog and was authored by Bryan Robinson's Blog

In this tutorial, we'll set up a simple navigation, identify what page navigation item we need to activate based on URL parts and add an active class to that element with no need of an if tag


This content originally appeared on Bryan Robinson's Blog and was authored by Bryan Robinson's Blog


Print Share Comment Cite Upload Translate Updates
APA

Bryan Robinson's Blog | Sciencx (2024-11-04T19:18:27+00:00) Using Nunjucks ‘If Expressions’ in 11ty to create a simple active navigation state. Retrieved from https://www.scien.cx/2024/11/04/using-nunjucks-if-expressions-in-11ty-to-create-a-simple-active-navigation-state-2/

MLA
" » Using Nunjucks ‘If Expressions’ in 11ty to create a simple active navigation state." Bryan Robinson's Blog | Sciencx - Monday November 4, 2024, https://www.scien.cx/2024/11/04/using-nunjucks-if-expressions-in-11ty-to-create-a-simple-active-navigation-state-2/
HARVARD
Bryan Robinson's Blog | Sciencx Monday November 4, 2024 » Using Nunjucks ‘If Expressions’ in 11ty to create a simple active navigation state., viewed ,<https://www.scien.cx/2024/11/04/using-nunjucks-if-expressions-in-11ty-to-create-a-simple-active-navigation-state-2/>
VANCOUVER
Bryan Robinson's Blog | Sciencx - » Using Nunjucks ‘If Expressions’ in 11ty to create a simple active navigation state. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/11/04/using-nunjucks-if-expressions-in-11ty-to-create-a-simple-active-navigation-state-2/
CHICAGO
" » Using Nunjucks ‘If Expressions’ in 11ty to create a simple active navigation state." Bryan Robinson's Blog | Sciencx - Accessed . https://www.scien.cx/2024/11/04/using-nunjucks-if-expressions-in-11ty-to-create-a-simple-active-navigation-state-2/
IEEE
" » Using Nunjucks ‘If Expressions’ in 11ty to create a simple active navigation state." Bryan Robinson's Blog | Sciencx [Online]. Available: https://www.scien.cx/2024/11/04/using-nunjucks-if-expressions-in-11ty-to-create-a-simple-active-navigation-state-2/. [Accessed: ]
rf:citation
» Using Nunjucks ‘If Expressions’ in 11ty to create a simple active navigation state | Bryan Robinson's Blog | Sciencx | https://www.scien.cx/2024/11/04/using-nunjucks-if-expressions-in-11ty-to-create-a-simple-active-navigation-state-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.