How to generate sitemap by scully

angularscully

Scully is a static site generator for Angular applications. It can be used to build a static version of an Angular app, which means that all of the content is pre-rendered and stored as HTML files that can be served to users without the need for server-side processing.

To generate a sitemap using Scully, you can use the scully-plugin-sitemap plugin. This plugin generates a sitemap for your Angular app based on the routes defined in your app.

Here’s how you can use the scully-plugin-sitemap plugin to generate a sitemap for your Angular app:

  1. Install the scully-plugin-sitemap plugin by running the following command:
npm install scully-plugin-sitemap
  1. Import the scully-plugin-sitemap plugin in your Angular app by adding the following line to the top of your app.module.ts file:
import { ScullySitemapModule } from 'scully-plugin-sitemap';
  1. Add the ScullySitemapModule to the imports array in your app.module.ts file:
@NgModule({
  imports: [
    ScullySitemapModule
  ],
  ...
})
  1. Run the scully command to build your Angular app and generate the sitemap:
npx scully
  1. The sitemap will be generated as a sitemap.xml file in the dist directory of your Angular app. You can then upload this file to your website to make it available to search engines.