Skip to content

feat: add a GitHub link to the header and make the logo link home - #7

Merged
craigthackerx merged 1 commit into
masterfrom
feat/header-links
Aug 8, 2026
Merged

feat: add a GitHub link to the header and make the logo link home#7
craigthackerx merged 1 commit into
masterfrom
feat/header-links

Conversation

@craigthackerx

Copy link
Copy Markdown

Two small header links.

  • GitHub mark next to the theme toggle, opening libre-devops/security-news.
  • The Libre DevOps logo now opens libredevops.org.

The icon

The official GitHub mark, copied verbatim from primer/octicons icons/mark-github-16.svg. My first pass used the legacy mark from memory, which is not the current one, so the path is now pulled from the canonical source and asserted against it in the test rather than eyeballed.

Inline SVG rather than a file or a remote icon: the CSP is default-src 'self' with img-src 'self' data:, so inlining costs no extra request and needs no CSP change. fill="currentColor" makes it follow the same colour as the controls beside it, so it works in both themes without a second asset.

Styling

The anchor joins the existing #theme-toggle, .rss-button selector lists rather than duplicating their declarations, so it inherits the same chrome, hover and focus treatment. It gets inline-flex centring that a <button> would get for free, and the same 52px circle as the theme toggle.

The logo anchor is inline-flex so wrapping the image does not disturb the header grid (.logo is grid-template-columns: auto 1fr auto, and the anchor simply takes the image's place as the first column).

Both links carry target="_blank", rel="noopener noreferrer" and an aria-label, and both get a visible :focus-visible outline.

Verification

jsdom against the real index.html and styles.css, 30 checks passing. New ones:

PASS GitHub link exists
PASS GitHub link points at the repo
PASS GitHub link has rel=noopener noreferrer
PASS GitHub icon is inline SVG, so no extra request and no CSP issue
PASS GitHub icon path matches the official primer/octicons mark exactly
PASS icon inherits colour, so it works in both themes
PASS GitHub link sits next to the theme toggle
PASS GitHub link is labelled for screen readers
PASS logo is wrapped in a link
PASS logo links to libredevops.org
PASS logo link still wraps the site logo image
PASS logo link is still the direct grid child, so header layout is unchanged

The mark assertion compares the shipped d attribute against a freshly fetched copy of the octicon, so a hand-edit or a stale path would fail the check rather than pass silently.

Two header links. The GitHub mark sits next to the theme toggle and opens the
repository; the Libre DevOps logo now opens libredevops.org.

The icon is the official GitHub mark, copied verbatim from primer/octicons
icons/mark-github-16.svg. Inline SVG rather than a file or a remote icon,
because the CSP is default-src 'self' with img-src 'self' data:, so inlining
costs no extra request and needs no CSP change. fill=currentColor makes it
follow the same colour as the controls beside it in both themes.

Both links get target=_blank with rel=noopener noreferrer and an aria-label.
The GitHub anchor joins the existing #theme-toggle selector lists rather than
duplicating their declarations, so it picks up the same chrome and hover, with
inline-flex centring the button gets for free. The logo anchor is inline-flex
so wrapping the image does not disturb the header grid.

Verified under jsdom: 30 checks, including that the shipped path matches the
official octicons mark byte for byte, that the GitHub link is the theme
toggle's next sibling, and that the logo anchor is still the direct grid child
so the header layout is unchanged.
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@craigthackerx
craigthackerx merged commit f983561 into master Aug 8, 2026
5 checks passed
@craigthackerx
craigthackerx deleted the feat/header-links branch August 8, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant