Link Active

By Jack McDade

Set the href for an anchor link and add an active class if on that URL.

Usage

<a {{ link_active url="/about" }}>About</a>

// Renders (when on /about)
<a href="/about" class="active">About</a>

Parameters

  • url (any URL)
  • class (active)