phseiff / github-cards

Fork of The Unofficial GitHub Cards, but without google analytics.

Home Page:https://phseiff.com/github-cards/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unofficial GitHub Cards - without google analytics!

This is a fork of the Unofficial Github Cards project, which adds the following 1 1/2 game changers:

  1. The original Unofficial Github Cards uses Google Analytics (though I myself don't know why), which some people might consider complicated.

  2. The codesnippets for the cards generated by the original Unofficial Github Pages embed code from jsdelivr.net. This means that, due to cross origin policies (CORS requests), javascript embedded in your page can not access or change the github cards emedded in your page. This is a problem if you are for example embedding code from the darkreader project to give your page a darkmode, because your github cards will still be light. However, this fork uses javascript hosted on github (in this repository), which means you can fork this repository, host it with github pages somewhere on your website, and replace https://phseiff.com/github-cards in each cards code with the place where you host the repo on your website, and bam!, you no longer have to worry about CORS requests having to be made to access the content of the cards!

If you are into graphics and don't believe the first point, here are two screenshots:

Original github cards with Google Analytics...

Github Cards with google analytics

...and fork without:

Github Cards fork without google analytics

And here is the content of the original README - if you want to use the fork, you can find it hosted here; the links down below refer to the original Unofficial Github Cards:


Card for your GitHub profile, card for your GitHub repositories.

Donate lepture

GitHub Cards Preview

New theme available

GitHub Cards Medium Theme

Usage

The cards are hosted via GitHub Pages.

Visit card generator: http://lab.lepture.com/github-cards/

widget.js

You can include the widget.js script, it will create the embed iframes for you.

Example of user card:

<div class="github-card" data-user="lepture"></div>
<script src="https://cdn.jsdelivr.net/gh/lepture/github-cards@latest/jsdelivr/widget.js"></script>

Example of repo card:

<div class="github-card" data-user="lepture" data-repo="github-cards"></div>
<script src="https://cdn.jsdelivr.net/gh/lepture/github-cards@latest/jsdelivr/widget.js"></script>

Data parameters:

  • user: GitHub username
  • repo: GitHub repository name
  • width: Embed width you want, default is 400
  • height: Embed height you want, default is 200
  • theme: GitHub card theme, default is default
  • target: If you want to open links in new tab, set it to blank
  • client_id: Your app client_id, optional
  • client_secret: Your app client_secret, optional

You can also define in meta tags:

<meta name="gc:base" content="http://lab.lepture.com/github-cards/">
<meta name="gc:theme" content="medium">
<meta name="gc:client-id" content="client id string">
<meta name="gc:client-secret" content="client secret string">

Limitation

There are some limitations for github cards.

  1. GitHub API rate limitation
  2. No interaction. You can't actually follow someone

SSL support

GitHub Cards is available on jsdelivr now. Use widget hosted on jsdelivr:

<div class="github-card" data-user="lepture" data-repo="github-cards"></div>
<script src="https://cdn.jsdelivr.net/gh/lepture/github-cards@latest/jsdelivr/widget.js"></script>

Contribution

This project is under the BSD License.

About

Fork of The Unofficial GitHub Cards, but without google analytics.

https://phseiff.com/github-cards/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:HTML 55.9%Language:JavaScript 21.5%Language:CSS 17.5%Language:Python 4.3%Language:Makefile 0.8%