---
type: "Source File"
title: "app_path = \"/home/ben/infra/copecheck-cities/templates/base.html\""
description: "app_path = \"/home/ben/infra/copecheck-cities/templates/base.html\" with open(app_path, \"r\") as f: content = f.read() old_nav = \"\"\" <div class=\"nav-links\"> {% for code, info in countries.items() if countries is defined."
resource: "https://cities.copecheck.com"
tags: ["copecheck", "cities", "source-file", "py"]
timestamp: "2026-05-09T17:58:45Z"
site: "cities"
source_path: "copecheck-cities/fix_nav.py"
---

# app_path = "/home/ben/infra/copecheck-cities/templates/base.html"

Source path: `copecheck-cities/fix_nav.py`  
Index snapshot generated: `2026-11-24T13:27:52Z`  
File modified: `2026-05-09T17:58:45Z`

```py
app_path = "/home/ben/infra/copecheck-cities/templates/base.html"
with open(app_path, "r") as f:
    content = f.read()

old_nav = """        <div class="nav-links">
            {% for code, info in countries.items() if countries is defined %}
            <a href="/{{ code }}/">{{ info.flag }} {{ info.name }}</a>
            {% endfor %}
        </div>"""

new_nav = """        <div class="nav-links">
            {% for code, info in countries.items() if countries is defined %}
            <a href="/{{ code }}/">{{ info.flag }} {{ info.name }}</a>
            {% endfor %}
            <a href="/articles/" style="border-left: 1px solid #333; padding-left: 1.5rem;">Articles</a>
        </div>"""

if old_nav in content:
    content = content.replace(old_nav, new_nav)
    with open(app_path, "w") as f:
        f.write(content)
    print("Added Articles link to nav")
else:
    print("ERROR: Could not find nav block")
```
