Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions autohands/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,6 @@ def _render_html(snapshot: dict) -> str:
refreshed_at=snapshot.get("generated") if not snapshot.get("errors") else None,
refresh_url=(f"https://github.com/{gh_owner}/{gh_repo}/actions/workflows/release_board.yml"
if gh_owner and gh_repo else None))
github_link = (f' · <a href="https://github.com/{gh_owner}/{gh_repo}'
'/blob/main/README.md">GitHub Page</a>'
if gh_owner and gh_repo else "")
return t_.section_layout(f"""<!doctype html>
<html lang="en"><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand All @@ -579,7 +576,7 @@ def _render_html(snapshot: dict) -> str:
{panel}
<p class="verdict"><b>{head}</b><span class="muted">{head_age}</span></p>
<p class="muted"><a href="{heart}">Heart</a> ·
<a href="dashboard.md">markdown version</a>{github_link}</p>
<a href="dashboard.md">markdown version</a></p>
<p>{chips}</p>
<h2 id="libraries">Libraries</h2>
<table class="recent">{''.join(lib_rows)}</table>
Expand Down
7 changes: 3 additions & 4 deletions tests/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ def test_badge_shape():
def test_html_is_self_contained():
out = board.render(SNAP, "html")
assert out.lstrip().startswith("<!doctype html>")
# The header links the markdown twin and the repository front door.
assert '<a href="dashboard.md">markdown version</a>' in out
assert ('<a href="https://github.com/SomeOrg/SomeHands/blob/main/'
'README.md">GitHub Page</a>') in out
# Keep the Markdown source without the redundant repository link.
assert 'href="dashboard.md"' in out
assert 'GitHub Page</a>' not in out
# No external ASSETS: no src=, no <link>, no fetches; inline <script> is
# the clipboard buttons; every URL sits in an href (same contract the
# Heart board pins).
Expand Down
Loading