Skip to content

Commit f4489ed

Browse files
Fixes
1 parent 28b557a commit f4489ed

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

generate_metadata.py

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

1010
import dacite
1111
from git import Repo
12-
from jinja2 import Template
12+
from jinja2 import Environment, FileSystemLoader
1313
from urllib3 import request
1414

1515
import build_warnings
@@ -55,7 +55,7 @@ def get_language_repo_and_completion(
5555
if __name__ == '__main__':
5656
logging.basicConfig(level=logging.INFO)
5757
logging.info(f'starting at {generation_time}')
58-
template = Template(Path('templates/metadata.html.jinja').read_text())
58+
env = Environment(loader=FileSystemLoader('templates'))
5959
if (index_path := Path('build/index.json')).exists():
6060
index_json = loads(Path('build/index.json').read_text())
6161
else:
@@ -65,7 +65,7 @@ def get_language_repo_and_completion(
6565
dacite.from_dict(LanguageProjectData, project) for project in index_json
6666
]
6767

68-
output = template.render(
68+
output = env.get_template('metadata.html.jinja').render(
6969
metadata=zip(completion_progress, get_projects_metadata(completion_progress)),
7070
generation_time=generation_time,
7171
duration=(datetime.now(timezone.utc) - generation_time).seconds,

src/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ a {
1717
}
1818

1919
a:hover {
20-
color: #fe6615;
20+
color: #1595fe;
2121
}
2222

2323
/* NAVAR
@@ -91,7 +91,7 @@ th, td {
9191
white-space: nowrap;
9292
}
9393
th {
94-
background-color: #f4f4f4;
94+
background-color: #d6d6d6;
9595
}
9696
hr {
9797
color: #f4f4f4;

templates/base.html.jinja

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
<div class="navbar-brand">
2121
<a href="./" style="all: unset; cursor: pointer;">
22-
<img src="logo.png" style="height: 2rem;" alt="Translation dashboard">
23-
<span style="font-size: 1.25rem; font-weight: bold;">Docs Translation Dashboard</span>
22+
<img src="logo.png" style="height: 2rem;" alt="">
23+
<span style="font-size: 1.25rem; font-weight: bold;">Translation Dashboard</span>
2424
</a>
2525
</div>
2626

@@ -33,13 +33,13 @@
3333
<div class="collapse navbar-collapse" id="navbarNavDropdown">
3434
<ul class="navbar-nav mr-auto">
3535
<li class="nav-item">
36-
<a class="nav-link" href="https://devguide.python.org/">Translating</a>
36+
<a class="nav-link" href="chart.html">Chart</a>
3737
</li>
3838
<li class="nav-item">
3939
<a class="nav-link" href="metadata.html">Metadata</a>
4040
</li>
4141
<li class="nav-item">
42-
<a class="nav-link" href="chart.html">Chart</a>
42+
<a class="nav-link" href="https://devguide.python.org/documentation/translations/translating/">Devguide ❯ Translating</a>
4343
</li>
4444
</ul>
4545
</div>
@@ -53,6 +53,17 @@
5353

5454
</body>
5555

56+
<script>
57+
function padnavbar() {
58+
const navbar = document.querySelector('.navbar.fixed-top');
59+
if (navbar) {
60+
document.body.style.paddingTop = (navbar.offsetHeight + 10) + 'px';
61+
}
62+
}
63+
window.addEventListener('load', padnavbar);
64+
window.addEventListener('resize', padnavbar);
65+
</script>
66+
5667
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
5768
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
5869
crossorigin="anonymous">

templates/index.html.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div>
55
<div class="row">
66
{% for project in completion_progress | sort(attribute='completion,translators.number') | reverse %}
7-
<div class="col-sm-6 col-md-4 col-lg-3 d-flex">
7+
<div class="col-12 col-sm-6 col-md-4 d-flex">
88
<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>

0 commit comments

Comments
 (0)