{if $paginator->getLastPage() > 1}
    {default $customCSS = 'blue'}
    {default $adjacents = 3}
    <nav class="ink-navigation">
        <ul class="pagination {$customCSS}">
        {if $paginator->isFirst()}
            <li class="disabled"><a href="#">{_}previous{/_}</a></li>
        {else}
            <li><a href="{$url|replace: '%d', $paginator->getPage() - 1}">{_}previous{/_}</a></li>
        {/if}
        <!-- not enough pages to bother breaking it up -->
        {if $paginator->getLastPage() < 7 + ( $adjacents * 2 )}
            {for $i = 1; $i <= $paginator->getLastPage(); $i++}
                <li n:class="$i == $paginator->getPage() ? active"><a href="{$url|replace: '%d', $i}">{$i}</a></li>
            {/for}
        {elseif $paginator->getLastPage() >= 7 + ( $adjacents * 2 )}
            <!-- close to beginning; only hide later pages -->
            {if $paginator->getPage() < 1 + ( $adjacents * 3 ) }
                {for $i = 1; $i <= 4 + ( $adjacents * 2 ); $i++}
                    <li n:class="$i == $paginator->getPage() ? active"><a href="{$url|replace: '%d', $i}">{$i}</a></li>
                {/for}
                <li style="background-color: transparent;">...</li>
                <li><a href="{$url|replace: '%d', $paginator->getLastPage() - 1}">{$paginator->getLastPage() - 1}</a></li>
                <li><a href="{$url|replace: '%d', $paginator->getLastPage()}">{$paginator->getLastPage()}</a></li>
            <!-- in middle; hide some front and some back -->
            {elseif $paginator->getLastPage() - ( $adjacents * 2 ) > $paginator->getPage() && $paginator->getPage() > ( $adjacents * 2 )}
                <li><a href="{$url|replace: '%d', 1}">1</a></li>
                <li><a href="{$url|replace: '%d', 2}">2</a></li>
                <li style="background-color: transparent;">...</li>
                {for $i = $paginator->getPage() - $adjacents; $i <= $paginator->getPage() + $adjacents; $i++}
                <li n:class="$i == $paginator->getPage() ? active"><a href="{$url|replace: '%d', $i}">{$i}</a></li>
                {/for}
                <li style="background-color: transparent;">...</li>
                <li><a href="{$url|replace: '%d', $paginator->getLastPage() - 1}">{$paginator->getLastPage() - 1}</a></li>
                <li><a href="{$url|replace: '%d', $paginator->getLastPage()}">{$paginator->getLastPage()}</a></li>
            <!-- close to end; only hide early pages -->
            {else}
                <li><a href="{$url|replace: '%d', 1}">1</a></li>
                <li><a href="{$url|replace: '%d', 2}">2</a></li>
                <li style="background-color: transparent;">...</li>
                {for $i = $paginator->getLastPage() - ( 1 + ( $adjacents * 3 ) ); $i <= $paginator->getLastPage(); $i++}
                    <li n:class="$i == $paginator->getPage() ? active"><a href="{$url|replace: '%d', $i}">{$i}</a></li>
                {/for}
            {/if}
        {/if}
        {if $paginator->isLast()}
            <li class="disabled"><a href="#">{_}next{/_}</a></li>
        {else}
            <li><a href="{$url|replace: '%d', $paginator->getPage() + 1}">{_}next{/_}</a></li>
        {/if}
        </ul>
    </nav>
{/if}
