Skip to content

Commit 0b9d69e

Browse files
authored
Merge pull request #56 from ALRubinger/54
Issue #54: Add instructions to README for building the site locally
2 parents 489107c + 2435041 commit 0b9d69e

File tree

3 files changed

+79
-1
lines changed

3 files changed

+79
-1
lines changed

img/github-clone-button.png

21.2 KB
Loading

img/github-fork-button.png

1.34 KB
Loading

readme.md

+79-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,87 @@ This repository makes use of [reveal.js](https://github.com/hakimel/reveal.js).
1010
git submodule update --init
1111
```
1212

13+
## I want to build the website locally. How do I do that?
14+
- Ensure you have Ruby installed on your system and available from your system `$PATH`. Instructions will vary per environment but are available [here](https://www.ruby-lang.org/en/documentation/installation/).
15+
16+
```
17+
$> ruby --version
18+
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
19+
```
20+
21+
- (Optional, only for those looking to contribute changes upstream) Ensure you have Git installed on your system and available from your system `$PATH`. Instructions will vary per environment but are available [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
22+
23+
```
24+
$> $ git --version
25+
git version 2.17.1
26+
```
27+
28+
- Install [Jekyll](https://jekyllrb.com/) through Ruby's [Gem](https://rubygems.org/) package management system. Jekyll is a dynamic website generator that allows Ruby code to be executed at build time. The result is a site of static pages.
29+
30+
```
31+
$> gem install jekyll
32+
Building native extensions. This could take a while...
33+
...lots of output...
34+
21 gems installed
35+
```
36+
37+
- NOTE: When the Jekyll gem is installed it will rely on several native dependencies on your system, and you may have to go hunting to find these. For instance, on Fedora 27, you may need to install `gcc-c++`, `redhat-rpm-config`, and `ruby-devel` using a command like:
38+
39+
```
40+
$> sudo dnf install gcc-c++ redhat-rpm-config ruby-devel
41+
```
42+
- Fork the upstream code repository at [https://github.com/codeforboston/codeforboston.org](https://github.com/codeforboston/codeforboston.org) into your namespace using the GitHub UI.
43+
44+
![GitHub Fork Button](/img/github-fork-button.png "GitHub Fork Button")
45+
46+
- Clone your namespace's remote into your local file system. Copy the address of your remote repository, then use that as an argument to the `git clone` command. For those not using `git`, simply download the sources using GitHub's UI. In the command below, remember to replace `ALRubinger` with your GitHub user name.
47+
48+
![GitHub Clone Button](/img/github-clone-button.png "GitHub Clone Button")
49+
50+
```
51+
$> git clone [email protected]:ALRubinger/codeforboston.org.git
52+
Cloning into 'codeforboston.org'...
53+
remote: Counting objects: 1739, done.
54+
Receiving objects: 24% (418/1739), 1.65 MiB | 3.23 MiB
55+
...a lot of output...
56+
Resolving deltas: 100% (867/867), done.
57+
```
58+
59+
- Move into the new working directory
60+
61+
```
62+
$> cd codeforboston.org
63+
```
64+
65+
- Add a reference to the upstream remote repository so that you may later synchronize changes with new work.
66+
67+
```
68+
$> git remote add upstream [email protected]:codeforboston/codeforboston.org.git
69+
```
70+
71+
- Use Jekyll to build the site!
72+
73+
```
74+
$> $ jekyll build
75+
```
76+
77+
- Use Jekyll to start a small local web server to serve the site, reloading the build with changes you make to local files
78+
79+
```
80+
$> $ jekyll serve --livereload
81+
...lots of output...
82+
LiveReload address: http://127.0.0.1:35729
83+
Server address: http://127.0.0.1:4000/
84+
Server running... press ctrl-c to stop.
85+
```
86+
87+
- View the site using your web browser at the address indicated above, in this case `http://127.0.0.1:4000/`. Changes you make to the source files should trigger a Jekyll rebuild and appear in your browser once done.
88+
1389
## I want to update the wesite. How do I do that?
14-
- To add/update jobs, edit `_data/jobs.yml`
90+
- To add/update jobs, edit [`_data/jobs.yml`](https://github.com/codeforboston/CFB_static/edit/master/_data/jobs.yml)
1591
- To add/update events, edit [`_data/events/active.yml`](https://github.com/codeforboston/CFB_static/edit/master/_data/events/active.yml)
92+
- To add/update current projects, edit [`_data/projects/active.yml`](https://github.com/codeforboston/CFB_static/edit/master/_data/projects/active.yml)
93+
- To add/update retired projects, edit [`_data/projects/inactive.yml`](https://github.com/codeforboston/CFB_static/edit/master/_data/projects/inactive.yml)
1694
- To edit normal site pages, edit the `html` or `markdown` files in `_pages/`
1795
- To edit the homepage content, edit `index.html`
1896

0 commit comments

Comments
 (0)