Skip to content

Commit c39eafc

Browse files
committed
refactor: convert site to hugo + python bibtex parser
1 parent 4993f26 commit c39eafc

229 files changed

Lines changed: 4205 additions & 1743 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bundle/config

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/build-hugo.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and deploy Hugo site
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-hugo-deploy-remote:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
13+
# Hugo has no BibTeX engine, so regenerate the publications data + BibTeX
14+
# detail pages from _pubs/wise.bib before building (replaces jekyll-scholar).
15+
- name: Generate publications from BibTeX
16+
run: |
17+
python3 -m venv .bibvenv
18+
.bibvenv/bin/pip install --quiet -r scripts/requirements.txt
19+
.bibvenv/bin/python scripts/gen_bib.py
20+
- name: Setup Hugo
21+
uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3.2.1
22+
with:
23+
hugo-version: '0.163.3'
24+
extended: true
25+
- name: Build
26+
run: hugo --minify
27+
- name: rsync to remote server
28+
uses: burnett01/rsync-deployments@4d419d1dc46d4a8a2b6ceab2f951f0f93b2da8f5 # v9.0.0
29+
with:
30+
switches: -vazh
31+
path: public/*
32+
remote_path: ${{ secrets.DEPLOY_PATH }}
33+
remote_host: ${{ secrets.DEPLOY_HOST }}
34+
remote_user: ${{ secrets.DEPLOY_USER }}
35+
remote_key: ${{ secrets.DEPLOY_SSH_KEY }}

.github/workflows/build-jekyll.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.gitignore

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
_site
2-
.sass-cache
3-
.jekyll-metadata
4-
Gemfile.lock
5-
vendor
1+
# Hugo build output
2+
/public/
3+
/resources/
4+
.hugo_build.lock
5+
hugo_stats.json
6+
7+
# Publications — generated from _pubs/wise.bib by the deploy workflow (scripts/gen_bib.py)
8+
/data/publications.json
9+
/static/bibliography/
10+
11+
# Jekyll reference build (kept locally for comparison; not deployed)
12+
_site/
13+
14+
# Python virtualenvs for the bibliography generator
15+
.venv/
16+
.bibvenv/
17+
__pycache__/
18+
19+
# OS / editor
620
.DS_Store
7-
.jekyll-cache/

Gemfile

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 86 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,105 @@
11
# website
2-
Static Bootstrap 4 site generated by Jekyll
32

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).
95

106
## 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
177

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.
2010

2111
### 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).
2314

2415
### Projects
25-
Add projects to the `_projects` directory.
2616

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+
```
3226

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/`.
3531

3632
### Team Members
37-
Add team members to the `_team` directory. Move similarly formated entries into the `_alumni` directory as applicable.
3833

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+
```
4746
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.
5049

5150
### Publications
52-
Add/update BibTeX file as `/_pubs/wise.bib`
5351

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`
58100
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).

Rakefile

Lines changed: 0 additions & 10 deletions
This file was deleted.

_alumni/adwait.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

_alumni/akarsh.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

_alumni/anh.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)