DEPRECATED. Web site for Swift Education.
The Swift Education materials are out of date, and are no longer maintained.
This is the source code for generating the static content for the Swift Education web site hosted via GitHub Pages.
Everything in the master branch is publicly accessible via http://swifteducation.github.io. However, do not manually add html files and other assets to this branch! Everything on master should be a result of site generation via the develop branch.
The develop branch contains the actual source code for the web site. It is within the develop branch that you should make any changes, and generate the results in the build directory, which then gets committed and pushed to master. To learn more about this workflow, first set up your development environment, and then try making a change following the workflow tutorial.
This web site uses the Ruby Middleman gem for static site generation. Doing so allows you, the developer, to think in terms of templates and other features usually found in dynamic server-side frameworks. You should know, or be prepared to know, a little about Ruby, HAML, Compass/SASS, and the typical client-side web stack (HTML5, CSS, JavaScript). Due to its influence on Middleman, having experience with Rails is a plus, but is not required. Learning how to use Middleman itself is fairly easy.
gem install bundler
).git clone [email protected]:SwiftEducation/SwiftEducation.github.io.git
.git checkout develop
). The rule of thumb is "always be working in develop or a branch off of develop."bundle install
.git clone [email protected]:SwiftEducation/SwiftEducation.github.io.git build
. The rule of thumb here is "build should always be on the master branch."What you have done here is created a local repository for the web site, where you will be working in the develop branch. Once you have finished your changes, you will run middleman build
. This will translate the code in source into static files that reside in build. The build directory is bound to the master branch. After running middleman build
to generate a new static site in the build directory, you should cd
into the build directory, commit
and push
. This will push the new static site to the master branch on the remote (GitHub), which will then be visible at http://swifteducation.github.io.
This development environment configuration may seem a little strange, but is actually a simple method for using Middleman with GitHub Pages for organizations. To help reify this, let's walk through a simple change.
middleman server
from the repo root. Keep this running, and use another console for everything else.middleman server
from the repo root, or this documentation is wrong.git push origin develop
.middleman build
. This will generate a new static site in the build directory.cd
into the build directory and run a git diff
. If things seem as expected, commit
and push
.Try to create a well-described issue for a feature before implementing the change in the develop branch. Commits related to the issue should use a commit message prefixed with Issue #N
. Commits that resolve an issue should use Fixes #N
in the message, typically as the prefix. See the log for examples.
Commit messages should use present tense. For example, "Correct missing giraffe and add new gerbil," rather than "Corrected missing giraffe..." or "Correcting missing giraffe."
Improvements and corrections are welcome! Simply fork this repository, make your changes on the develop
branch, and create a pull request for the upstream develop
branch (not master
). If your PR is merged into the develop
branch, you can expect that the site generation will be run, and that your changes will be reflected on master
(and, therefore, the web site).
Copyright © 2015 Apple, Inc. All rights reserved.