You can move the ```{% set title = ... %}``` blocks out of the if statements for ```extensions``` and ```theme``` since they are the same.

```
{% else %}
  {% set title = ... %}
  {% if section == 'extensions' %}
    {% set section_name = ... %}
  {% elif section == 'themes' %}
    {% set section_name = ... %}
  ...
```