Add generator plugin

This commit is contained in:
venashial
2022-05-20 00:10:15 -07:00
parent 06c210f5c8
commit 0f6263d82e
11 changed files with 1446 additions and 147 deletions

View File

@@ -0,0 +1,38 @@
---
title: Generator plugin
---
The generator plugin creates static files from API responses to increase performance and perform tasks that would not be possible on the client. It regenerates files every 7 days, or when the plugin settings change.
### Current options
- `projectColors` (false) generates colors for every project
- `tags` (false) copies & parses tags from API
- `gameVersions` copes game versions from API
- `landingPage` gets icon urls for top 100 mods
> All options are disabled by default
## Configuration
```js
import Generator from 'omorphia/plugins/generator';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
vite: {
plugins: [
Generator({
projectColors: true,
tags: true,
gameVersions: true,
landingPage: true,
}),
],
},
},
};
export default config;
```