Skip to content

link9596/Github-Card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Card Widget

A lightweight, zero‑dependency widget that displays GitHub repository stats as a card.

English | 简体中文

Features

  • Auto‑fetches stars, forks, description, and primary language from GitHub API.

  • Responsive grid layout.

  • No build step, no external dependencies.

Usage

  1. Include the script
<script src="github-card.js"></script>
  1. Add a container with the repository name
<div data-github-repo="owner/repo"></div>
  1. (Optional) Wrap multiple cards in a grid container for responsive grid layout.
<div class="github-cards-grid">
  <div data-github-repo="link9596/Github-Card"></div>
  <div data-github-repo="vuejs/vue"></div>
</div>
  1. (Optional) Increase API rate limit with a GitHub token Place this before the script tag:
<script>
  window.GithubCardToken = 'your_personal_access_token';
</script>
<script src="github-card.js"></script>

We do not recommend exposing the Access Token. You can hide the Access Token via a proxy and then use your custom proxy API source:

<script>
  window.GithubCardProxy = 'https://example.yourdomain.com/';
</script>
<script src="github-card.js"></script>

Without a token: 60 requests per hour. With a token: 5,000 requests per hour.

Example

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>My GitHub projects</title>
</head>
<body>
  <div class="github-cards-grid">
    <div data-github-repo="link9596/Github-Card"></div>
    <div data-github-repo="vuejs/vue"></div>
  </div>
  <script src="github-card.js"></script>
</body>
</html>

About

Share GitHub repo cards on any page. 优雅地在网页上分享GitHub仓库卡片

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors