HARP-WEBSITE
This website is built using Vitepress.
We use Netlify to deploy it under the domain harp3.netlify.app.
Build locally
Install dependencies
- Install Node.js
- On Mac, if you prefer you can use Homebrew to install Node.js:
brew install node
- On Mac, if you prefer you can use Homebrew to install Node.js:
- Install pnpm:
npm install -g pnpm - Navigate to the
websitedirectory and install dependencies:bashcd website pnpm install
Run the development server
To run the development server with hot-reloading, run the following commands in the website directory:
pnpm run build
pnpm run docs:devThe website should then be available at http://localhost:5173 (or the next available port). Every time you save a relevant file, the website will automatically refresh in your browser.
Important Note on prebuild: When you run pnpm run build, a script named prebuild is automatically executed first.
What pnpm run prebuild does for this website: The prebuild script, defined in package.json, is responsible for copying Markdown (.md) files from the main HARP repository and the pyHARP submodule into the website's content directory. Specifically:
- It copies all
.mdfiles from the root of theHARPrepository (e.g.,../README.md) into thewebsite/content/HARP/directory. - It copies all
.mdfiles from thepyHARPsubmodule (e.g.,../pyharp/README.md) into thewebsite/content/pyHARP/directory. This ensures that the documentation displayed on the website is sourced directly from the repositories, maintaining a single source of truth.
Edit the content
The website's content is primarily managed through Markdown files and VitePress configuration:
Source Markdown Files:
- Thanks to the
prebuildscript, Markdown files from the root of theHARPrepository are automatically available underwebsite/content/HARP/. - Similarly, Markdown files from the
pyHARPsubmodule are available underwebsite/content/pyHARP/. - You should edit these original files in their respective repositories (
HARP/*.mdorHARP/pyHARP/*.md) when you want to update the documentation. The changes will be reflected on the website after the next build. - Important Warning for
pyHARP(Submodule) Updates: For changes in thepyHARPrepository's Markdown files to appear on the website, thepyHARPsubmodule within the mainHARPrepository must be updated to point to the latest commit from thepyHARPrepository. Simply pushing changes to the standalonepyHARPrepository is not enough. You need to go into theHARPrepository, update thepyHARPsubmodule (e.g.,git submodule update --remote pyHARPor by manually checking out the desired commit within the submodule and then committing the change in the parentHARPrepo), and then commit this submodule update in theHARPrepository.
- Thanks to the
Additional Website-Specific Content:
- You can create new Markdown files directly within
website/content/or its subdirectories (e.g.,website/content/new-page.md) for content that is specific to the website and doesn't belong in the main repositories.
- You can create new Markdown files directly within
Site Structure and Navigation:
- The navigation bar, sidebar, footers, and other site-wide configurations are managed in the
website/.vitepress/config.mjsfile. You edit this file to define how your Markdown files are organized and presented in the site's navigation.
- The navigation bar, sidebar, footers, and other site-wide configurations are managed in the
Homepage:
- You can modify the contents of the homepage in
website/index.md.
- You can modify the contents of the homepage in
Images:
- If you want to add images, you can put them in
website/public/images(or any subdirectory withinpublic) and reference them in your markdown files using a root-relative path, e.g.,
markdownAlternatively, for images specific to content pages, you can place them alongside your markdown files in
website/content/and use relative paths.- If you want to add images, you can put them in
Deploy to Netlify
- Production Deployment: The
mainbranch of theHARPrepository is automatically deployed to our live URL: harp3.netlify.app. - Deployment Previews: Netlify automatically generates deployment previews for:
- All Pull Requests (PRs) made against the
mainbranch. - Any branch whose name starts with the prefix
website/*(e.g.,website/new-feature,website/docs-update).
- All Pull Requests (PRs) made against the
This allows for easy review of changes before they go live on the production site.