This repository contains the source code and development environment for the Fire Growth Modelling website. The website is built using Vite, TypeScript, and React.
This repository has a specific structure:
- The main repository (
website_builder) contains all the source code, configurations, and development environment for building the website. - The
distfolder is set up as a Git submodule pointing to the public repositoryfiregrowthmodelling.ca. - When you build the website, the output is generated in this
distfolder. - Changes committed and pushed from the
distfolder will be published to the live website at firegrowthmodel.ca. - The
resourcesfolder inside thedistfolder, contains the legacy COM documentation, dont alter it or remove it. - The
CNAMEfile in the `dist' folder must remain there and not be altered, this is partof GHP configuration.
The website builder only modifies the draft website, never the live one directly.
Changes to the live website only happen when you:
- Build the website
- Commit the changes in the
distfolder - Push those changes to the public repository
NEVER manually alter the contents of the dist folder, you can break the website or permanently lose resources.
To start the development server for local live development:
npm run devThis will start a local development server, usually at http://localhost:5173. Changes you make to the source code will be reflected immediately in the browser - no refreshing needed!
-
be sure to alter page components eg:
src/pages/FBANTools.tsx-or- subpages eg:
src/pages/WISEDocumentation.tsx -
Inside the TSX file remember, you are NOT editing HTML or TypeScript you are in fact editing React JSX syntax, which is a JavaScript extension that allows you to write HTML-like code within JavaScript/TypeScript. For more info on this, check out: https://react-typescript-cheatsheet.netlify.app/
-
When you are done making changes and are ready to publish the changes, load and edit:
src/components/Footer.tsxand change the date:
<div id="footer"> <ul> <li id="left"><a href="#top">Top of Page</a></li> <li className="right" id="footer-date">Site updated: 2025-04-07</li> </ul> </div>
to todays date.
When you're ready to build the website for production:
npm run buildThis command compiles and optimizes the website, placing the output in the dist folder (which is the submodule pointing to the public repository).
To simulate GitHub Pages hosting locally and test the built website:
npm run testHostingImportant: Do NOT use LiveServer or similar tools to test the built website, as they may not accurately represent how the site will behave on GitHub Pages.
After building the website, you need to commit and push the changes in the dist folder to publish them to the live website:
# Navigate to the dist folder
cd dist
# Add all changes
git add .
# Commit changes
git commit -m "Update website with [describe your changes]"
# Push to the public repository
git push
# Return to the main repository
cd ..
# Commit the updated submodule reference
git add dist
git commit -m "Update website build reference"
git pushIf you're a new administrator cloning this repository for the first time:
# Clone the repository with its submodule
git clone --recurse-submodules https://github.com/WISE-Developers/website_builder.git
# Navigate to the repository
cd website_builder
# Install dependencies
npm installTo keep your local copy up to date:
# Pull the latest changes
git pull
# Update the submodule
git submodule update --remoteIf you encounter issues with the submodule, you may need to reinitialize it:
git submodule update --init --recursiveIf you're having trouble with the build process:
- Make sure you have the latest dependencies:
npm install - Clear the cache:
npm run clean(if available) or manually delete the.cachedirectory - Try building again:
npm run build
For questions or issues related to website development, please contact [appropriate contact information].
[Appropriate license information]