This is the official website for the Starlight Lab at Carnegie Mellon University. The website is built using React, TypeScript, and Tailwind CSS, and is deployed using GitHub Pages.
- Clone the repository:
git clone https://github.com/starlightcmu/starlightcmu.github.io.git
cd starlightcmu.github.io
- Install dependencies:
npm install
- Start the development server:
npm run dev
src/
├── components/ # Reusable React components
├── data/ # JSON data files for content
├── pages/ # Page components
├── types/ # TypeScript type definitions
└── styles/ # CSS and styling files
The website includes a maintenance overlay that can be toggled on/off using a single variable:
- Open
src/App.tsx
- Locate the
MAINTENANCE_MODE
variable at the top of the file:
export const MAINTENANCE_MODE = true;
- Set it to
false
to disable the maintenance overlay and show the full website - Set it to
true
to enable the maintenance overlay
All content is stored in JSON files in the src/data
directory:
news.json
: Latest news and announcementsteam.json
: Team member informationpublications.json
: Research publicationsprojects.json
: Research projects
To update content, simply edit the corresponding JSON file. The changes will be automatically reflected in the website.
Add new items to the news
array in src/data/news.json
:
{
"news": [
{
"date": "March 20, 2024",
"title": "Your News Title",
"content": "Your news content"
},
// ... existing items
]
}
Add new members to the labMembers
array in src/data/team.json
:
{
"labMembers": [
{
"name": "New Member Name",
"role": "Role Title",
"bio": "Member bio",
"image": "https://image-url.com",
"links": {
"google_scholar": "optional-url",
"github": "optional-url",
"website": "optional-url",
"email": "optional-email",
"linkedin": "optional-url"
}
},
// ... existing members
]
}
Add new publications to the publications
array in src/data/publications.json
:
{
"publications": [
{
"title": "Publication Title",
"authors": ["Author 1", "Author 2"],
"venue": "Conference/Journal Name",
"year": 2024,
"pdf": "optional-pdf-url",
"code": "optional-code-url",
"abstract": "Publication abstract"
},
// ... existing publications
]
}
Add new projects to the projects
array in src/data/projects.json
:
{
"projects": [
{
"title": "Project Title",
"description": "Project description",
"image": "https://image-url.com",
"tags": ["Tag1", "Tag2"],
"link": "optional-project-url"
},
// ... existing projects
]
}
The website uses Tailwind CSS for styling. The main configuration is in:
tailwind.config.js
: Tailwind configurationsrc/index.css
: Global styles and animations
- Create a new component in
src/pages/
- Add the route in
src/App.tsx
- Add the navigation link in
src/components/Navbar.tsx
The website is automatically deployed to GitHub Pages when changes are pushed to the main branch. The deployment process is handled by the GitHub Actions workflow in .github/workflows/deploy.yml
.
To deploy manually:
- Push your changes to the main branch:
git add .
git commit -m "Your commit message"
git push origin main
- The GitHub Actions workflow will automatically:
- Build the project
- Deploy to GitHub Pages
- Make the changes live at https://starlightcmu.github.io
npm run dev
: Start development servernpm run build
: Build for productionnpm run preview
: Preview production build locallynpm run lint
: Run ESLint
The types for all data structures are defined in src/types/index.ts
. Update these types if you modify the data structure in the JSON files.
The website is fully responsive with three main breakpoints:
- Mobile: < 768px
- Tablet: 768px - 1024px
- Desktop: > 1024px
MIT License - see LICENSE file for details