Skip to content

Repository files navigation

Github Profile Views


Note

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

✨ Basic usage

  • Go to https://views.igorkowalczyk.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://views.igorkowalczyk.dev/api/badge/YOUR-USERNAME)

🖼️ Available styles

Note

The default style is flat

StyleExampleUsage
flatstyle=flat
classicstyle=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

ColorExampleUsageLabel ColorLabel usage
bluecolor=bluelabelColor=blue
cyancolor=cyanlabelColor=cyan
greencolor=greenlabelColor=green
yellowcolor=yellowlabelColor=yellow
orangecolor=orangelabelColor=orange
redcolor=redlabelColor=red
pinkcolor=pinklabelColor=pink
purplecolor=purplelabelColor=purple
graycolor=graylabelColor=gray
blackcolor=blacklabelColor=black
ff69b4color=ff69b4labelColor=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.

📊 Number format

You can display the number of views in a more readable format. You can choose between short and long format.

FormatExampleUsage
shortformat=short
longformat=long

Note

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

📝 Custom text

You can overwrite default Views text with your own label.

![Github Views](https://views.igorkowalczyk.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://views.igorkowalczyk.dev/api/json/YOUR-USERNAME

Note

Replace YOUR-USERNAME with your real value.

Response:

{ "views": 123 }

🔩 Local Development

  1. Clone this repositorygit clone https://github.com/IgorKowalczyk/github-views.git
  2. Run pnpm i to install all dependencies,
  3. Edit the wrangler.jsonc file with your values
  4. Run pnpm types to generate types for the project
  5. Run pnpm dev to start the development server or pnpm preview to preview the production build

🖥️ Hosting with Cloudflare Workers

  1. Clone this repositorygit clone https://github.com/IgorKowalczyk/github-views.git
  2. Run pnpm i to install all dependencies,
  3. Go to Cloudflare Workers and create a new project (you can import the project from GitHub)
  4. Go to Cloudflare > Storage & Databases -> KV -> Create, and create a new KV namespace
  5. Link the KV namespace to the project in the wrangler.jsonc file
  6. Edit the wrangler.jsonc file with your values
  7. Run pnpm types to generate types for the project
  8. Run pnpm dev to start the development server or pnpm preview to preview the production build
  9. If you want to deploy the project, run pnpm check to check the project and pnpm deploy to deploy the project to Cloudflare Workers

Note

Refer to the Cloudflare Workers documentation and Wrangler documentation for more information.

⁉️ 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 repositoryhttps://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

About

👀 Count the views of your Github profile with your own custom badge

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages