|
1 | 1 | # website |
2 | | -Static Bootstrap 4 site generated by Jekyll |
3 | 2 |
|
4 | | -## Local Development |
5 | | -* [Install Jekyll](https://jekyllrb.com/docs/installation/) |
6 | | -* Install any new ruby packages via `bundle install` |
7 | | -* Dependencies: `gem install --user-install html-proofer` |
8 | | -* Preview changes with `jekyll serve` at http://localhost:4000 |
| 3 | +Static Bootstrap 4 site for the WiSE Lab, built with [Hugo](https://gohugo.io/) |
| 4 | +(migrated from Jekyll). |
9 | 5 |
|
10 | 6 | ## Making Updates |
11 | | -Modify content pages and push commit. Changes to `master` branch will automatically |
12 | | -be deployed to the live server (in about 60s) unless a `skip` keyword is included in |
13 | | -commit message, e.g. |
14 | | - |
15 | | -``` |
16 | | -Update README |
17 | 7 |
|
18 | | -[skip ci] |
19 | | -``` |
| 8 | +Modify content and push. Commits to `master` are built by GitHub Actions |
| 9 | +(`.github/workflows/build-hugo.yml`) and rsynced to the live server. |
20 | 10 |
|
21 | 11 | ### News |
22 | | -The news list is a simple [markdown block](_includes/news.md). |
| 12 | + |
| 13 | +The news list is a simple markdown block: [`assets/news.md`](assets/news.md). |
23 | 14 |
|
24 | 15 | ### Projects |
25 | | -Add projects to the `_projects` directory. |
26 | 16 |
|
27 | | -Specify the following metatags in header: |
28 | | -* `layout: project` |
29 | | -* `title:` [title] |
30 | | -* `image:` "/img/projects/[filename]" |
31 | | -* `priority:` [int] |
| 17 | +Add a markdown file to [`content/projects/`](content/projects/) with front matter: |
| 18 | + |
| 19 | +```yaml |
| 20 | +--- |
| 21 | +title: "[title]" |
| 22 | +image: "/img/projects/[filename]" |
| 23 | +priority: [int] |
| 24 | +--- |
| 25 | +``` |
32 | 26 |
|
33 | | -The body is markdown-enabled description of the project. |
34 | | -Images should be 3:2 ratio, ideally 510px * 340px. |
| 27 | +The body is a markdown-enabled description. Projects are listed in ascending |
| 28 | +`priority` order — `priority` is simply the position in the list (1 = first), so |
| 29 | +give each project a unique value. Images should be 3:2, ideally 510px × 340px, in |
| 30 | +`static/img/projects/`. |
35 | 31 |
|
36 | 32 | ### Team Members |
37 | | -Add team members to the `_team` directory. Move similarly formated entries into the `_alumni` directory as applicable. |
38 | 33 |
|
39 | | -Specify the following metatags in header: |
40 | | -* `firstname:` [firstname] |
41 | | -* `lastname:` [lastname] |
42 | | -* `priority:` [int] |
43 | | -* `title:` [title] |
44 | | -* `affiliation:` [department/school] |
45 | | -* `website:` [url] |
46 | | -* `image:` "/img/team/[filename]" |
| 34 | +Add an entry to [`data/team.yaml`](data/team.yaml) (move to |
| 35 | +[`data/alumni.yaml`](data/alumni.yaml) as applicable): |
| 36 | + |
| 37 | +```yaml |
| 38 | +- firstname: "[firstname]" |
| 39 | + lastname: "[lastname]" |
| 40 | + priority: [int] |
| 41 | + title: "[title]" |
| 42 | + affiliation: "[department/school]" |
| 43 | + website: "[url]" # optional |
| 44 | + image: "/img/team/[filename]" # empty string -> anon.png |
| 45 | +``` |
47 | 46 |
|
48 | | -Images should be square, ideally 450px * 450px. |
49 | | -Team member display is sorted first by priority, then by last name. |
| 47 | +Images should be square, ideally 450px × 450px, in `static/img/team/`. |
| 48 | +Members are sorted first by priority, then by last name. |
50 | 49 |
|
51 | 50 | ### Publications |
52 | | -Add/update BibTeX file as `/_pubs/wise.bib` |
53 | 51 |
|
54 | | -Supports following custom fields: |
55 | | -- `link`: URL to external ref, replaces `url` field. Displayed as hyperlink [(Link)](#) |
56 | | -- `pdf`: URL to PDF file. Displayed as hyperlink [(PDF)](#) |
57 | | -- `award`: Award mention, outputs as red text towards end of entry |
| 52 | +Add/update the BibTeX file [`_pubs/wise.bib`](_pubs/wise.bib) and push — that's it. |
| 53 | +The deploy workflow regenerates the publications list and the |
| 54 | +`static/bibliography/<key>.html` detail pages from it automatically |
| 55 | +([`scripts/gen_bib.py`](scripts/gen_bib.py)). |
| 56 | + |
| 57 | +_Optional — only to preview the publications page in a local `hugo server`:_ |
| 58 | + |
| 59 | +```bash |
| 60 | +python3 -m venv .bibvenv && .bibvenv/bin/pip install -r scripts/requirements.txt |
| 61 | +.bibvenv/bin/python scripts/gen_bib.py |
| 62 | +``` |
| 63 | + |
| 64 | +Supported custom fields (same as the old jekyll-scholar setup): |
| 65 | + |
| 66 | +- `link`: URL to an external reference. Displayed as `(Link)`. |
| 67 | +- `pdf`: URL to a PDF. Displayed as `(PDF)`. |
| 68 | +- `award`: Award mention, shown in red at the end of the entry. |
| 69 | + |
| 70 | +**NOTE:** Tilde characters (`~`) in `pdf`/`link` must be escaped as `\%7E`. |
| 71 | + |
| 72 | +## How the bibliography works |
| 73 | + |
| 74 | +Hugo has no BibTeX/citeproc engine, so [`scripts/gen_bib.py`](scripts/gen_bib.py) |
| 75 | +replaces jekyll-scholar: it parses `wise.bib`, renders each entry in APA style via |
| 76 | +`citeproc-py` + the bundled [`scripts/apa.csl`](scripts/apa.csl), groups entries by |
| 77 | +year (newest first), and emits the data + detail pages consumed by |
| 78 | +[`layouts/partials/bibliography.html`](layouts/partials/bibliography.html). Output |
| 79 | +matches the previous jekyll-scholar rendering. |
| 80 | + |
| 81 | +## Directory layout |
| 82 | + |
| 83 | +``` |
| 84 | +hugo.toml site config |
| 85 | +content/ pages (_index, about, publications) + projects/ |
| 86 | +data/ team.yaml, alumni.yaml, publications.json (generated) |
| 87 | +assets/ css/main.scss (+ bootstrap), news.md (Hugo Pipes) |
| 88 | +static/ img/, js/, favicons, bibliography/ (generated) |
| 89 | +layouts/ templates (baseof, partials, section/page layouts) |
| 90 | +scripts/ gen_bib.py, apa.csl, requirements.txt |
| 91 | +_pubs/wise.bib bibliography source |
| 92 | +``` |
| 93 | +
|
| 94 | +## Local Development |
| 95 | +
|
| 96 | +* Install the **extended** edition of Hugo (needed for the SCSS pipeline): |
| 97 | + <https://gohugo.io/installation/> |
| 98 | +* Preview with `hugo server` at <http://localhost:1313> |
| 99 | +* Build the production site into `public/` with `hugo --minify` |
58 | 100 |
|
59 | | -**NOTE:** |
60 | | -Tilde characters (~) in the `pdf` or `link` field must be escaped by `\%7E` |
| 101 | +> The publications list is generated from `_pubs/wise.bib` by the deploy workflow at |
| 102 | +> build time (see [Publications](#publications)) — nothing to run by hand. |
| 103 | +> `data/publications.json` and `static/bibliography/` are build artifacts and are |
| 104 | +> git-ignored; if you want the publications page to appear in a local `hugo server` |
| 105 | +> preview, generate them once (see below). |
0 commit comments