Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch Dates from Github #96

Merged
merged 11 commits into from
Apr 28, 2024
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:

- name: Build
run: pnpm build

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Add `static/` to `dist/`
run: mv static/* dist

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ dist/
functions/render/elm-pages-cli.js

.DS_Store
.pnpm-store
.pnpm-store

.env
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,21 @@ Open up the project in a devcontainer, then run the following

```
pnpm i
touch .env
pnpm dev
```

## Environment Variables

Create a `.env` file in the root of the project with the following variables.

```env
# optional - if you want to increase the rate limit for the GitHub API
GITHUB_TOKEN=your_github_pat
```

### `GITHUB_TOKEN`

My website uses the GitHub API to fetch data in my public repos. The calls should be cached but sometimes in development you might hit the rate limit. To increase the limit you can create a personal access token and add it to the `.env` file.

A PAT with read-only access to public repos is sufficient.
2 changes: 1 addition & 1 deletion app/Route/Index.elm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Icon
import Icosahedron
import Pages.Url
import PagesMsg exposing (PagesMsg)
import Project exposing (Language, Project)
import Project exposing (Project)
import Route
import RouteBuilder exposing (App, StatefulRoute)
import Shared
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"type": "module",
"scripts": {
"postinstall": "elm-tooling install",
"dev": "elm-pages dev",
"dev": "dotenvx run -- elm-pages dev",
"build": "elm-pages build",
"serve": "pnpm build && http-server ./dist -a localhost -p 3000 -c-1"
},
"devDependencies": {
"@dotenvx/dotenvx": "^0.37.0",
"elm-codegen": "0.5.3",
"elm-optimize-level-2": "0.3.5",
"elm-pages": "3.0.12",
Expand Down
Loading