|
1 |
| -# snap-www |
| 1 | +# snap-www |
| 2 | + |
| 3 | +This site is statically generated using [Jekyll](https://jekyllrb.com/). |
| 4 | +The source files live in `www`; Jekyll takes these as input and produces a static publishable copy of the site (that can be copied to a web server) in `www/_site`. |
| 5 | + |
| 6 | + |
| 7 | +## Requirements |
| 8 | + |
| 9 | +To build the site, you'll need a copy of [Jekyll](https://jekyllrb.com/): |
| 10 | +``` |
| 11 | +gem install bundler jekyll |
| 12 | +``` |
| 13 | + |
| 14 | + |
| 15 | +## Building the site |
| 16 | + |
| 17 | +After modifying the source files in `www`, use Jekyll to re-compile it: |
| 18 | +``` |
| 19 | +cd www |
| 20 | +jekyll build |
| 21 | +``` |
| 22 | + |
| 23 | +Note: If you see an opaque Ruby error, try prepending `bundle exec` to any Jekyll command. E.g.: |
| 24 | +``` |
| 25 | +cd www |
| 26 | +bundle exec jekyll build |
| 27 | +``` |
| 28 | + |
| 29 | +If you want to check your changes locally before publishing them to the web server, use `jekyll serve` instead (again, use `bundle exec` if needed): |
| 30 | +``` |
| 31 | +cd www |
| 32 | +jekyll serve |
| 33 | +``` |
| 34 | +Now go to `localhost:4000` in your browser. |
| 35 | +You can continue to edit the source files while `jekyll serve` is running; it will automatically re-compile the site as you save modifications. |
| 36 | + |
| 37 | + |
| 38 | +## Publishing the site |
| 39 | + |
| 40 | +TODO |
| 41 | + |
| 42 | + |
| 43 | +## Adding a person |
| 44 | + |
| 45 | +To add a new person, create a file called `<name>.md` in the `_people` directory. |
| 46 | +For exmaple, to add a profile for Harry Bovik, create the file `www/_people/harry-bovik.md`. |
| 47 | + |
| 48 | +The contents of the file should look like this: |
| 49 | +``` |
| 50 | +--- |
| 51 | +layout: person |
| 52 | +name: Harry Q. Bovik |
| 53 | + |
| 54 | +website: http://www.cs.cmu.edu/~bovik |
| 55 | +phone: +1 (412) 123-4567 |
| 56 | +office: GHC 0000 |
| 57 | +twitter: harrybovik |
| 58 | +github: harrybovik |
| 59 | +linkedin: https://www.linkedin.com/in/harry-bovik |
| 60 | +position: Faculty |
| 61 | +photo: harry-bovik.jpg |
| 62 | +--- |
| 63 | +
|
| 64 | +Harry's bio goes here. Feel free to use markdown syntax. |
| 65 | +
|
| 66 | +Multiple paragraphs are also okay. |
| 67 | +``` |
| 68 | + |
| 69 | +All of the metadata fields between the `---` markers are optional except `layout: person` and `name: ...`. |
| 70 | +To include a photo, save the photo to `www/images/people` and give the file name (not the full path) with the `photo: <file name>` tag in the metadata section. |
| 71 | +If the photo provided does not already have a square aspect ratio, it will be automatically cropped when displayed. |
| 72 | + |
| 73 | +When you're done, follow the instructions above to build and publish the updated site. |
| 74 | + |
| 75 | + |
| 76 | +## Adding a blog post |
| 77 | + |
| 78 | +To add a new blog post, create a file called `YYYY-MM-DD-<name>.md` in the `_posts` directory. |
| 79 | +`<name>` may be multiple words separated by hypens and the file name will be used to generate the post's URL. |
| 80 | +For example, a file named `2018-11-15-mctls-protocol.md` will result in a post with URL `<domain>/blog/2018/11/15/mctls-protocol.html` |
| 81 | + |
| 82 | +The contents of the file should look like this: |
| 83 | +``` |
| 84 | +--- |
| 85 | +layout: post |
| 86 | +title: mcTLS Specification |
| 87 | +author: David Naylor |
| 88 | +date: 2018-11-15 |
| 89 | +categories: ['research'] |
| 90 | +tags: ['network security', 'privacy', 'tls'] |
| 91 | +--- |
| 92 | +
|
| 93 | +Post content goes here. Feel free to use markdown syntax. |
| 94 | +
|
| 95 | +Multiple paragraphs are also okay. |
| 96 | +``` |
| 97 | + |
| 98 | +The `categories` and `tags` fields take arbitrary lists of strings (and can be omitted entirely). |
| 99 | + |
| 100 | +When you're done, follow the instructions above to build and publish the updated site. |
0 commit comments