diff --git a/docs/hugo.yaml b/docs/hugo.yaml index 7074dd8..c9d7fd7 100644 --- a/docs/hugo.yaml +++ b/docs/hugo.yaml @@ -57,6 +57,10 @@ params: # Site metadata description: "actsense is an open-source workflow security auditor. It maps every dependency a CI workflow runs and explains what each one exposes. GitHub Actions is supported today." author: "actsense" + + # Social preview (og:image, twitter:image). Source: scripts/og/og.html + images: + - "og.png" # Navbar navbar: diff --git a/docs/scripts/og/og.html b/docs/scripts/og/og.html new file mode 100644 index 0000000..44b330b --- /dev/null +++ b/docs/scripts/og/og.html @@ -0,0 +1,137 @@ + + + + + +actsense OG image + + + + + +
+
+ Open-source Workflow Security Auditor +

actsense

+

See every dependency your CI workflows run, at the version they run, and what each one exposes.

+
+
actsense.dev
+ + + + diff --git a/docs/scripts/og/render.py b/docs/scripts/og/render.py new file mode 100644 index 0000000..7715b71 --- /dev/null +++ b/docs/scripts/og/render.py @@ -0,0 +1,28 @@ +"""Render og.html to static/og.png at 1200x630. + + python3 docs/scripts/og/render.py + +Needs Playwright (`pip install playwright && playwright install chromium`) +and network access for Google Fonts. +""" +from pathlib import Path + +from playwright.sync_api import sync_playwright + +HERE = Path(__file__).resolve().parent +OUT = HERE.parent.parent / "static" / "og.png" + + +def main() -> None: + with sync_playwright() as p: + browser = p.chromium.launch() + page = browser.new_page(viewport={"width": 1200, "height": 630}) + page.goto((HERE / "og.html").as_uri()) + page.wait_for_selector("body[data-ready='1']") + page.screenshot(path=str(OUT)) + browser.close() + print(f"wrote {OUT}") + + +if __name__ == "__main__": + main() diff --git a/docs/static/og.png b/docs/static/og.png new file mode 100644 index 0000000..0a5ae9b Binary files /dev/null and b/docs/static/og.png differ