Skip to content

Commit 698ac63

Browse files
committed
Update script and fix sponsors image display
1 parent 7783c89 commit 698ac63

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

web/pandas/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ <h5>With the support of:</h5>
4949
<div class="col-6 col-md-2 d-flex align-items-center justify-content-center">
5050
{% if company %}
5151
<a href="{{ company.url }}" target="_blank">
52-
<img class="img-fluid w-100" alt="{{ company.name }}" src="{{ base_url }}{{ company.logo }}"/>
52+
<img class="img-fluid" alt="{{ company.name }}" src="{{ base_url }}{{ company.logo }}" width="150px"/>
5353
</a>
5454
{% endif %}
5555
</div>

web/pandas_web.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -536,29 +536,28 @@ def main(
536536
f"Invalid versions.json: {e}. Ensure it is valid JSON."
537537
) from e
538538

539-
config_fname = source_path / "config.yml"
540-
541539
shutil.rmtree(target_path, ignore_errors=True)
542540
os.makedirs(target_path, exist_ok=True)
543541

544542
sys.stderr.write("Generating context...\n")
545543
context = get_context(
546-
os.path.join(source_path, "config.yml"),
544+
pathlib.Path(source_path, "config.yml"),
547545
target_path=target_path,
548546
)
549547
sys.stderr.write("Context generated\n")
550548

551549
templates_path = source_path / context["main"]["templates_path"]
552550
jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader(templates_path))
553-
for fname in get_source_files(source_path):
551+
for pathname in get_source_files(source_path):
552+
fname = str(pathname)
554553
context["lang"] = fname[0:2] if fname[2] == "/" else "en"
555-
if fname.as_posix() in context["main"]["ignore"]:
554+
if pathname.as_posix() in context["main"]["ignore"]:
556555
continue
557556
sys.stderr.write(f"Processing {fname}\n")
558-
dirname = fname.parent
557+
dirname = pathname.parent
559558
(target_path / dirname).mkdir(parents=True, exist_ok=True)
560559

561-
extension = fname.suffix
560+
extension = pathname.suffix
562561
if extension in (".html", ".md"):
563562
with (source_path / fname).open(encoding="utf-8") as f:
564563
content = f.read()
@@ -575,9 +574,9 @@ def main(
575574
# Python-Markdown doesn't let us config table attributes by hand
576575
body = body.replace("<table>", '<table class="table table-bordered">')
577576
content = extend_base_template(body, context["main"]["base_template"])
578-
context["base_url"] = "../" * (len(fname.parents) - 1)
577+
context["base_url"] = "../" * (len(pathname.parents) - 1)
579578
content = jinja_env.from_string(content).render(**context)
580-
fname_html = fname.with_suffix(".html").name
579+
fname_html = pathname.with_suffix(".html").name
581580
with (target_path / dirname / fname_html).open("w", encoding="utf-8") as f:
582581
f.write(content)
583582
else:

0 commit comments

Comments
 (0)