Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromedockes committed Jul 30, 2024
1 parent 3d3acdd commit 595a740
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- name: Install dependencies
run: |
pip install "git+https://github.com/skrub-data/skrub.git@main"
pip install $(realpath "./skrub.whl")
- name: Build the site
run: |
Expand Down
2 changes: 1 addition & 1 deletion _includes/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ul class="nav">
{% for name, href in nav_links %}
<li {% if href == current_page %} class="current-page" {% endif %}>
<a href="{{ href }}">{{ name }}</a>
<a href="{{ '../' + href if 'examples' in current_page else href }}">{{ name }}</a>
</li>
{% endfor %}
</ul>
Expand Down
10 changes: 5 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def add_report(df, name):
| TEMPLATE_DATA
| {
"nav_links": TEMPLATE_DATA["nav_links"]
+ [(name, f"/examples/{name}.html")]
+ [(name, f"examples/{name}.html")]
}
| {"current_page": f"/examples/{name}.html"}
| {"current_page": f"examples/{name}.html"}
)
html = bust(html)
(EXAMPLES_DIR / f"{name}.html").write_text(html, "utf-8")
Expand All @@ -89,7 +89,7 @@ def build_pages():
all_pages = REPO.glob("*.html")
for page in all_pages:
template = ENV.get_template(page.name)
rendered = template.render(TEMPLATE_DATA | {"current_page": f"/{page.name}"})
rendered = template.render(TEMPLATE_DATA | {"current_page": f"{page.name}"})
rendered = bust(rendered)
(BUILD_DIR / page.name).write_text(rendered, "utf-8")

Expand All @@ -113,7 +113,7 @@ def build_examples():
html = examples_index.render(
{"report_names": [name for _, name in datasets]}
| TEMPLATE_DATA
| {"current_page": "/examples/index.html"}
| {"current_page": "examples/index.html"}
)
html = bust(html)
(EXAMPLES_DIR / "index.html").write_text(html, "utf-8")
Expand All @@ -139,7 +139,7 @@ def build_examples():

ENV = get_jinja_env()
TEMPLATE_DATA = {
"nav_links": [("Demo", "/index.html"), ("Examples", "/examples/index.html")]
"nav_links": [("Demo", "index.html"), ("Examples", "examples/index.html")]
}

build_pages()
Expand Down
1 change: 1 addition & 0 deletions skrub.whl

0 comments on commit 595a740

Please sign in to comment.