|
1 | | -# Website |
| 1 | +# mpusp.github.io |
2 | 2 |
|
| 3 | +[](https://github.com/MPUSP/mpusp.github.io/actions/workflows/deploy.yml) |
| 4 | +[](https://github.com/MPUSP/mpusp.github.io/actions/workflows/deploy.yml) |
| 5 | + |
| 6 | +A homepage for the bioionformatic platform of the Max-Planck-Unit for the Science of Pathogens ([MPUSP](mpusp.mpg.de)). |
3 | 7 | This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. |
| 8 | +All data to render the less-static parts of the website (repo and user stats) are retrieved from Github using API requests. |
| 9 | +The website is automatically updated and built once per week, and on pull requests to the `main` branch. |
| 10 | + |
| 11 | +### Structure |
| 12 | + |
| 13 | +- The website is build using the Github action `.github/workflows/deploy.yml`. |
| 14 | +- The website building is tested for each PR to main with `.github/workflows/test-deploy.yml` |
| 15 | +- The Github action will retrieve public data from the Github API using two scripts |
| 16 | + - `src/scripts/generate_page.py`: collects all relevant data and stores it in `static/data/*.json` |
| 17 | + - `src/scripts/generate_workflow_md.py`: collects relevant workflow data and renders an info page in markdown format, exported to `docs/workflows/all_workflows/*.md` |
| 18 | +- static page data is located in the `docs/` dir, where also new `.md` docs can be added |
| 19 | +- all custom website elements and styles (cards, bar charts, etc) are located in `src/components` |
| 20 | +- global color and style definitions are located in `src/css/custom.css` |
| 21 | +- global header, footer, and metadata definition is located in `docusaurus.config.js` |
| 22 | + |
| 23 | +### Dependencies |
| 24 | + |
| 25 | +To develop the page locally, create a conda environment with the required packages: |
| 26 | + |
| 27 | +```bash |
| 28 | +conda create -n docusaurus -c conda-forge python pygithub jinja2 nodejs |
| 29 | +conda activate docusaurus |
| 30 | +``` |
4 | 31 |
|
5 | | -### Installation |
| 32 | +To create a test page, run: |
6 | 33 |
|
7 | 34 | ```bash |
8 | 35 | npm create-docusaurus@latest docusaurus-test classic |
9 | 36 | ``` |
10 | 37 |
|
11 | 38 | ### Local Development |
12 | 39 |
|
| 40 | +This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. |
| 41 | + |
13 | 42 | ```bash |
14 | 43 | npm start |
15 | 44 | ``` |
16 | 45 |
|
17 | | -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. |
18 | | - |
19 | | -### Build |
| 46 | +To build the website locally, run: |
20 | 47 |
|
21 | 48 | ```bash |
22 | 49 | npm run build |
|
0 commit comments