Skip to content
Closed
2 changes: 2 additions & 0 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ class LanguageProjectData:
generation_time=generation_time,
duration=(datetime.now(timezone.utc) - generation_time).seconds,
)
related = env.get_template('related.html.jinja').render()

Path('build/style.css').write_bytes(Path('src/style.css').read_bytes())
Path('build/logo.png').write_bytes(Path('src/logo.png').read_bytes())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated thought: use shutil.copyfile('src/logo.png', 'build/logo.png')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, 3.14 allows us to stay with pathlib for the copy, let's try to switch to 3.14? πŸ‘€

Copy link
Collaborator

@merwok merwok Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use a Path object when there is no path manipulation at all? The string paths are already in the source; use shutil and let the kernel do the copy of bytes instead of Python πŸ™‚

(This is extremeley minor relative to the times of cloning and building.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pathlib uses shutil underneath, it's only the matter of abstractions as far as I'm concerned. Though I will change to shutil to let use earlier Python versions than 3.14. πŸ‘

Path('build/index.html').write_text(index)
Path('build/related.html').write_text(related)

Path('build/index.json').write_text(
json.dumps([asdict(project) for project in completion_progress], indent=2)
Expand Down
10 changes: 9 additions & 1 deletion templates/base.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="navbar-brand">
<a href="./">
<img src="logo.png" style="height: 2rem;" alt="Python logo">
<span style="font-size: 1.25rem; font-weight: 700; color: #4a4a4a">Translation Dashboard</span>
<span style="font-size: 1.25rem; font-weight: 700; color: #4a4a4a">Documentation Translations</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will now cause wrapping on small screens, e.g.:

Image

So, I'd suggest either adding CSS that centres the hamburger, or maybe just "Docs Translations"?

</a>
</div>

Expand Down Expand Up @@ -49,6 +49,14 @@
Translating
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="related.html">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 20 20" fill="currentColor" >
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5C10.6193 5.5 9.5 6.61929 9.5 8C9.5 8.52754 9.6634 9.01692 9.94235 9.42029L7.67642 12.5926C7.46128 12.5323 7.23441 12.5 7 12.5C5.61929 12.5 4.5 13.6193 4.5 15C4.5 16.3807 5.61929 17.5 7 17.5C8.38071 17.5 9.5 16.3807 9.5 15C9.5 14.2156 9.13872 13.5155 8.57348 13.0572L10.6724 10.1187C11.0571 10.3603 11.5122 10.5 12 10.5C12.4877 10.5 12.9428 10.3603 13.3275 10.1188L15.4264 13.0573C14.8612 13.5156 14.5 14.2156 14.5 15C14.5 16.3807 15.6193 17.5 17 17.5C18.3807 17.5 19.5 16.3807 19.5 15C19.5 13.6193 18.3807 12.5 17 12.5C16.7655 12.5 16.5386 12.5323 16.3234 12.5926L14.0575 9.42045C14.3366 9.01706 14.5 8.52761 14.5 8C14.5 6.61929 13.3807 5.5 12 5.5ZM10.5 8C10.5 7.17157 11.1716 6.5 12 6.5C12.8284 6.5 13.5 7.17157 13.5 8C13.5 8.82843 12.8284 9.5 12 9.5C11.1716 9.5 10.5 8.82843 10.5 8ZM5.5 15C5.5 14.1716 6.17157 13.5 7 13.5C7.82843 13.5 8.5 14.1716 8.5 15C8.5 15.8284 7.82843 16.5 7 16.5C6.17157 16.5 5.5 15.8284 5.5 15ZM17 13.5C16.1716 13.5 15.5 14.1716 15.5 15C15.5 15.8284 16.1716 16.5 17 16.5C17.8284 16.5 18.5 15.8284 18.5 15C18.5 14.1716 17.8284 13.5 17 13.5Z"/>
</svg>
Related projects
</a>
</li>
</ul>
</div>
</nav>
Expand Down
12 changes: 12 additions & 0 deletions templates/related.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "base.html.jinja" %}

{% block main %}
<p>Related projects:</p>
<ul>
<li><a href="https://hosted.weblate.org/projects/pypa/packaging-python-org/#information" target="_blank">packaging.python.org translation</a></li>
<li><a href="https://hosted.weblate.org/projects/pypa/warehouse/#information" target="_blank">PyPI (Warehouse) translation</a></li>
<li><a href="https://scientific-python-translations.github.io/status/" target="_blank">Scientific Python Translations</a></li>
<li><a href="https://microbit.org/translate/" target="_blank">micro:bit translation programme</a></li>
<li><a href="https://docs.djangoproject.com/en/dev/internals/contributing/localizing/" target="_blank">Localizing Django</a></li>
</ul>
{% endblock %}
Loading