active state macro how to check if segment 2 is empty I'm using a macro to check segment 1 to set an active state on my navigation and all is working correctly. However I would like to change it so that if segment_2 is not empty it doesn't display the active state, with the exception of being pagination in segment-2

so domain.com/photography and domain.com/photography/p2 would get active but domain.com/photography/slug would not be active

my current code is:

macro:

{% macro is_active(segment) %}{% if craft.request.firstSegment == segment %}active{% endif %}{% endmacro %}


and nav:

&lt;ul class="nav navbar-nav"&gt;
  &lt;li class="{{ macro.is_active('') }}"&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li class="{{ macro.is_active('photography') }}"&gt;&lt;a href="/photography"&gt;All Photography&lt;/a&gt;&lt;/li&gt;
  &lt;li class="{{ macro.is_active('calendar') }}"&gt;&lt;a href="/calendar"&gt;Archives&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Not tested, but I think you can test if it is a pagination page. So 

{% if (craft.request.getSegment('2') == '') or (craft.request.getPageNum() != 1) %}active{% endif %}