Contribution Guidelines
Hello and thank you for wanting to contribute to the project! All experience levels are welcome! Please take a look at HELPWANTED.md
to see items that are outside of the current team’s expertise that need help to expand the scope of the project.
The Unofficial UCSC Student Guide is an open source project and welcome to patches, contributions, and improvements!
The Guide lives on GitHub. You can view all of its source code there.
For those inexperienced with programming:
Create an issue
If there’s something you’d like to see in The Guide (or if you’ve found something that isn’t working the way you’d expect), but you’re not sure how to fix it yourself, please create an issue or contact Hilal via email (hamorrar@ucsc.edu) or Discord (hmorrar#1632).
For those experienced with programming:
Initial setup
The guide uses the extended version of hugo with the Docsy theme.
- Install Git.
- Install Node (and its dependencies if on Windows).
- Download and install the extended version of Hugo (linked above). You can also use
snap
to install the extended version of Hugo withsudo snap install hugo --channel=extended
.snap
works with a lot of Linux distros, and is pre-installed with some major distros such as Ubuntu 16.04+. - Fork the repository on GitHub.
- Use the recursive tag when cloning your fork so that all the submodules are also downloaded:
git clone --recursive git@github.com:your-username/ucsc-guide.git
cd ucsc-guide
to navigate into the project.- Install all the dependencies:
npm install
. - Use the
hugo serve
orhugo server
command to start the server. If you would like to expose the website to your network, usehugo serve --bind 0.0.0.0
orhugo server --bind 0.0.0.0
. This is useful for accessing the site from another machine when you are using a GUI-less OS to run the site. - Open a browser and go to
https://localhost:1313/ucsc-guide
.
Notes for Hugo development
The repository looks a bit intimidating at first, but most of it is all set up from Hugo initially. Most of the work will be done in the /content/en/docs
directory to write up articles in Markdown. When previewing changes locally, be careful of the draft
value in the top of the Markdown file you are working in. If it is set to true
, it will not show up in the final build, but it will show up in a preview only if you use the -D
flag in when starting the local server. Every article page you want to write has to have those preamble lines (Hugo calls it “front matter”) at the top for it to render correctly (or at all). You can copy and paste from another file and modify the appropriate fields.
title
is the title of the articlelinkTitle
is what will show up in the left navigation barauthor
is the author of the articledate
is the date the article was written in YYYY-MM-DD formatweight
is for ordering the pages in the directory for the left navigation baricon
is if you want to put an emote next to the title in the left navigation bar from Font Awesomedraft
is to publish the file on the site if it is in the main branch (false
- not a draft.true
- is a draft)description
is a quick one line summary/preview/subtitle for the article to display under the main title on the page
Create a pull request and preview locally
Continue with the usual GitHub workflow to edit files, commit them, push the changes up to your fork, and create a pull request. For more general information on how to contribute to open source projects, check out Open Source Guides. Please follow similar writing style in new contributions.
Steps to contribute:
- Fork the repository.
- Clone your fork to your machine.
- Create or checkout an/the appropriate branch.
- Commit your changes.
- Push to your fork of the repo.
- Make a Pull Request for review.
Conventions
When creating or editing pages, we follow certain conventions to ensure consistency across the codebase and articles. These conventions are listed below.
Conventions:
- Folders and subfolders within
/content/en/docs
are to bePascalCase
. - Files within
/content/en/docs
and its subfolders are to besnake_case
. An exception to this convention is index files. Index files should be named_index.md
. - Article titles are to be
Title Case
. - Article subheadings are to be
Sentence case
. - Commit messages are to be descriptive. They must describe the commit accurately and concisely.
Code reviews
Submissions will be reviewed by at least one person (Hilal). We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
Code of conduct
This project follows the Contributor Covenant Code of Conduct.
License
By contributing, you agree that your contributions will be licensed under the GNU General Public License v3.0 license.