Skip to content

πŸ‘€ Count the views of your github profile with your own custom badge

License

Notifications You must be signed in to change notification settings

IgorKowalczyk/github-views

Repository files navigation

Github Profile Views


Note

Don't forget to replace example YOUR-USERNAME parameter with real value.

✨ Basic usage

  • Go to https://github-views.deno.dev and enter your Github username or any other text
  • Copy the generated markdown code with the style you like and paste it in your README.md file
![Github Views](https://github-views.deno.dev/api/badge/YOUR-USERNAME)

πŸ–ΌοΈ Available styles

Note

The default style is flat

Style Example Usage
flat style=flat
classic style=classic

Note

To apply the style, add to the URL ?style=YOUR-STYLE, if you use other parameters you can use &style=YOUR-STYLE

🎨 Custom colors

Note

The default color is blue

Color Example Usage Label Color Label usage
blue color=blue labelColor=blue
cyan color=cyan labelColor=cyan
green color=green labelColor=green
yellow color=yellow labelColor=yellow
orange color=orange labelColor=orange
red color=red labelColor=red
pink color=pink labelColor=pink
purple color=purple labelColor=purple
gray color=gray labelColor=gray
black color=black labelColor=black
ff69b4 color=ff69b4 labelColor=ff69b4

Note

To apply the style, add to the URL ?color=YOUR-COLOR, if you use other parameters you can use &color=YOUR-COLOR

Warning

HEX colors should be used without # symbol prefix.

πŸ“ Custom text

You can overwrite default Views text with your own label.

![Github Views](https://github-views.deno.dev/api/badge/YOUR-USERNAME?label=Your+own+label)

Note

Replace whitespace with + character in multi-word labels.

πŸ“¦ JSON format

You can get the number of views in json format. It can be useful if you want to use the number of views in your application.

Warning

The API is read-only, you can't change the number of views.

Request:

https://github-views.deno.dev/api/json/YOUR-USERNAME

Note

Replace YOUR-USERNAME with your real value.

Response:

{ "views": 123 }

πŸ”© Self Hosting

  1. Clone this repository git clone https://github.com/IgorKowalczyk/github-views.git
  2. Run pnpm i to install all dependencies,
  3. Run npm run build to build the project or npm run dev to run the project in development mode.
  4. Run pnpm run preview to preview the project.

πŸ–₯️ Hosting with Deno Deploy

  1. Fork this repository on GitHub
  2. Go to https://deno.com/deploy and create an account
  3. Click "New Project" and select your account and forked repository
  4. Click "Add build step" and wait for the project to build
  5. Go to repository settings -> Secrets and variables -> Actions -> Variables and add DENO_DEPLOY_PROJECT variable with your Deno Deploy project name.
  6. Wait for the project to build and go to the project URL

Important

This project requires access to Deno KV which is currently in beta.

πŸ–₯️ Hosting with Vercel

Warning

Versions >= v3 does not support Vercel hosting. If you want to host this project on Vercel, use versions <= v2. To do this, go to v2 branch and follow the instructions corresponding to the version.

⁉️ Issues

If you come across any errors or have suggestions for improvements, please create a new issue here and describe it clearly.

πŸ“₯ Pull Requests

When submitting a pull request, please follow these steps:

  • Clone this repository https://github.com/IgorKowalczyk/github-views.git
  • Create a branch from main and give it a meaningful name (e.g. my-awesome-new-feature).
  • Open a pull request on GitHub and clearly describe the feature or fix you are proposing.

πŸ“‹ License

This project is licensed under the MIT. See the LICENSE file for details