This repository holds the source for
the Software Carpentry web site.
Home pages for bootcamps are not stored in this repository:
if you want to create one,
please see the instructions in the bc
repository.
Software Carpentry is an open source/open access project, and we welcome contributions of all kinds. By contributing, you are agreeing that Software Carpentry may redistribute your work under these licenses.
Software Carpentry uses a development workflow similar to that of AstroPy and many other open source projects. The AstroPy docs have excellent sections on:
To build this web site,
you will need to clone git@github.com:swcarpentry/site.git
,
and then clone the submodule https://github.com/swcarpentry/v4.git
.
Note: this repository takes up roughly 360 MBytes
(including what's in .git
),
and the Version 4 lesson materials add another 300 MBytes.
Building the web site requires:
Python packages can be installed using:
$ pip install -r requirements.txt
We use Jekyll because it's what GitHub uses; we use Python because most of our volunteers speak it.
- Type
make
to see a list of all available commands. - Type
make cache
to fetch information about upcoming bootcamps. This must be done before building the web site. - Type
make site
to build everything in_site
for testing. (Depending on your machine, this takes about 10-15 seconds.)
We try to use the same MarkDown interpreters as GitHub does for consistency. On OS X, we suggest you use a recent Ruby to get access to these. If you don't have Homebrew or MacPorts installed, here's a quick recipe to get started using HomeBrew.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install ruby
gem install jekyll
gem install RedCloth
- We generate our own RSS feed (in
feed.xml
) and blog home page because Jekyll insists on using_posts/YYYY-MM-DD-name.html
, and we don't want to have hundreds of files in one directory. - Bootcamp pages for old bootcamps
are stored in the
bootcamps
directory of this repository, since there's little point in creating repos for them. New bootcamps should be created using the process described below.
Old bootcamps' home pages are stored in bootcamps/yyyy-mm-dd-site/index.html
.
Newer bootcamps' home pages are stored in their own repositories on GitHub.
The make target make cache
runs the program bin/get_bootcamp_info.py
which reads a list of GitHub repository URLs from the file config/bootcamp_urls.yml
and (re-)creates the file ./_bootcamp_cache.yml
.
That file is then used to build ./index.html
, bootcamps/index.html
, and so on.
To add another GitHub-hosted bootcamp to this web site,
simply add a line to config/bootcamp_urls.yml
.
Please keep these ordered by date.
To create a new blog post:
- Fork this repository on GitHub, and clone that to your desktop.
- Create a file
blog/YYYY/MM/post-name.html
, whereYYYY
is a four-digit year andMM
is a two-digit month. - Fill in the metadata at the top of the file:
layout
must beblog
.author
must be the author's name. (It does not need to be quoted.)title
is the post title.date
the date of the post (in YYYY-MM-DD format).time
must be an HH:MM:TT clock time. Use 09:00:00 for the first post on a particular day, 10:00:00 for the second, and so on, so that posts can be ordered.category
must be a list of category identifiers, e.g.,["Euphoric State University", "Assessment"]
You can run the commandmake categories
to get a list of existing category names.
- Use HTML to write the post.
- Use
<!-- start excerpt -->
and<!-- end excerpt -->
to mark a paragraph or two at the start as the excerpt to show in feed readers. - If you need to refer to our email address, it is
{{page.contact}}
. - If you need to another post, or something else on the site, use
{{page.root}}/path/to/file
. - We also provide
{{site.site}}
(the base URL for the site),{{site.twitter_name}}
,{{site.twitter_url}}
,{{site.facebook_url}}
,{{site.google_plus_url}}
, and{{site.rss_url}}
(all of which should be self-explanatory), and{{site.msl_url}}
for the Mozilla Science Lab's web site.
- Use
- Please add any images your blog post needs to the same blog/YYYY/MM directory as the post itself. Please use lower-case names without special characters for image files.
make
in the root directory will list available commands;make site
will rebuild the web site in the_site
directory. Open_site/index.html
to see your post on the blog's home page,_site/blog/index.html
to see it on the blog home page, and_site/YYYY/MM/post-name.html
to see the post itself.- When you're satisfied with your post,
git add path/to/post
andgit commit -m "Adding a blog post about something or other"
will commit it to your local copy (on your laptop). git push origin master
will push it to your clone on GitHub (assuming you've added your fork on GitHub as a remote calledorigin
).- Go to GitHub and issue a pull request from your clone to
swcarpentry/website
, then assign it to@gvwilson
or@amyrbrown
for proof-reading.
archive_verb
: collect and archive bootcamp information from GitHub and store in local cache (verbose).archive
: collect and archive bootcamp information from GitHub and store in local cache.authors
: list all blog post authors.biblio
: make HTML and PDF of bibliography.cache_verb
: collect bootcamp information from GitHub and store in local cache (verbose).cache
: collect bootcamp information from GitHub and store in local cache.- `categories : list all blog category names.
check
: check consistency of bootcamp info, urls and other.clean
: clean up.commands
: show all commands (the default).dev
: build into development directory on server.install
: build into installation directory on server.links
: check links.sterile
: really clean up.site
: build locally into _site directory for checking.valid
: check validity of HTML.
make site
, make dev
, and make install
do the following:
- Run
bin/preprocess.py
to create the./_config.yml
file required by Jekyll and the_includes/recent_blog_posts.html
file containing excerpts of recent blog posts. This tool collects metadata about blog posts and bootcamps and combines it with static configuration information. - Run Jekyll to build the web site.
- Run
bin/make_rss_feed.py
to generate the RSS feed filefeed.xml
. - Run
bin/make_calendar.py
to generate the ICal calendar filebootcamps.ics
. - Copy
./_htaccess
to create the.htaccess
file for the web site.
Software Carpentry uses Open Badges to recognize people's skills and accomplishments. To create badges, you must install PyPNG module:
$ pip install pypng
Use bin/badge-create.py
to create a new badge:
$ python bin/badge-create.py --username abbrev.name --email name@site.com --kind instructor
The badges scripts in bin
should be compatible with Python2 and Python3.
To bake the badge we use bin/badgebakery.py
which was provided by the Open Badge Team.
To validate a badge:
- Build this repository.
- Setup a local copy of Open Badges Validator.
- Setup a virtual server that responde to http://software-carpentry.org with the
content of
_site
. - Add "127.0.1.1 software-carpentry.org localhost" to
/etc/hosts
. - Open your local copy of Open Badges Validator with a web browser and follow the steps.