gammastream/scully-plugins

Partial Scully runs with --routeFilter are not possible..

Closed this issue · 2 comments

Hi!

Great plugin, I'd really like to use it. However, for my workflow I need to be able to do partial (or delta runs) of Scully. Basically I do a full run of Scully, but then, when for example only a single product in my DB updated, I run Scully with the --routeFilter argument to only regenerate that single route. The result of this is that - instead of the plugin only updating that entry in the sitemap, it re-creates the sitemap with just that single route inside.

So the request is, can the sitemap actually be based on scully.routes.json? This file stays in-tact, also after delta generation of Scully files.

Hi @MikeOne. Good idea. I'll see what we can do.

@MikeOne, I believe I have a solution ready to go. It utilizes a merge flag to cause the generated routes to be merged into the existing sitemap (if there is one). Otherwise, the file is overwritten (the default). If you think that'll work, I'll get it published.

const SitemapPlugin = getSitemapPlugin();
setPluginConfig(SitemapPlugin, {
    urlPrefix: 'https://gamma.stream',
    sitemapFilename: 'sitemap.xml',
    changeFreq: 'monthly',
    priority: ['1.0', '0.9', '0.8', '0.7', '0.6', '0.5', '0.4', '0.3', '0.2', '0.1', '0.0'],
    merge: false,
    ignoredRoutes: ['/404'],
    routes: {
        '/products/:productId': {
            changeFreq: 'daily',
            priority: '0.9',
            sitemapFilename: 'sitemap-products.xml',
            merge: true,
        },
    }
});