From 958569e09071e4bb290f0ec120b4309ae5983d2d Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 24 Jan 2022 14:52:04 +0100 Subject: refactor(project): replace repo api call method with hook and swr Instead of using post slug and an environment variable to fetch repo data, I use the given repo in each project MDX file. It allows me to fetch data from another user/organization if needed. To make it work, I no longer provide the full URL in MDX file. The new format is: "User/repo-slug". I also replaced the fetch method with SWR to improve caching and to avoid React complaining about cleanup useEffect. --- .env.example | 2 -- 1 file changed, 2 deletions(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index 88f4663..fddbd69 100644 --- a/.env.example +++ b/.env.example @@ -6,10 +6,8 @@ AUTHOR_NAME="Your Name" AUTHOR_EMAIL="your@email.com" AUTHOR_URL="https://www.yourWebsite.com/" FEED_DESCRIPTION="What you want..." -GITHUB_USER="YourName" NEXT_PUBLIC_FRONTEND_URL="$FRONTEND_URL" -NEXT_PUBLIC_GITHUB_USER="$GITHUB_USER" NEXT_PUBLIC_GRAPHQL_API="$BACKEND_URL$GRAPHQL_ENDPOINT" # Use this only in development mode. It prevents "unable to verify the first -- cgit v1.2.3