First-time working on this project? Follow these steps, assuming no prior programming experience:
- Set up Git if you haven't already.
- Download your favorite code editor (we recommend Visual Studio Code).
- Install Deno.
- Clone this repository. For VSCode, this means you will do the following:
- Click the topmost file explorer icon in the sidebar.
- Click on "Clone Repository".
- Paste in the URL
https://github.com/ScottyLabs/cmu-guide.gitwhen prompted. - Open the repository.
- Open the terminal in your project. For VSCode, you can use the shortcut ctrl+` (backtick, same button as tilde ~).
Do the following whenever you want to work on the project:
- Run
deno task dev. This fetches dependencies and starts a local dev server for this website! - Follow the localhost link in the terminal output. For VSCode, hold down command or ctrl when clicking on the link.
Now, whenever you edit a file and save it (command+s or ctrl+s), your local server will automatically reload to reflect your changes! This means you don't have to quit and rerun the dev command whenever you make changes, as long as your server is running.
To contribute your changes to the repo:
Your pull request will be reviewed, and if merged, it will be published to cmu.guide!
- In
src/pages, create a file ending in.md(or use.mdxif your article uses Svelte components or LaTeX). - In
src/navigation/config.ts, add your file name as an item in its respective category. - Now go to the file you just created. Copy this frontmatter to the top of your file and fill in the values:
---
title: [ADD YOUR TITLE HERE]
description: [ADD YOUR DESCRIPTION]
contributors:
- name: [ADD YOUR FIRST AND LAST NAME HERE]
layout: ../layouts/Layout.astro
---You will change everything except for layout. If your article uses LaTeX, also add latex: true.
- Write your article under the frontmatter! When you are done, commit your changes and submit a pull request.
This project uses Deno. All commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
deno task dev |
Fetches dependencies and starts local dev server at localhost:4321 |
deno task check |
Checks Astro and TypeScript diagnostics |
deno task build |
Build your production site to ./dist/ |
deno task preview |
Preview your build locally, before deploying |
deno task astro -- ... |
Run CLI commands like astro add, astro check |
deno task astro -- --help |
Get help using the Astro CLI |
Since pagefind requires a build artifact, search will only work on deno task preview after running deno task build.
Warning
If you used this project before it migrated from Bun to Deno and a Deno command reports an unexpected dependency or type-resolution error, stop any running dev server, delete the ignored node_modules folder, then run deno task build or deno task dev again. Deno will recreate its dependency layout from the tracked deno.lock.
Astro looks for .md files in the src/pages/ directory. Each page is exposed as a route based on its file name. Any static assets, like images, should be placed in the public/ directory.
For more comprehensive instructions, visit the visit the Markdown content docs, or more generally, the Astro documentation.
Favicons were generated using favicon-generator.org.