CDC-Homepage
is a base for creating modern product landing pages. Built with Next.js and Tailwind CSS, it offers a modern foundation for quickly launching homepages for your products.
You can see the GH Pages' live build here.
# Clone the base repo for a new homepage
git clone https://github.com/codesign-cloud/cdc-next-static-homepage-base.git projectX
cd projectX
npm i
npm run dev
You are now ready to start developing your own static homepage.
# Change the origin to the new project's repo
git remote set-url origin https://github.com/userX/projectX.git
# Add this base repo as a secondary remote named 'base'
git remote add base https://github.com/codesign-cloud/cdc-next-static-homepage-base.git
# Fetch the latest changes from the base repository
git fetch base
# Merge the fetched changes into your local main branch
git merge base/main
# In case you encounter the "fatal: refusing to merge unrelated histories" error,
# you can use the --allow-unrelated-histories flag to bypass this.
# ⚠️ Use this flag carefully, as it may lead to complex merge conflicts.
git merge base/main --allow-unrelated-histories
# To prioritize and accept all incoming changes from the base repository, use:
# ⚠️ Again, use this flag carefully, as it may lead to complex merge conflicts.
git merge -X theirs base/main --allow-unrelated-histories
Note: This configuration is only necessary if your GitHub Pages site is hosted at username.github.io/your-repo-name
. If you are using a custom domain or subdomain, this step is not required, as / points to the root.
When using static assets, such as images with the img
tag, that are located in the /assets/
directory within your public folder, you need to adjust the base URL accordingly.
To set this up, follow these steps:
Settings
> Secrets and variables
> Actions
> Repository secrets
.New repository secret
.BASE_PATH
with the value https://username.github.io/your-repo-name
(no trailing slash)You can then utilize this base path in your JSX pages as shown below:
import { basePath } from '@/app/basePath';
...
..
<img src={`${basePath}/assets/logo.svg`} alt="Logo" />
First, run the development server:
npm run dev || yarn dev || pnpm dev || bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
You can check out the Next.js GitHub repository