Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ota-meshi/svelte-adapter-ghpages
SvelteKit adapter for gh-pages
https://github.com/ota-meshi/svelte-adapter-ghpages
Last synced: 3 months ago
JSON representation
SvelteKit adapter for gh-pages
- Host: GitHub
- URL: https://github.com/ota-meshi/svelte-adapter-ghpages
- Owner: ota-meshi
- License: mit
- Created: 2021-12-12T08:31:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-19T21:02:39.000Z (3 months ago)
- Last Synced: 2024-10-24T17:49:20.818Z (3 months ago)
- Language: TypeScript
- Size: 65.4 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-svelte-kit - Github Pages
README
# svelte-adapter-ghpages
SvelteKit adapter for gh-pages
| :warning: WARNING: this project is considered to be in BETA until SvelteKit is available for general use and the Adapter API is stable! |
| --------------------------------------------------------------------------------------------------------------------------------------- |[![NPM license](https://img.shields.io/npm/l/svelte-adapter-ghpages.svg)](https://www.npmjs.com/package/svelte-adapter-ghpages)
[![NPM version](https://img.shields.io/npm/v/svelte-adapter-ghpages.svg)](https://www.npmjs.com/package/svelte-adapter-ghpages)
[![NPM downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&colorB=green&suffix=/day&query=$.downloads&uri=https://api.npmjs.org//downloads/point/last-day/svelte-adapter-ghpages&maxAge=3600)](http://www.npmtrends.com/svelte-adapter-ghpages)
[![NPM downloads](https://img.shields.io/npm/dw/svelte-adapter-ghpages.svg)](http://www.npmtrends.com/svelte-adapter-ghpages)
[![NPM downloads](https://img.shields.io/npm/dm/svelte-adapter-ghpages.svg)](http://www.npmtrends.com/svelte-adapter-ghpages)
[![NPM downloads](https://img.shields.io/npm/dy/svelte-adapter-ghpages.svg)](http://www.npmtrends.com/svelte-adapter-ghpages)
[![NPM downloads](https://img.shields.io/npm/dt/svelte-adapter-ghpages.svg)](http://www.npmtrends.com/svelte-adapter-ghpages)
[![Build Status](https://github.com/ota-meshi/svelte-adapter-ghpages/workflows/CI/badge.svg?branch=main)](https://github.com/ota-meshi/svelte-adapter-ghpages/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/github/ota-meshi/svelte-adapter-ghpages/badge.svg?branch=main)](https://coveralls.io/github/ota-meshi/svelte-adapter-ghpages?branch=main)## 📛 Features
This is an adapter for the [SvelteKit].
This adapter will generate `404.html` in addition to the files generated by [@sveltejs/adapter-static] to work well with GitHub Pages.## 💿 Installation
```bash
npm install --save-dev svelte-adapter-ghpages
```## 📖 Usage
Add it to `svelte.config.js`
```js
// svelte.config.js
import adapterGhpages from "svelte-adapter-ghpages";/** @type {import('@sveltejs/kit').Config} */
const config = {
// ...
kit: {
// ...
paths: {
base: "/your-repo-name",
},
// ...
adapter: adapterGhpages(
// default options are shown
pages: 'build',
assets: 'build',
fallback: null
),
// ...
},
};
```Add `404.svelte` to the routes directory.
For example: `src/routes/404.svelte`
```svelte
404
Not Found
````404.svelte` will be placed as `404.html` when you run `npm run build`.
[sveltekit]: https://kit.svelte.dev/
[@sveltejs/adapter-static]: https://github.com/sveltejs/kit/tree/master/packages/adapter-static### Options
#### `pages`, `assets`, `fallback`
See [https://github.com/sveltejs/kit/tree/master/packages/adapter-static#pages](https://github.com/sveltejs/kit/tree/master/packages/adapter-static#pages).
## :beers: Contributing
Welcome contributing!
Please use GitHub's Issues/PRs.
## :lock: License
See the [LICENSE](LICENSE) file for license rights and limitations (MIT).