Skip to content

Add HTML landing page for SVG cards with project footer - #25

Merged
Chintanpatel24 merged 1 commit into
mainfrom
feat-landing-page-footer-1669454921884861657
Jun 11, 2026
Merged

Add HTML landing page for SVG cards with project footer#25
Chintanpatel24 merged 1 commit into
mainfrom
feat-landing-page-footer-1669454921884861657

Conversation

@Chintanpatel24

Copy link
Copy Markdown
Owner

This PR implements a landing page for the GitHub stats cards. When a user clicks on a card in a README, they will be taken to a clean web page showing the card and a small footer reference to the gitlyy project.

Key changes:

  • Created src/response.js to handle content negotiation.
  • Updated all 10 API endpoints to use sendResponse.
  • Added a styled HTML wrapper for browser requests with a link back to the repo.
  • Ensured proper caching behavior with the Vary header.

PR created automatically by Jules for task 1669454921884861657 started by @Chintanpatel24

Implement content negotiation in all API endpoints via a new `sendResponse` utility.
When a card URL is accessed via a browser (Accept: text/html), it now serves a styled HTML page that:
- Centers the SVG card.
- Adds a footer in the bottom-left with the text "This is a gitlyy a readme stats generator."
- Links the word "gitlyy" to the project's GitHub repository.

Non-browser requests continue to receive the raw SVG.
Includes `Vary: Accept` header for correct CDN caching.

Co-authored-by: Chintanpatel24 <216989679+Chintanpatel24@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 12:09
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gitlyy Ready Ready Preview, Comment Jun 11, 2026 12:09pm

@Chintanpatel24
Chintanpatel24 merged commit d57aa19 into main Jun 11, 2026
6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces content negotiation for the card endpoints so browser navigations can receive a simple HTML landing page (wrapping the SVG card with a small project footer), while non-browser clients continue receiving raw SVG.

Changes:

  • Added src/response.js with a shared sendResponse(req, res, svg, status) helper to return either SVG or an HTML wrapper based on the Accept header.
  • Updated the 10 existing API endpoints to use sendResponse instead of directly sending image/svg+xml.
  • Added Vary: Accept handling in the shared response helper to support correct caching across content types.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/response.js Adds shared response helper with HTML wrapper + SVG fallback based on Accept.
api/streak.js Uses sendResponse for streak card output and errors.
api/profile.js Uses sendResponse for profile card output and errors.
api/pr-stats.js Uses sendResponse for PR stats card output and errors.
api/overview.js Uses sendResponse for overview card output and errors.
api/music.js Uses sendResponse for music card output and errors.
api/master.js Uses sendResponse for master dashboard card output and errors.
api/languages.js Uses sendResponse for language cards output and errors.
api/issues.js Uses sendResponse for issues card output and errors.
api/contribution.js Uses sendResponse for contribution cards output and errors.
api/commits.js Uses sendResponse for commits cards output and errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/response.js
Comment thread src/response.js
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.

2 participants