60 lines
1.3 KiB
Markdown
60 lines
1.3 KiB
Markdown
# Chrysoblog
|
|
|
|
A blog framework
|
|
|
|
## Building
|
|
|
|
To create the production version,
|
|
|
|
```bash
|
|
npm run build
|
|
```
|
|
|
|
You can preview the production build with `npm run preview`.
|
|
|
|
### Content
|
|
|
|
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.
|
|
|
|
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": [ ... ] }`
|
|
|
|
## Developing
|
|
|
|
Install [pre-commit](https://pre-commit.com/).
|
|
|
|
Install dependencies with `npm install` (or `pnpm install` or `yarn`). Then
|
|
start the dev server with
|
|
|
|
```bash
|
|
npm run dev [-- --open]
|
|
```
|
|
|
|
### Formatting
|
|
|
|
``` bash
|
|
npx eslint
|
|
```
|
|
|
|
### 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.
|