You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A NextJS starter to get you started creating educational materials using Markdown
4
+
A starter template build in Next.js for creating educational materials using Markdown.
5
5
</p>
6
6
7
7
## Get Started
8
8
9
-
1. Set up Node.js v14+
9
+
1. Set up Node.js v20+
10
10
1. Clone this repo
11
11
1. Run `npm install`
12
12
1. Run `npm run dev` to start the dev server
13
13
1. Open http://localhost:3000 in a browser
14
14
15
+
_Instructions for deploying the course website to GitHub Pages are below_
16
+
15
17
## Configure Your Course
16
18
17
19
There are several things to configure before getting started.
@@ -94,14 +96,27 @@ The code blocks use [Highlight.js](https://highlightjs.org/static/demo/). By def
94
96
95
97
## GitHub Pages / GitHub Actions
96
98
97
-
By default this repo works with GitHub Pages. Just make sure you set the `productionBaseUrl` in the course.json to the name of the repo.
99
+
By default this repo works with GitHub Pages (classic). Just make sure you set the `productionBaseUrl` in the course.json to the name of the repo.
98
100
99
-
It also includes a GitHub Action to automatically deploy to your gh-pages branch. Just make sure that your repo has GitHub Pages enabled and the branch is set to gh-pages. If you're not deploying to GitHub Pages go ahead and delete the `.github` directory.
101
+
It also includes a GitHub Action to automatically deploy to your `gh-pages` branch. Just make sure that your repo has GitHub Pages (classic) enabled and the branch is set to `gh-pages`. If you're not deploying to GitHub Pages go ahead and delete the `.github` directory.
100
102
101
103
By default the GitHub Action looks for a `main` branch, so be sure you're using that instead of `master`.
102
104
103
105
If you want a custom domain, make sure you uncomment the `fqdn` field in [.github/workflows/next.yaml](https://github.com/btholt/next-course-starter/blob/main/.github/workflows/next.yaml) file and put your custom domain. If you don't do that and only set it up with the GitHub web GUI, every deploy will break the custom domain.
104
106
107
+
### GitHub Pages Instructions
108
+
109
+
These instructions assume you've followed the setup instructions above and have a cloned version of this repo locally.
110
+
111
+
1. Create a new (public) remote repository in your GitHub Account (e.g. fem-javascript-fundamentals).
112
+
1. Grant `Read and write permissions` for Workflows under Actions > General > Workflow Permissions.
113
+
1. Update the `productionBaseUrl` in the `course.json` file to match the name of the repository.
114
+
1. Push to the new repository. You should see the `Deploy NextJS Course Site` workflow run under the Actions tab.
115
+
1. Configure GitHub Pages: Settings > Pages > Deploy from a Branch. Select the `gh-pages` branch.
116
+
1. Once the `pages-build-deployment` action completes, you should see your site at `https://USERNAME.github.io/REPO_NAME`.
117
+
118
+
_Future pushes to the main branch will automatically trigger a new deployment._
@@ -113,7 +128,6 @@ If you want a custom domain, make sure you uncomment the `fqdn` field in [.githu
113
128
114
129
-`npm run dev` - Next's dev command. Start a local dev server. Note if you have a productionBasePath set in your course.json, your dev server will respect that (so you don't mess up your paths in production.)
115
130
-`npm run build` - Build your site for production. This will still include the Next.js server run time. Use this if you're using something like Vercel to host your site.
116
-
-`npm run export` - Builds your site statically, use this if you're going to deploy to GitHub Pages, S3, or somewhere else with no server. This will run next build and then next export (no need to run build yourself first.)
117
131
-`npm run start` - Start an already-built server.
118
132
-`npm run csv` – Will generate the CSV of the metadata from your course. Note you may have to run build first, depending on your csvPath.
119
133
-`npm run seo` – Using ChatGPT, every file that does not have a description, ChatGPT will generate a description and keywords and write them to the file. Requires you to set a valid `OPENAI_API_KEY` (which means having a paid OpenAI account) using a [.env](https://github.com/motdotla/dotenv) or just by setting it in the environment. If a description already exists, this will skip it.
0 commit comments