diff --git a/docs/app.html b/docs/app.html index b8fd92f8a..71ea53915 100644 --- a/docs/app.html +++ b/docs/app.html @@ -3,7 +3,7 @@
- + - + %sveltekit.head% diff --git a/docs/routes/setup.md b/docs/routes/setup.md index 67c7bb415..2c6609cb6 100644 --- a/docs/routes/setup.md +++ b/docs/routes/setup.md @@ -66,9 +66,7 @@ Add the following parts to your `svelte.config.js` file: ```js import adapter from '@sveltejs/adapter-auto' -import { preprocess, plugins } from 'omorphia/config/svelte' -import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin' -import { Generator } from 'omorphia/plugins' +import { preprocess } from 'omorphia/config/svelte' import path from 'path' /** @type {import('@sveltejs/kit').Config} */ @@ -82,24 +80,6 @@ const config = { $generated: path.resolve('./generated'), $stores: path.resolve('./src/stores'), }, - - vite: { - plugins: [ - ...plugins, - precompileIntl('locales'), - Generator({ - gameVersions: true, - openapi: true, - // Add more if needed - }), - ], - - server: { - fs: { - allow: ['generated'], - }, - }, - }, }, } @@ -114,7 +94,38 @@ import { writable } from 'svelte/store' export const token = writable('') ``` -## `5.` Configure PostCSS +## `5.` Configure Vite + +Add the following to your `vite.config.js` file: + +```js +import { plugins } from 'omorphia/config/vite.js' +import { Generator } from 'omorphia/plugins' +import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin' + +/** @type {import('vite').UserConfig} */ +const config = { + plugins: [ + ...plugins, + precompileIntl('locales'), + Generator({ + gameVersions: true, + openapi: true, + // Add more if needed + }), + ], + + server: { + fs: { + allow: ['generated'], + }, + }, +} + +export default config +``` + +## `6.` Configure PostCSS Create a `postcss.config.cjs` file in the root of your project. @@ -124,7 +135,7 @@ Add the following line to that file: module.exports = require('omorphia/config/postcss.cjs') ``` -## `6.` Setup styles +## `7.` Setup styles Import styles in `src/routes/__layout.svelte`: @@ -142,7 +153,7 @@ Add the `base` class and a theme to the `` tag in `src/app.html`: ``` -## `7.` Setup fonts +## `8.` Setup fonts Copy the the `fonts/` folder from [Omorphia's repository](https://github.com/modrinth/omorphia/blob/main/docs/static/assets/fonts) and place them in the `static/` folder at the root of your project. @@ -151,14 +162,14 @@ Add the following preload tags to your head in `app.html` to speed up font loadi ```html - - - + + + ``` -## `8.` Using Omorphia +## `9.` Using Omorphia ### Developing diff --git a/docs/static/assets/fonts/InterBold.woff2 b/docs/static/fonts/InterBold.woff2 similarity index 100% rename from docs/static/assets/fonts/InterBold.woff2 rename to docs/static/fonts/InterBold.woff2 diff --git a/docs/static/assets/fonts/InterRegular.woff2 b/docs/static/fonts/InterRegular.woff2 similarity index 100% rename from docs/static/assets/fonts/InterRegular.woff2 rename to docs/static/fonts/InterRegular.woff2 diff --git a/docs/static/assets/fonts/InterSemiBold.woff2 b/docs/static/fonts/InterSemiBold.woff2 similarity index 100% rename from docs/static/assets/fonts/InterSemiBold.woff2 rename to docs/static/fonts/InterSemiBold.woff2 diff --git a/docs/static/assets/omorphia.png b/docs/static/omorphia.png similarity index 100% rename from docs/static/assets/omorphia.png rename to docs/static/omorphia.png diff --git a/src/styles/variables/typography.postcss b/src/styles/variables/typography.postcss index a9cdaa073..d60c5d53a 100644 --- a/src/styles/variables/typography.postcss +++ b/src/styles/variables/typography.postcss @@ -25,7 +25,7 @@ font-style: normal; font-weight: 400; font-display: fallback; - src: local(''), url('/assets/fonts/InterRegular.woff2') format('woff2'); + src: local(''), url('/fonts/InterRegular.woff2') format('woff2'); } /* inter-600 - latin */ @@ -34,7 +34,7 @@ font-style: normal; font-weight: 600; font-display: fallback; - src: local(''), url('/assets/fonts/InterSemiBold.woff2') format('woff2'); + src: local(''), url('/fonts/InterSemiBold.woff2') format('woff2'); } /* inter-700 - latin */ @@ -43,6 +43,6 @@ font-style: normal; font-weight: 700; font-display: fallback; - src: local(''), url('/assets/fonts/InterBold.woff2') format('woff2'); + src: local(''), url('/fonts/InterBold.woff2') format('woff2'); } }