https://github.com/jabolol/brownie
Add support for Google Analytics in your GitHub readme
https://github.com/jabolol/brownie
deno fp-ts github
Last synced: 8 months ago
JSON representation
Add support for Google Analytics in your GitHub readme
- Host: GitHub
- URL: https://github.com/jabolol/brownie
- Owner: Jabolol
- License: mit
- Created: 2023-12-13T16:00:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-10T11:05:14.000Z (over 2 years ago)
- Last Synced: 2024-01-10T12:29:16.873Z (over 2 years ago)
- Topics: deno, fp-ts, github
- Language: TypeScript
- Homepage: https://brownie.deno.dev/
- Size: 129 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# brownie
Add support for **Google Analytics** to your GitHub readme and cache your images
for a faster loading experience! Built using [`deno`](https://deno.land) and
[`fp-ts`](https://github.com/gcanti/fp-ts).
## getting started
1. Install deno if you haven't already:
```sh
curl -fsSL https://deno.land/x/install/install.sh | sh
```
2. Clone the repo:
```sh
git clone git@github.com:Jabolol/brownie.git .
```
3. Fill in the [`.env`](./.env.example) file:
```sh
cp .env.example .env && vim .env
```
4. Edit the [`config.ts`](./config.ts) file to add your images and the cron
schedule to cache the images:
```ts
export const config: RouteConfig = {
routes: {
cocoa: "https://my-stats.dev/contribs",
vanilla: "https://my-stats.dev/issues",
},
schedule: "*/20 * * * *",
};
```
5. This will make the endpoints `/cocoa` and `/vanilla` available and cache the
images every `20` minutes. You can add as many routes as you want!
> [!NOTE]
> It is common practice to make your routes ingredients of your brownie!
6. Deploy to [Deno Deploy](https://deno.com/deploy) and fill in the environment
variables
7. Add your freshly baked images to your readme
```
https://[your-deployed-url].deno.dev/cocoa
```
8. The visits will be tracked in your Google Analytics dashboard!
## contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
Please run the following commands and ensure that there are no errors:
```sh
deno fmt && deno lint
```
## license
This project is licensed under the [MIT license](./LICENSE).