Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embeddable SVG status badges 📛 #26

Open
JamieSlome opened this issue Feb 13, 2024 · 2 comments
Open

Embeddable SVG status badges 📛 #26

JamieSlome opened this issue Feb 13, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@JamieSlome
Copy link
Collaborator

Suggested improvements 🔨

As page-speed.dev serves as a performance and usability metric for websites, web developers and site owners should be able to transparently share their scores via an embeddable HTML element or Markdown badge.

Requirements 📏

  1. The badge should be able to present real-time (or close to real-time via cache) scores for Lighthouse and Core Web Vitals
  2. The status badge should be embeddable as an HTML element or Markdown image
  3. Customisability over the contents of the badge, i.e. choose to display Lighthouse or Core Web Vitals, or both

Considerations 💭

This is fairly similar to the OpenGraph code and infrastructure in place; perhaps we could re-use to support the implementation of status badges and embeddable elements.

@JamieSlome JamieSlome added the enhancement New feature or request label Feb 13, 2024
@JamieSlome JamieSlome self-assigned this Feb 14, 2024
@JamieSlome JamieSlome changed the title Embeddable HTML and Markdown status badges 📛 Embeddable SVG status badges 📛 Feb 14, 2024
@JamieSlome
Copy link
Collaborator Author

@danielroe - am I on the right track?

api/
crux/
run/
badge/
├─ [domain].get.ts

badge/[domain].get.ts

export default defineCachedEventHandler(async event => {
  .
  .
  const image = ...
  return image.toString()
})

@danielroe
Copy link
Owner

Yep! But I think we can directly return an SVG string rather than a binary image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants