55 lines
2.2 KiB
Markdown
55 lines
2.2 KiB
Markdown
# CTAO Science Portal
|
|
|
|
Static Astro site with a git-based CMS (Sveltia). Code lives here; editorial
|
|
content lives in the separate [`ctao/content`](https://astro-git.isl-dev.grid.cyfronet.pl/ctao/content)
|
|
repository. Four Example pages are editable; all other pages are placeholders.
|
|
|
|
- Live demo: https://astro.isl-dev.grid.cyfronet.pl
|
|
- Editor: https://astro.isl-dev.grid.cyfronet.pl/admin/ (Gitea sign-in)
|
|
|
|
## Run locally
|
|
|
|
Node 22.19 or newer. Clone the content repository next to this one:
|
|
|
|
```sh
|
|
git clone https://astro-git.isl-dev.grid.cyfronet.pl/ctao/content.git ../content
|
|
npm ci
|
|
npm run dev # http://localhost:4321
|
|
```
|
|
|
|
The site reads `../content` directly through links, so pull that repository
|
|
for the latest content. To use a checkout elsewhere:
|
|
`npm run content:link -- <path>`.
|
|
|
|
Before pushing code, run `npm run check` (types, build, internal links).
|
|
|
|
## Edit content locally
|
|
|
|
With `npm run dev` running, open `http://localhost:4321/admin/` in Chrome or
|
|
Edge, choose **Work with Local Repository** and select the `../content` folder.
|
|
Saves write the Markdown files and show up on the local site on reload. They
|
|
are not committed: commit and push in `../content` to publish.
|
|
|
|
## Publishing
|
|
|
|
Pushing to `main` of `ctao/portal` (code) or `ctao/content` (content) on
|
|
Gitea rebuilds and publishes the live demo automatically; the online editor
|
|
commits to `ctao/content` directly. Pushing to Bitbucket does not deploy.
|
|
Server setup is in [deploy/README.md](deploy/README.md).
|
|
|
|
## Where things live
|
|
|
|
| Path | Purpose |
|
|
|---|---|
|
|
| `src/layouts/Base.astro` | Header, navigation, footer, page shell |
|
|
| `src/pages/example/[slug].astro` | Template for the editable Example pages |
|
|
| `src/data/examples.json` | Example pages: menu labels, order, slugs |
|
|
| `src/data/placeholders.json` | Placeholder pages |
|
|
| `src/styles/global.css` | All site styles |
|
|
| `public/admin/config.yml` | CMS fields and Gitea connection |
|
|
| `scripts/preview-styles.mjs` | Builds the CMS preview styles from `global.css` |
|
|
| `scripts/content.mjs` | Links the content checkout into the site |
|
|
|
|
To add an Example page, add it to `src/data/examples.json` and
|
|
`public/admin/config.yml`, and commit its Markdown file to `ctao/content`.
|