Skip to content

rondevera/github-buttons

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNOFFICIAL GITHUB BUTTONS

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

To get started, checkout http://markdotto.github.com/github-buttons!

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://markdotto.github.com/github-buttons/github-btn.html?user=USERNAME&repo=REPONAME&type=BUTTONTYPE"
  allowtransparency="true" frameborder="0" scrolling="0" width="62px" height="20px"></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 or fork

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://markdotto.github.com/github-buttons/github-btn.html?user=markdotto&repo=github-buttons&type=watch"
  allowtransparency="true" frameborder="0" scrolling="0" width="62px" height="20px"></iframe>

Basic Fork button

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

Watch with count

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

Fork with count

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

Large Watch button with count

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

Limitations

For the first version, 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.

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/markdotto/github-buttons/issues.

Twitter account

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

Authors

Mark Otto

Copyright and license

Copyright 2011 Mark Otto.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published