This project primarily uses Next.js' Static HTML export feature to build a medium sized site with some interconnectedness/interactivity but while being statically served. The developer can more or less (see "Issues") write the website as if it was a normal Next.js/React app, but go through a slightly convoluted deployment process to transform it all into static client side files.
This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
- Verify
next.config.js
is in development mode. Run the development server. - Modify
components/*
,content/*
,lib/*
,pages/*
,public/*
,styles/*
. View changes at http://localhost:3000. - When ready to deploy, change
next.config.js
to deployment mode. Runnpm run export
. On success, theout/
folder will have a fully built site ofhtml|css|js
files that can run entirely client side. - Open an FTP client and connect to the
publishing.andrew.cmu.edu
server. Upload the entirety ofout/
or selectively upload folders. In particular, always uploadout/_next/
after any edits as it is involved in routing. Ifpublic/*
wasn't edited, no need to upload the corresponding files inout/
. For example, essentially no need to ever uploadout/previous_festivals/
as it stays the same for archive purposes and is a massive folder.
- Next.js has limitations on changing the base path of the public folder in our situation. For every link to an asset in the public folder, you must append the
basePublicPath
constant to the front. This is inconvenient to say the least. - Some pages in the site are generated off markdown files and have links public folder assets in them. For markdown files, the string
$basePublicPath$
will be replaced with the base public path. - See the open projects on the Github projects page
- In general, the website made it through one somewhat rushed festival season so there are some temporary fixes present.
- The amount of local assets are building up and we are running out of storage space on CMU servers. Perhaps consider using a third party storage site for assets.