Website of the AI Centre at City St George's, University of London.
- Live site: https://aicentre-csg.github.io
- Stack: Jekyll + GitHub Pages, Bootstrap 3, Liquid templating, YAML data files
- Theme: based on the Allan Lab template
- local user management vs Github (or other)?
- social media not implemented/wired up
bundle install
bundle exec jekyll serveThe site is then available at http://localhost:4000. The published output in _site/ is generated and not committed.
| Path | Purpose |
|---|---|
_config.yml |
Jekyll site configuration (title, URL, Markdown settings) |
_data/ |
All content as YAML — news, publications, events, talks, grants, team, alumni |
_pages/ |
Site pages (HTML / Markdown with front matter) |
_includes/ |
Reusable partials — header, footer, news and events sidebars |
_layouts/ |
Page layouts — default, homelay, textlay, gridlay, team, etc. |
_sass/ / css/ |
Styles — SCSS partials compiled via css/main.scss |
_plugins/ |
Local Jekyll plugins |
.github/workflows/ |
GitHub Actions for the newsletter and social media automation |
.github/scripts/ |
Python scripts backing the automation workflows |
images/, fonts/, js/ |
Static assets |
Three structured listings, each driven by a YAML data file and rendered by a page:
| Section | Data file | Page |
|---|---|---|
| Events | _data/events.yml |
_pages/events.html |
| Talks | _data/talks.yml |
_pages/talks.html |
| Grants | _data/grants.yml |
_pages/grants.html |
Events and Talks pages split entries into Upcoming and Past; Grants splits into Active and Completed. To add content, edit the relevant YAML file — no template changes needed.
_pages/allnews.html (the News nav link) merges two sources into one chronological feed:
- Hand-written entries from
_data/news.yml. - Publications from
_data/publist.yml, synthesised into news items (New paper: …).
The page splits into Upcoming and Past around today's date. _includes/news.html is the homepage sidebar variant, showing only recent items.
_includes/events_upcoming.html shows the next few upcoming events in the homepage sidebar. It renders nothing when there are no upcoming events, avoiding an empty box.
- Date format: ISO 8601 in all data files. Use
"YYYY-MM-DD"for a date, or"YYYY-MM-DDTHH:MM:SS+HH:MM"when time matters (e.g."2026-05-20T14:30:00+01:00"). Always quoted so YAML keeps the value as a string. Templates render dates as10 July 2026, and as10 July 2026, 14:30when the value carries a time component. - Epoch-sort pattern: pages that mix and sort dated entries convert each date to epoch seconds, pack the fields as
epoch|||display_date|||headline, sort the strings (the epoch prefix gives correct chronological order), then split them back for display. - Upcoming vs. past: a 1-day grace buffer (
grace = 86400) keeps same-day items in the Upcoming section.
Two GitHub Actions workflows live in .github/workflows/:
Runs every Monday at 08:00 UTC (also manually triggerable). It runs generate_newsletter.py, which collects upcoming events, recent news, new papers and active grants, and opens a GitHub Issue containing the draft for an editor to review and send.
Triggers on push when any _data/*.yml content file changes. It runs post_social.py, which posts new entries to Mastodon, Bluesky, X (Twitter) and LinkedIn.
- Add repository secrets (Settings → Secrets and variables → Actions):
- Mastodon:
MASTODON_INSTANCE_URL,MASTODON_ACCESS_TOKEN - Bluesky:
BLUESKY_HANDLE,BLUESKY_APP_PASSWORD - X / Twitter:
TWITTER_API_KEY,TWITTER_API_SECRET,TWITTER_ACCESS_TOKEN,TWITTER_ACCESS_TOKEN_SECRET - LinkedIn:
LINKEDIN_ACCESS_TOKEN,LINKEDIN_PERSON_URN
- Mastodon:
- Set repository variable
SOCIAL_DRY_RUN=trueto log posts without publishing while testing. - Test the newsletter manually: Actions → "Weekly Newsletter Draft" → "Run workflow".
Note:
social-media.ymlcurrently triggers on pushes to themainbranch — confirm this matches the branch GitHub Pages actually publishes from before relying on it.
- Edit the relevant file in
_data/(see the tables above). - Commit and push to the publish branch — GitHub Pages rebuilds automatically.
- If automation secrets are configured, a social media post fires for new
_data/entries.
Updated: 2026-06-19
The admin editor now lives in the admin/ submodule, which points to:
- Admin app repo:
https://github.com/SyedHuq28/ai-csg-admin.git - Current admin app commit recorded by this site repo:
fa57f1d - Admin Vercel app:
https://ai-csg.vercel.app
The admin app is a small Next.js app deployed separately from the GitHub Pages site. It updates the website by committing to YAML files in the configured GitHub repo, opening or updating one shared pull request, and then allowing a reviewer to publish or reject it.
| Role | URL | Purpose |
|---|---|---|
| Content admin | https://ai-csg.vercel.app/dashboard |
Add content, preview the submitted entry, then Confirm or Cancel |
| PR reviewer | https://ai-csg.vercel.app/review |
Review confirmed changes, preview them, approve and publish, reject, or open GitHub |
There are two separate login pairs:
- Dashboard login:
ADMIN_USERNAMEandADMIN_PASSWORD - Review login:
ADMIN_PR_USERNAMEandADMIN_PR_PASSWORD
Do not commit the actual values. Set them in Vercel environment variables.
Set these on the Vercel project for ai-csg:
| Variable | Purpose |
|---|---|
ADMIN_USERNAME, ADMIN_PASSWORD |
Login for content admins |
ADMIN_TOKEN |
Server-side token for dashboard API calls |
ADMIN_PR_USERNAME, ADMIN_PR_PASSWORD |
Login for reviewers |
ADMIN_PR_TOKEN |
Server-side token for review API calls |
GITHUB_TOKEN |
GitHub token used by the admin APIs |
GITHUB_WRITE_REPO |
Repo where admin edits are committed |
GITHUB_TARGET_REPO |
Repo where the pull request is opened |
GITHUB_PREVIEW_REPO |
Optional repo for Vercel deployment statuses |
GITHUB_BRANCH |
Base branch for PRs, usually main |
GITHUB_DRAFT_BRANCH |
Draft branch for queued edits, default admin-drafts |
VERCEL_PREVIEW_URL_TEMPLATE |
Optional fallback external preview URL |
The GitHub token needs:
contents:writepull_requests:write
- A content admin logs in at
/dashboard. - The admin selects a section: News, Events, Talks, Grants, or Publications.
- The admin fills the form and clicks Save.
- The admin API appends the entry to the matching YAML file:
- News:
_data/news.yml - Events:
_data/events.yml - Talks:
_data/talks.yml - Grants:
_data/grants.yml - Publications:
_data/publist.yml
- News:
- The edit is committed to the configured draft branch, normally
admin-drafts. - The app opens one shared PR if none exists, or updates the existing open admin PR.
- The submitted form data is stored as hidden PR metadata so the admin app can preview it without relying on an external Vercel iframe.
- The dashboard Pending changes panel shows:
Open previewConfirmCancel
Open previewopens/preview?view=dashboard, showing the submitted entry as simple organised text.Confirmmarks the PR as ready for review. It disappears from/dashboardand appears on/review.Cancelcloses the PR and deletes the draft branch.- A reviewer logs in at
/review. - The reviewer sees the confirmed PR and can:
- open the same simple preview at
/preview?view=review - approve and publish
- reject
- view the PR on GitHub
Approve & publishsquash-merges the PR and deletes the draft branch.- GitHub Pages rebuilds the live site from
main.
As of 2026-06-19, the admin preview is deliberately simple.
It does not embed the Vercel site preview because the Vercel preview domain can refuse iframe connections. Instead, the admin preview page shows the submitted fields in an organised format that matches the website content structure closely enough for review.
For new pending changes, the preview shows full field details. Older PRs created before this change may only show summary lines.
The admin app must be pushed to SyedHuq28/ai-csg-admin.git. Vercel should redeploy ai-csg automatically from that repo.
This site repo tracks the admin app as a submodule. When the admin app is updated, also update and push the submodule pointer in this repo.
Latest workflow commits on 2026-06-19:
- Admin repo:
fa57f1d Render admin previews without iframe - Site repo:
7e68efe Update admin preview workflow
A separate Vercel site preview project can still exist for rendered Jekyll previews:
- Framework: Other
- Install command:
bundle install - Build command:
bundle exec jekyll build - Output directory:
_site
This is now optional for the admin workflow. The dashboard/review preview no longer depends on that external preview URL.
See WORKLOG.md for the earlier development history.