<aclass="nav-link {% if request.path.endswith('/posts') %}active"href="{{request.path}}"{%else%}"href="{{request.path.replace('/comments','/posts')}}"{%endif%}>
<aclass="nav-link {% if request.path.endswith('/comments') %}active"href="{{request.path}}"{%else%}"href="{{request.path.replace('/posts','/comments')}}"{%endif%}>