|
1 | | -# LMU Open Science Center Home Page |
| 1 | +# LMU Open Science Center Website |
| 2 | + |
| 3 | +TL;DR: Run these commands to download the project, and build the first time. |
| 4 | + |
| 5 | +```bash |
| 6 | +git clone git@github.com:lmu-osc/lmu-osc.github.io.git |
| 7 | +cd lmu-osc.github.io |
| 8 | +R -e "renv::restore()" |
| 9 | +quarto preview |
| 10 | +``` |
| 11 | + |
| 12 | +The `renv:restore()` and `quarto preview` processes might take a bit to run the first time so go brew a ☕. |
2 | 13 |
|
3 | 14 | ## Overview |
4 | 15 |
|
5 | | -This repository hosts the OSC's home webpage where content from workshops, other websites, and related information is organized/linked to. |
| 16 | +This repository contains the source for the LMU Open Science Center website. |
6 | 17 |
|
7 | | -## Updating this Page |
| 18 | +The site is built with [Quarto](https://quarto.org/) as a multi-page website and combines hand-authored content, reusable templates, custom styling, and a small amount of automation for publishing and maintenance. |
8 | 19 |
|
9 | | -A CI/CD pipeline for automatically rendering and redeploying the website has been set up using GitHub Actions. What does this mean? TL;DR only changes to `.qmd` files (and `_quarto.yml`) should be made, and users who wish to make changes will need to make a new branch, push that branch to this repo, and open a pull request for their changes. |
| 20 | +At a high level, this repository contains the public-facing OSC website content, the navigation and page structure across the main site sections, the reusable templates and styling that support them, and the automation used for publishing and lightweight repository checks. |
10 | 21 |
|
11 | | -### Detailed Explanation |
| 22 | +## Tech Stack |
12 | 23 |
|
13 | | -High-level: the GitHub Action is configured to automatically rebuild and redeploy the site whenever a push is made to the `main` branch of this repository. There is a branch protection rule preventing direct pushes to `main` so pull requests for changes are required. The GH Action rebuilds the website on the `gh-pages` branch of this repo, and the GitHub Pages configuration is currently set to deploy the website from this branch in the Settings -> Pages repo section. |
| 24 | +The site is built with [Quarto](https://quarto.org/) and uses R with `renv` for reproducible dependency management. Content is primarily authored in YAML, Markdown, and `.qmd` files, with styling handled through SCSS and CSS. Deployment and repository checks are automated through GitHub Actions. The main Quarto configuration lives in `_quarto.yml`, rendered output is written to `_site/`, and Quarto caching is stored in `_freeze/`. |
14 | 25 |
|
15 | | -### Making Changes |
| 26 | +## Repository Structure |
16 | 27 |
|
17 | | -If you don't already have the repository on your system, clone a copy. |
| 28 | +The most important top-level directories are: |
18 | 29 |
|
19 | | -``` |
20 | | -git clone git@github.com:lmu-osc/lmu-osc.github.io.git |
21 | | -``` |
| 30 | +- `about/`: About pages and organizational information |
| 31 | +- `assets/`: shared images, JavaScript, Bootstrap, and Font Awesome assets |
| 32 | +- `events/`: event pages, templates, and helper scripts |
| 33 | +- `footer/`: footer markup and footer-specific styling |
| 34 | +- `news/`: news pages and metadata |
| 35 | +- `partners/`: partner and institutional member pages |
| 36 | +- `people/`: people pages, profile data, and listing templates |
| 37 | +- `training/`: training catalog, tutorials, and training-track content |
| 38 | +- `scripts/`: helper scripts used during site maintenance |
| 39 | +- `renv/`: project-local R environment management |
| 40 | +- \*`_site/`: rendered website output |
| 41 | +- \*`_freeze/`: Quarto execution cache |
22 | 42 |
|
23 | | -If you cloned a while ago or your copy is otherwise likely to be behind the code on GitHub, you'll want to pull the changes to your computer. (This is equivalent to fetching the changes *and* merging them.) |
| 43 | +The main entry point for the site is `index.qmd`. |
24 | 44 |
|
25 | | -``` |
26 | | -git pull |
27 | | -``` |
| 45 | +\* These files will appear locally, but do not and should not be on the GitHub repo. |
28 | 46 |
|
29 | | -Note that this will only integrate the changes for the branch you currently have checked out. If you want to pull changes for **all** of the branches you have locally and that have changes on GitHub, run `git pull --all` instead. |
| 47 | +## Content Organization |
30 | 48 |
|
31 | | -At this point, your local copy should be synced up with the remote repository on GitHub. To make changes, you will now need to create a new branch and checkout that new branch so you are working on it. |
| 49 | +Most pages in the repository are written as `.qmd` files. Section folders typically contain a landing page such as `index.qmd`, individual content pages, and any templates, metadata files, stylesheets, or helper scripts that are specific to that section. Some areas have their own internal documentation or specialized workflows. For example, `people/` contains profile pages, listing templates, and its own README for the people-page data model, while `events/` and `news/` include helper scripts for creating, migrating, or transferring content. In general, source content should be edited in the section folders rather than in `_site/`. |
32 | 50 |
|
33 | | -``` |
34 | | -git branch <new_branch> |
35 | | -git checkout <new_branch> |
36 | | -``` |
| 51 | +## Local Development |
37 | 52 |
|
38 | | -Make any desired changes and commit them. You can use the template code below or use your GUI for this easily. |
| 53 | +### Prerequisites |
39 | 54 |
|
40 | | -``` |
41 | | -git add -A |
42 | | -git commit -m "Your message here" |
43 | | -``` |
| 55 | +To work on this site locally, you should have Quarto, R, the project dependencies restored via `renv`, and `curl` available on your system. An IDE such as RStudio or VS Code is helpful, but not required. |
| 56 | + |
| 57 | +### Initial Setup |
44 | 58 |
|
45 | | -If this is a new branch, you will need to push the branch to GitHub. |
| 59 | +Clone the repository, open the project, and restore the R dependencies. |
46 | 60 |
|
| 61 | +In R: |
| 62 | + |
| 63 | +```r |
| 64 | +renv::restore() |
47 | 65 | ``` |
48 | | -git push -u origin <new_branch> |
| 66 | + |
| 67 | +This project uses a project-local `renv` library so builds are reproducible across machines and CI. |
| 68 | + |
| 69 | +### Previewing the Site |
| 70 | + |
| 71 | +To preview the site locally, run: |
| 72 | + |
| 73 | +```bash |
| 74 | +quarto preview |
49 | 75 | ``` |
50 | 76 |
|
51 | | -Now, there should be a notification on the repo page that a new branch has been pushed, and it should also ask if you would like to open a pull request. Follow this link, write an informative title and description of the pull request, and open it for review. (Ideally, someone else will be able to review your changes, but self-approvals are also fine if needed.) Following review, there are generally 3 options for pull requests: squashing, merging, and rebasing. I've disabled rebasing in this repo, and one should squash commits. (Squashing basically collapses all of the commits on your working branch e.g. `<new_branch>` into a single commit. It's a method to keep the commit history relatively clean and clear.) |
| 77 | +This starts a local preview server so you can inspect changes before committing them. Quarto writes the rendered output to `_site/`. |
| 78 | + |
| 79 | +## Contribution Guidance |
| 80 | + |
| 81 | +When contributing to the site, edit source files such as `.qmd`, `.yml`, `.css`, and templates—not directly in `_site/`, which is rendered output and should not be treated as the source of truth. Changes made directly to `_site/` will not be reflected in the final published website. |
| 82 | + |
| 83 | +Preview the affected pages locally using `quarto preview` before opening a pull request, and keep section-specific changes inside the relevant folder when possible. If working on structured sections such as `people/`, check whether that directory already has its own README or templates before inventing a new pattern. |
| 84 | + |
| 85 | + |
| 86 | +## Deployment |
| 87 | + |
| 88 | +On pushes to `main`, the `publish.yml` workflow restores dependencies, renders the site, and publishes to GitHub Pages. The repository also includes automated checks for links, profile naming conventions, and other maintenance tasks. |
52 | 89 |
|
53 | | -After the PR has been completed, the GH Action will take effect and the website should be updated within 5-10 minutes. You may need to view the page in incognito mode or force refresh multiple times as your browser will likely have an older cached version of the page. |
54 | 90 |
|
55 | | -Finally, you'll want to update your own local copy of this repository by returning to the beginning of these instructions (i.e. run `git pull`). |
56 | 91 |
|
57 | 92 |
|
0 commit comments