Source and content for the FRC Team 2984 website.
This site is compiled with Metalsmith, a static site generator. To use it, you'll need to install:
- Git for revision control;
- Node.js for language support;
- Atom or another text editor with syntax highlighting
Windows users will need to use PowerShell, which is built into Windows 7+.
A better option is a Unix-based operating system such as Ubuntu or OSX. You'll have fewer problems with running the console, linefeeds, and installing software.
First, fork the team's website repo. This will create a copy in your own GitHub account.
Next, clone the repo from your github account. This command (use Terminal or PowerShell) will typically look like this:
git clone [email protected]:{username}/website.git
Where {username}
is your GitHub username.
Change into the project directory:
cd website
Install dependencies:
npm install
Review changes:
git log
Open Atom and begin editing:
atom .
When done with your feature, commit changes:
git add .
git commit -m {message}
where {message}
describes your changes.
Then, push to your own GitHub repository:
git push origin master
Finally, create a pull request by clicking the "New pull request" button on the team's GitHub repo.
After awhile, the team repo and your own will diverge. Update your local repository as follows.
First, add the team's repo as a remote:
# be sure you're in the website working directory!
git remote add team https://github.com/FRCTeam2984/website.git
Next, merge changes onto a newly-created branch.
# create a branch and check it out
git checkout -b upstream
# pull changes
git pull team master
# You may need to handle merge conflicts
# checkout master
git checkout master
# merge changes
git merge upstream
# delete branch
git branch -d upstream
Metalsmith can compile the site and serve it through localhost
.
# clean the build directory
npm run clean
# compile
npm run compile
# start server, which serves content on localhost:3000
npm start
- Create a file called
src/blog/{title}
.md, where{title}
is a kebab-case version of your post's title. For example, for a title of "Hello World," use the filesrc/blog/hello-world.md
. - Front matter goes at the top of the file. Minimally, it should include:
title
;date
; andupdated
fields. - Compile. The new post should be available at the path
/blog/{title}/
.
You can preview a post directly from Atom without running Metalsmith.
First, install Atom Markdown Preview if it isn't already. To preview, press ctrl-shift-m (or command-shift-m on OSX).