Skip to content

The fastest way ⚡️ to create sitemap and robots.txt in your Deno Fresh project 🍋

License

Notifications You must be signed in to change notification settings

xstevenyung/fresh-seo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fresh SEO 🍋   Badge License

Quickly creating sitemaps for your Deno Fresh project.


Getting Started

Import the plugin freshSEOPlugin in your Fresh app

// ./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


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!

// ./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

// ./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

deno task test

About

The fastest way ⚡️ to create sitemap and robots.txt in your Deno Fresh project 🍋

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published