-
Notifications
You must be signed in to change notification settings - Fork 0
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
DO NOT MERGE: PR for preview purposes — Litepaper RC #14
base: main
Are you sure you want to change the base?
Conversation
jonijuup
commented
Dec 10, 2021
•
edited
Loading
edited
- Litepaper Release Candidate
- Removes nav and other functionalities, except litepaper content.
- Should end up as an own litepaper-release branch that will not be merged into main at all.
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/equilibriumco/vanilla-stake/5vQFjYUicR6na2NbwnV1RwnmKfdh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me! In case you wouldn't want to remove the existing pages you could also use the new middlewares api of Next.JS to prevent users accessing the other than /litepaper
pages.
You could create file called _middleware.ts
under pages folder with following content:
import type { NextRequest, NextFetchEvent } from 'next/server';
import { NextResponse as Response } from 'next/server';
export default function middleware(req: NextRequest, ev: NextFetchEvent) {
if (req.nextUrl.pathname !== "/litepaper") {
return Response.redirect("/litepaper");
}
}
All the urls would then go to /litepaper.
Now that I think of this, we should merge this against some new branch instead of main, something like if (process.env.LITEPAPER_RELEASE !== true) {
return navlinks
} else {
return null
} |
My thinking was that this particular branch would be deployed, and it would not be merged into or nothing would be merged onto it, until the actual release. Release would be deploying the main branch and deleting this one. |
Got it, that makes sense 👍 |