Giter Site home page Giter Site logo

kepler296f / github-buttons Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mdo/github-buttons

0.0 1.0 0.0 565 KB

Showcase any GitHub repo's success with these two simple, static buttons featuring dynamic watch and fork counts.

Home Page: http://ghbtns.com

License: Other

github-buttons's Introduction

GitHub Buttons

Showcase your GitHub (repo's) success with these three simple, static buttons featuring dynamic watch, fork and follower counts and a link to your GitHub repo or profile page.

To get started, checkout http://ghbtns.com!

Usage

These buttons are hosted via GitHub Pages, meaning all you need to do is include an iframe and you're set. Once included, you can configure it with various options. Here's the include:

<iframe src="http://ghbtns.com/github-btn.html?user=USERNAME&repo=REPONAME&type=BUTTONTYPE"
  allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>

Requirements

user
GitHub username that owns the repo

repo
GitHub repository to pull the forks and watchers counts

type
Type of button to show: watch, fork, or follow

Optional

count
Show the optional watchers or forks count: none by default or true

size
Optional flag for using a larger button: none by default or large

Examples

Basic Watch button

<iframe src="http://ghbtns.com/github-btn.html?user=mdo&repo=github-buttons&type=watch"
  allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>

Basic Fork button

<iframe src="http://ghbtns.com/github-btn.html?user=mdo&repo=github-buttons&type=fork"
  allowtransparency="true" frameborder="0" scrolling="0" width="53" height="20"></iframe>

Basic Follow button

<iframe src="http://ghbtns.com/github-btn.html?user=mdo&type=follow"
  allowtransparency="true" frameborder="0" scrolling="0" width="132" height="20"></iframe>

Watch with count

<iframe src="http://ghbtns.com/github-btn.html?user=mdo&repo=github-buttons&type=watch&count=true"
  allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>

Fork with count

<iframe src="http://ghbtns.com/github-btn.html?user=mdo&repo=github-buttons&type=fork&count=true"
  allowtransparency="true" frameborder="0" scrolling="0" width="95" height="20"></iframe>

Follow with count

<iframe src="http://ghbtns.com/github-btn.html?user=mdo&type=follow&count=true"
  allowtransparency="true" frameborder="0" scrolling="0" width="165" height="20"></iframe>

Large Watch button with count

<iframe src="http://ghbtns.com/github-btn.html?user=mdo&repo=github-buttons&type=watch&count=true&size=large"
  allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>

Limitations

For the first versions, functionality is limited and some concessions were made:

  • Width and height must be specificed for all buttons (which actually adds some control for those with OCD like myself).
  • All attributes must be passed through via URL parameters.
  • CSS and javascript are all included in the same HTML file to reduce complexity and requests.

Usage with SSL

In order to avoid insecure content warnings when using GitHub Buttons on a page behind an SSL certificate, simply host a copy of the github-btn.html file on your secure directory and substitute your domain in the iframe include:

<iframe src="https://YOURDOMAIN.com/github-btn.html?user=USERNAME&repo=REPONAME&type=BUTTONTYPE"
  allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>

More refinement and functionalty is planned with open-sourcing--any help is always appreciated!

Bug tracker

Have a bug? Please create an issue here on GitHub at https://github.com/mdo/github-buttons/issues.

See also

Twitter account

Keep up to date on announcements and more by following Mark on Twitter, @mdo.

Author

Mark Otto

Copyright and license

Copyright 2014 Mark Otto. Released under Apache 2.0.

github-buttons's People

Contributors

mdo avatar necolas avatar chrisbarr avatar ded avatar feralou avatar gjtorikian avatar rondevera avatar joshferrara avatar jodal avatar it-ony avatar ntkme avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.