Source for UofT's Department of Astronomy and Astrophysics guide to graduate school at https://uoftgasa.github.io/. It's a static site: the handbook is written in Markdown and converted to HTML with pandoc, then served by GitHub Pages.
Everything in this repo is public. Don't commit passwords or other sensitive information.
| Path | What it is |
|---|---|
markdown/index.md |
Source for the handbook. Edit this. |
index.html |
Generated from markdown/index.md by convert_md_to_html.sh, so don't edit it directly. |
html-template/template.html |
Pandoc template: page layout, sidebar table of contents and a few inline TOC styles |
html-template/style.css |
Stylesheet linked by every page |
convert_md_to_html.sh |
Builds index.html from markdown/index.md |
You need Git and pandoc (checked with pandoc 3.8.2.1).
brew install pandoc # macOS; for other systems see https://pandoc.org/installing.html
git clone https://github.com/uoftgasa/uoftgasa.github.io.git
cd uoftgasa.github.iobash convert_md_to_html.sh # markdown/index.md -> index.html
open index.html # macOS; elsewhere, open index.html in any browser- Run the script from the repo root, because its paths are relative to the current directory.
- No local server is needed. The pages have no JavaScript and use relative paths, so opening the file directly works.
- After editing
markdown/index.mdortemplate.html, re-run the script and refresh the page. After editingstyle.css, just refresh.
- Edit
markdown/index.md. Headings down to###appear in the sidebar table of contents automatically. The sidebar is hidden on small screens, so also add new sections to the manual "Table of Contents" list near the top, and put a[**Table of Contents**](#table-of-contents)back-link under each section heading. - Run
bash convert_md_to_html.sh. - Check the result locally.
- Commit both
markdown/index.mdand the regeneratedindex.html. Nothing rebuilds the HTML on deploy, so if you skip the rebuild, your changes won't go live.
To change the look, edit html-template/style.css, which applies to all pages without a rebuild. The inline <style> block in template.html is copied into index.html, so changes there need a rebuild.
- Suggest a change: open an issue that says clearly what should change.
- Make the change yourself: fork the repo, or use a branch if you have write access. Follow the steps above and open a pull request into
master. Include the regeneratedindex.htmlso the change can go live as soon as it's merged.
There's no packaging step, because the committed files are the site. Push or merge to master. GitHub Pages then publishes the repo root to https://uoftgasa.github.io/, usually within a minute. Other branches and pull requests are not deployed.
Notes:
- Rebuild before you push: Pages serves
index.htmlas committed. It doesn't run pandoc. - Checking a deploy: each push starts a "pages build and deployment" run in the Actions tab. The Pages settings (source:
master, root folder) are under Settings → Pages. - Redeploying without changes: push an empty commit (
git commit --allow-empty -m "Redeploy" && git push).