I think it's a good idea to move this block to its own template. Something like `keyword-block.html`. Then include it here:
```django
{% include 'keyword-block.html' %}
```