MHS Seals Website Documentation¶
Author: Alec Jensen
The website is available at mhsroboboat.com.
Local Development¶
-
Clone the repository:
git clone https://github.com/MHSeals/website2025.git cd website2025 -
Install dependencies:
npm install -
Start the development server:
npm run dev -
Open your browser and navigate to
http://localhost:4321to view the site.
Pushing Changes¶
The website is (as of me writing this) hosted on Cloudflare Pages (on my account, I need to move it to the organization's account), which automatically deploys changes pushed to the main branch of this repository.
Because of this, the main branch is protected and requires pull requests to be merged. So you must either fork the repository or create a branch to make changes.
-
Create a new branch:
git checkout -b my-feature-branch -
Make your changes and commit them:
git add . git commit -m "Description of my changes" -
Push your branch to the remote repository:
git push origin my-feature-branch -
Open a pull request on GitHub to merge your changes into the
mainbranch. - Once the pull request is approved and merged, your changes will be automatically deployed to the live site.
Previous Year Pages¶
The website contains pages for previous years, so you can go back and look at the history of the team. These previous year pages are separate deployments on Cloudflare Pages, and are based on specific branches in this repository. The branches are named 2025, 2025, etc., and the deployments are available at 2025.mhsroboboat.com, 2024.mhsroboboat.com, etc.
Adding a New Year Page to the Website¶
- In GitHub, after competition season ends, create a new branch for the next year, e.g.,
2025. - In Cloudflare Pages, create a new application
- Select
Import a repository - Select the repository
MHSeals/website2025 - Go to the application settings
- Set the production branch to the new branch you created, e.g.,
2025
- Select
- Make sure the DNS is set up correctly for the new year page (Cloudflare Pages should handle this automatically).
- Navigate to
src\pages\year\[year].astro - Find
export function getStaticPaths() - Add an object to the return, like this:
{ params: { year: "2025" }},replacing2025with the year you want to add.
Example:
export function getStaticPaths() {
return [
{ params: { year: "2025" }},
{ params: { year: "2024" }},
// Add more years as needed
];
}