2024-09-11 00:51:05 -07:00
|
|
|
# Chrysoblog
|
|
|
|
|
2024-09-14 00:59:54 -07:00
|
|
|
A blog framework
|
2024-09-11 00:51:05 -07:00
|
|
|
|
2024-09-14 00:59:54 -07:00
|
|
|
## Building
|
2024-09-11 00:51:05 -07:00
|
|
|
|
2024-09-14 00:59:54 -07:00
|
|
|
To create the production version,
|
2024-09-11 00:51:05 -07:00
|
|
|
|
|
|
|
```bash
|
2024-09-14 00:59:54 -07:00
|
|
|
npm run build
|
2024-09-11 00:51:05 -07:00
|
|
|
```
|
|
|
|
|
2024-09-14 00:59:54 -07:00
|
|
|
You can preview the production build with `npm run preview`.
|
2024-09-11 00:51:05 -07:00
|
|
|
|
2024-09-14 00:59:54 -07:00
|
|
|
### Content
|
|
|
|
|
2024-09-19 13:46:26 -07:00
|
|
|
To insert custom content, create a directory with a similar structure to
|
|
|
|
`src/content`, and set the environment variable `CHRYSOBLOG_CONTENT` to that
|
|
|
|
directory. The website will be built statically in `build/`. Note that changing
|
|
|
|
`favicon.svg` will require modifying the `static/` folder.
|
2024-09-14 00:59:54 -07:00
|
|
|
|
2024-11-05 11:55:27 -08:00
|
|
|
Set `metadata.json` based on the example to have a custom avatar and background
|
|
|
|
image.
|
|
|
|
- `name`: Displayed name on the home page
|
|
|
|
- `blogName`: Displayed name of the blog
|
|
|
|
- `url`: The site url
|
|
|
|
- `frontDescription`: The text above the main navbar
|
|
|
|
- `frontCover`: Path to the cover image
|
|
|
|
- `picture`: Avatar
|
|
|
|
- `links`: A map of brands to links
|
|
|
|
- `extra`: Extra pages showing on the navbar
|
|
|
|
- `markdown`: `{ "highlighterLangs": [ ... ], "katex": [ ... ] }`
|
|
|
|
|
2024-09-14 00:59:54 -07:00
|
|
|
## Developing
|
|
|
|
|
2024-09-28 23:59:37 -07:00
|
|
|
Install [pre-commit](https://pre-commit.com/).
|
|
|
|
|
2024-09-28 15:18:09 -07:00
|
|
|
Install dependencies with `npm install` (or `pnpm install` or `yarn`). Then
|
|
|
|
start the dev server with
|
2024-09-11 00:51:05 -07:00
|
|
|
|
|
|
|
```bash
|
2024-09-14 00:59:54 -07:00
|
|
|
npm run dev [-- --open]
|
2024-09-11 00:51:05 -07:00
|
|
|
```
|
|
|
|
|
2024-09-28 15:30:11 -07:00
|
|
|
### Formatting
|
|
|
|
|
|
|
|
``` bash
|
2024-10-10 12:00:35 -07:00
|
|
|
npx eslint
|
2024-09-28 15:30:11 -07:00
|
|
|
```
|
|
|
|
|
2024-09-28 15:18:09 -07:00
|
|
|
### Testing
|
|
|
|
|
|
|
|
To run tests
|
|
|
|
``` bash
|
|
|
|
npx playwright test
|
|
|
|
```
|
|
|
|
|
|
|
|
All tests must have the suffix `.spec.[jt]s`. Be cautious while updating
|
|
|
|
`playwright` since the versions in `nixpkgs` and `node` must exactly match.
|