Website for the UBC Computer Science Student Society.
netlify.toml
, under the key HUGO_VERSION
..nvmrc
. This is used by Netlify to build the site with the correct version of Node..nvmrc
to automatically switch to the correct version of Node.# clone the repository
git clone https://github.com/ubccsss/ubccsss.org.git
# cd into the repository
cd ubccsss.org
# ensure that the correct version of Node is used
nvm install
# install dependencies
npm install
# start the development server
hugo server
We welcome contributions of any kind including pages, suggestions, bug reports, pull requests etc. We would love to hear from you.
When you submit a PR, we automatically run the Prettier code formatter with the prettier-plugin-go-template plugin to help with Go template formatting. Please ensure you checkout the latest version of your PR after any formatting commits have been made when continuing to work on your PR.
To make changes to .prettierrc
, disable the Prettifier action on Github before making the PR.
Additional documentation can be found in the docs
folder.
Create a new event from the template using the hugo new
command. Replace "2021-01-01" with the day of the event, and "cool-event" with the URL for the event. The URL should be lowercase.
hugo new events/2021-01-01-cool-event.md
We especially appreciate contributions to our growing course review database!
There's a course review form on each course page at ubccsss.org/services/courses. Course review submissions are manually processed by CSSS team members, but if you would like to help us add your review directly to the course page by making a PR:
csssbot
.content
Contains content files corresponding to every post, event, and page. The events
folder contains events which can be added to a student's calendar, and the posts
folder contain general posts to display.
data
YAML files with some data used elsewhere in the site, including the Cube's address, images for the 3D cube on the homepage, and social media links.
layouts
and themes
.HTML template files for the site. Files with the same name in the layouts
folder override files in the themes/hugo-bootstrap
folder.
static
Static files that are copied into the website with no modifications. Images and PDF files are placed here.
HTTP headers can be set by editing the static/_headers
file.
Short links and other redirects can be configured in the static/_redirects
file. If you want to redirect to another page on the site, you can add a aliases
item to the metadata.
The site has three environments:
development
: This enviroment is used for development.preview
: The enviroment used for previewing the site on Netlify deploy previews (previews for merge requests).production
: This enviroment is used for production.Each environment has its own environment variables accessible in the config
folder.
The config
folder contains the following folders:
_default
development
preview
production
_default
contains the base configuration files, and depending on the environment, the files in the other folders will be automatically merged into the base configuration if _merge: deep
is added to the base file.
hugo server
runs the site in development mode by default.
hugo
builds the site in production mode by default.
Read the Hugo docs for more information on how they work.
Currently, there are three enviornment variables:
recaptchaSiteKey
: reCAPTCHA key for courses databse new review formworkerURL
: Cloudflare worker url for courses databse new review formgcseURL
: Google custom search engine url for searchbarCFBeaconData
: Data required for Cloudflare Analytics, which only includes our token for nownetlify.toml contains the configuration for the Netlify. HUGO_ENV
is used to select the environment for different Netlify environments.
# format all files
npm run format
# check for formatting errors
npm run dry
# start the development server
npm run dev
# build the website
npm run build