Skip to content

Commit eaf4773

Browse files
Clean up
1 parent aa30c9f commit eaf4773

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

.github/workflows/update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ jobs:
5454
if: github.event_name == 'pull_request'
5555
run: |
5656
curl -Lo index.html-public https://github.com/python-docs-translations/dashboard/raw/refs/heads/gh-pages/index.html
57-
diff --color=always -u index.html-public index.html || :
58-
cat index.html
57+
diff --color=always -u index.html-public build/index.html || :
58+
cat build/index.html
5959
- run: uv run generate_metadata.py # generates metadata.html
6060
- run: cp metadata.html warnings* build
6161
- name: Deploy metadata view 🚀

generate.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import build_status
1616
import contribute
1717
from completion import branches_from_devguide, get_completion, TranslatorsData
18-
from counts import get_counts
1918
from repositories import Language, get_languages_and_repos
2019

2120
generation_time = datetime.now(timezone.utc)
@@ -114,12 +113,9 @@ class LanguageProjectData:
114113
)
115114

116115
lang_template = env.get_template('language.html.jinja')
117-
for language_data in completion_progress:
118-
language = language_data.language
119-
code = language.code
120-
121-
html = lang_template.render(language=language_data)
122-
116+
for project in completion_progress:
117+
code = project.language.code
118+
html = lang_template.render(project=project)
123119
Path(f'build/{code}.html').write_text(html)
124120

125121
Path('build/style.css').write_bytes(Path('src/style.css').read_bytes())

templates/base.html.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="utf-8">
6-
{# <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">#}
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
77
<meta name="description" content="">
88
<meta name="author" content="">
99

@@ -29,10 +29,10 @@
2929
<a class="nav-link" href="https://devguide.python.org/">Translating</a>
3030
</li>
3131
<li class="nav-item">
32-
<a class="nav-link" href="/metadata.html">Metadata</a>
32+
<a class="nav-link" href="metadata.html">Metadata</a>
3333
</li>
3434
<li class="nav-item">
35-
<a class="nav-link" href="/chart.html">Chart</a>
35+
<a class="nav-link" href="chart.html">Chart</a>
3636
</li>
3737
</ul>
3838
</div>

templates/index.html.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="row">
66
{% for project in completion_progress | sort(attribute='completion,translators.number') | reverse %}
77
<div class="col-sm-6 col-md-4 col-lg-3 d-flex">
8-
<a href="/{{ project.language.code }}.html" class="card mb-3 w-100">
8+
<a href="{{ project.language.code }}.html" class="card mb-3 w-100">
99
<div class="card-body">
1010
<h5 class="card-title">{{ project.language.name }} ({{ project.language.code }})</h5>
1111
<h6 class="card-subtitle mb-2 text-muted">Completion: {{ '{:.2f}%'.format(project.completion) }}</h6>

templates/language.html.jinja

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{% extends "base.html.jinja" %}
22

33
{% block main %}
4-
<h1>{{ language.name }}</h1>
4+
{% if project.built %}
5+
<h1><a href="https://docs.python.org/{{ project.language.code }}/3">{{ project.language.name }}</a></h1>
6+
{% else %}
7+
<h1>{{ project.language.name }}</h1>
8+
{% endif %}
59
{% endblock %}

0 commit comments

Comments
 (0)