Skip to content

Commit db098b1

Browse files
Rename Metadata to Build details (#110)
* Rename metadata to build-details
1 parent f1f8527 commit db098b1

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.github/workflows/update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ jobs:
5656
curl -Lo index.html-public https://github.com/python-docs-translations/dashboard/raw/refs/heads/gh-pages/index.html
5757
diff --color=always -u index.html-public build/index.html || :
5858
cat build/index.html
59-
- run: uv run generate_metadata.py # generates metadata.html
60-
- name: Deploy metadata view 🚀
59+
- run: uv run generate_build_details.py # generates build-details.html
60+
- name: Deploy build details view 🚀
6161
if: github.event_name != 'pull_request'
6262
uses: JamesIves/github-pages-deploy-action@v4
6363
with:

generate_metadata.py renamed to generate_build_details.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
generation_time = datetime.now(timezone.utc)
2121

2222

23-
def get_projects_metadata(
23+
def get_projects_build_details(
2424
completion_progress: Sequence[LanguageProjectData],
2525
) -> Iterator[tuple[int, int, datetime | None]]:
2626
with concurrent.futures.ProcessPoolExecutor() as executor:
2727
return executor.map(
28-
get_metadata,
28+
get_build_details,
2929
*zip(*map(get_language_repo_and_completion, completion_progress)),
3030
itertools.repeat(Path('clones')),
3131
)
3232

3333

34-
def get_metadata(
34+
def get_build_details(
3535
language: Language, repo: str | None, completion: float, clones_dir: str
3636
) -> tuple[int, int, datetime | None]:
3737
if not repo or not (repo_path := Path(clones_dir, 'translations', repo)).exists():
@@ -65,10 +65,12 @@ def get_language_repo_and_completion(
6565
dacite.from_dict(LanguageProjectData, project) for project in index_json
6666
]
6767

68-
output = env.get_template('metadata.html.jinja').render(
69-
metadata=zip(completion_progress, get_projects_metadata(completion_progress)),
68+
output = env.get_template('build-details.html.jinja').render(
69+
build_details=zip(
70+
completion_progress, get_projects_build_details(completion_progress)
71+
),
7072
generation_time=generation_time,
7173
duration=(datetime.now(timezone.utc) - generation_time).seconds,
7274
)
7375

74-
Path('build/metadata.html').write_text(output)
76+
Path('build/build-details.html').write_text(output)

templates/base.html.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<div class="collapse navbar-collapse" id="navbarNavDropdown">
3333
<ul class="navbar-nav mr-auto">
3434
<li class="nav-item">
35-
<a class="nav-link" href="metadata.html">Metadata</a>
35+
<a class="nav-link" href="build-details.html">🛠️ Build details</a>
3636
</li>
3737
<li class="nav-item">
3838
<a class="nav-link" href="https://devguide.python.org/documentation/translations/translating/">🔗 Translating</a>

templates/metadata.html.jinja renamed to templates/build-details.html.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</tr>
1313
</thead>
1414
<tbody>
15-
{% for project, metadata in metadata | sort(attribute='0.completion') | reverse %}
15+
{% for project, metadata in build_details | sort(attribute='0.completion') | reverse %}
1616
<tr>
1717
<td data-label="language">{{ project.language.name }} ({{ project.language.code }})</td>
1818
<td data-label="branch">{{ project.branch }}</td>

0 commit comments

Comments
 (0)