Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xstevenyung/fresh-seo
The fastest way ⚡️ to create sitemap and robots.txt in your Deno Fresh project 🍋
https://github.com/xstevenyung/fresh-seo
deno fresh seo sitemap typescript
Last synced: 15 days ago
JSON representation
The fastest way ⚡️ to create sitemap and robots.txt in your Deno Fresh project 🍋
- Host: GitHub
- URL: https://github.com/xstevenyung/fresh-seo
- Owner: xstevenyung
- License: mit
- Created: 2022-06-30T22:00:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-15T16:09:32.000Z (about 1 year ago)
- Last Synced: 2024-10-17T09:27:10.281Z (27 days ago)
- Topics: deno, fresh, seo, sitemap, typescript
- Language: TypeScript
- Homepage:
- Size: 78.1 KB
- Stars: 49
- Watchers: 3
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fresh SEO 🍋 [![Badge License]][License]
*Quickly creating sitemaps for your **Deno [Fresh project]**.*
## Getting Started
*Import the plugin `freshSEOPlugin` in your Fresh app*
```ts
// ./main.ts
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";import { freshSEOPlugin } from "https://deno.land/x/fresh_seo/mod.ts";
await start(manifest, {
plugins: [
freshSEOPlugin(manifest)
],
});```
A basic sitemap should now be available at:
[`http://localhost:8000/sitemap.xml`][Localhost]
## How does it work?
**Fresh SEO 🍋** automatically maps out **static** routes in your project.
*For basic routes, you do not have to do anything manually.*
### Dynamic Routes
*You will still have to map dynamic routes yourself!*
```ts
// ./main.ts
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";import { freshSEOPlugin } from "https://deno.land/x/fresh_seo/mod.ts";
await start(manifest, {
plugins: [
freshSEOPlugin(manifest, {
include: ["/blog/intro"]
})
],
});
```*You can also remove unwanted routes*
```ts
// ./main.ts
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";import { freshSEOPlugin } from "https://deno.land/x/fresh_seo/mod.ts";
await start(manifest, {
plugins: [
freshSEOPlugin(manifest, {
exclude: [
"/blog/intro",
"/api/*"
]
})
],
});
```
## Testing
The test suite can be started with
```shell
deno task test
```
[Fresh project]: https://fresh.deno.dev/
[Localhost]: http://localhost:8000/sitemap.xml[License]: LICENSE
[Badge License]: https://img.shields.io/badge/License-MIT-ac8b11.svg?style=for-the-badge&labelColor=yellow