Skip to content

Commit a1ada70

Browse files
committed
basic docs and repo name set
- todos - changelog - basic doc - repo name replace
1 parent dd01a69 commit a1ada70

File tree

3 files changed

+32
-88
lines changed

3 files changed

+32
-88
lines changed

README.md

Lines changed: 16 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,32 @@
1-
# Next.js GitHub Pages
1+
# Bookmarks
22

3-
Deploy Next.js to GitHub Pages with GitHub Actions. [View the deployed app](https://gregrickaby.github.io/nextjs-github-pages/) 🚀
3+
via Raindrops, Next.js, GitHub Pages, and written in Code Spaces
44

5-
> ⚠️ Heads up! GitHub Pages _does not_ support serverless or edge functions. This means dynamic functionality will be disabled. See all the [unsupported features](https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features).
6-
7-
---
8-
9-
## Configure Next.js
10-
11-
### Next.js Config
12-
13-
First, you need to configure Next.js to [deploy static exports](https://nextjs.org/docs/app/building-your-application/deploying/static-exports). This is required for GitHub Pages to work.
14-
15-
1. Open the `next.config.ts` file
16-
2. Add the following:
17-
18-
```typescript
19-
import type { NextConfig } from "next";
20-
21-
const nextConfig: NextConfig = {
22-
/**
23-
* Enable static exports.
24-
*
25-
* @see https://nextjs.org/docs/app/building-your-application/deploying/static-exports
26-
*/
27-
output: "export",
28-
29-
/**
30-
* Set base path. This is the slug of your GitHub repository.
31-
*
32-
* @see https://nextjs.org/docs/app/api-reference/next-config-js/basePath
33-
*/
34-
basePath: "/nextjs-github-pages",
35-
36-
/**
37-
* Disable server-based image optimization. Next.js does not support
38-
* dynamic features with static exports.
39-
*
40-
* @see https://nextjs.org/docs/app/api-reference/components/image#unoptimized
41-
*/
42-
images: {
43-
unoptimized: true,
44-
},
45-
};
46-
47-
export default nextConfig;
48-
```
49-
50-
3. Save the `next.config.ts`
51-
52-
4. Finally, place a `.nojekyll` file in the `/public` directory to disable GitHub Pages from trying to create a [Jekyll](https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/) website.
5+
Based on [nextjs-github-pages](https://github.com/gregrickaby/nextjs-github-pages)
536

54-
```treeview
55-
.
56-
├── app/
57-
├── public/
58-
│ └── .nojekyll
59-
├── next.config.ts
60-
```
61-
62-
Perfect! This is all you need to configure Next.js to deploy on GitHub Pages.
7+
## Links
8+
- [repo](https://github.com/seeReadCode/bookmarks)
9+
- [codespace dev](https://shiny-lamp-wpjpj5q7vj3ggw9.github.dev/)
10+
- [codespace admin](https://github.com/codespaces?repository_id=1036822786)
6311

64-
### Add base path to `page.tsx`
6512

66-
Next, you will need to add the base path to images in `page.tsx` file. This is required for the images to appear on GitHub Pages.
13+
## Docs
6714

68-
1. Open `app/page.tsx`
69-
2. Find the `Image` components
70-
3. Add `/nextjs-github-pages/` (or the slug of your GitHub repository) to the `src` prop:
71-
72-
```tsx
73-
<Image
74-
src="/nextjs-github-pages/vercel.svg"
75-
alt="Vercel Logo"
76-
className={styles.vercelLogo}
77-
width={100}
78-
height={24}
79-
priority
80-
/>
81-
```
8215

83-
4. Save the `page.tsx` file
84-
85-
Learn more by reading the official documentation [for basePath and images](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath#images).
16+
> ⚠️ Heads up! GitHub Pages _does not_ support serverless or edge functions. This means dynamic functionality will be disabled. See all the [unsupported features](https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features).
8617
8718
---
19+
## TODO
20+
- deploy.yml (from cloned repo) v. alt from github.com
21+
- fix build
8822

89-
## Configure GitHub Repository
90-
91-
Now that Next.js is configured, you need to set up your GitHub repository to deploy to GitHub Pages.
23+
## Changelog
9224

93-
### Setup GitHub Action
25+
- Enabled Github Pages on github.com via suggested Next.js config
26+
- Replaced `next-js-github-pages`
27+
- Set env variables via github.com and tested in Codespace console
9428

95-
This is where the magic happens! This [workflow file](https://github.com/gregrickaby/nextjs-github-pages/blob/main/.github/workflows/deploy.yml) will automatically build and deploy the app when you push to the `main` branch.
9629

97-
1. Create `.github/workflows/deploy.yml` file
98-
2. Paste the contents of <https://github.com/gregrickaby/nextjs-github-pages/blob/main/.github/workflows/deploy.yml>
99-
3. Save the `deploy.yml` file
10030

10131
### Enable GitHub Pages
10232

app/page.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
import Image from "next/image";
2+
const response = await fetch('https://api.raindrop.io/rest/v1/collections', {
3+
headers: {
4+
'Accept': 'application/json',
5+
'Authorization': `Bearer ${process.env.RAINDROP_SECRET}`,
6+
}
7+
});
8+
const data = await response.json();
9+
// .then(response => response.text())
10+
// .then(text => console.log(text))
11+
console.log(process.env);
12+
console.log(data);
13+
const text = data.text;
14+
215

316
export default function Home() {
417
return (
518
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
619
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
20+
{text}
721
<Image
822
className="dark:invert"
9-
src="/nextjs-github-pages/next.svg"
23+
src="/bookmarks/next.svg"
1024
alt="Next.js logo"
1125
width={180}
1226
height={38}

next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const nextConfig: NextConfig = {
1313
*
1414
* @see https://nextjs.org/docs/app/api-reference/next-config-js/basePath
1515
*/
16-
basePath: "/nextjs-github-pages",
16+
basePath: "/bookmarks",
1717

1818
/**
1919
* Disable server-based image optimization. Next.js does not support

0 commit comments

Comments
 (0)