netlify-plugin-sitemap icon indicating copy to clipboard operation
netlify-plugin-sitemap copied to clipboard

Compatible with SPA's?

Open dblodorn opened this issue 5 years ago • 5 comments

This plugin sounds promising - although it seems the use case is for static site generators - which build a bunch of HTML pages?

Any plan to include option to have this crawl a SPA and generate a sitemap?

Would love to know as i've been thinking on how to get dynamic sitemaps built on deploy for the various SPA websites i have up on netlify, if anything your work planted a seed for building a plugin for that use case myself.

Cheers!

dblodorn avatar Apr 23 '20 00:04 dblodorn

Hey! Good question.

Right now the plugin will only add fully rendered html pages to the sitemap.

This might make a cool feature though 😃

What kind of SPA are you building?

DavidWells avatar Apr 23 '20 00:04 DavidWells

@DavidWells - well i have a bunch of client sites that are built in either vue or react with a headless cms / not Next/Nuxt architecture. I've been able to generate the general sitemaps for declared routes with a webpack plugin, but would love to be able to dynamically generate a sitemap for all the dynamic pages too.

perfect example is this site: https://neighborhoodwatch.tv/ lots of individual work pages, but especially for the directors - would be nice for SEO.

Also I'm using prerender.io on a number of sites because i can explicitly declare when to render the page for crawlers (after api call, loading animation etc.) - and that has been working great. like on this site: https://shop.besito.la/ - but again the sitemap is the missing link.

Of course at some point i'll revisit the SSG / Next / Nuxt approach. But some sites have visual design features that just flow better with pure javascript.

I also created this webpack plugin to generate flat json files to use in production from my api call - so maybe i could hook into it somehow.

https://github.com/dblodorn/fetch-json-webpack-plugin

But yeah so cool to just see this as a build step plugin as opposed to something i need to add into my webpack configs!

dblodorn avatar Apr 23 '20 00:04 dblodorn

I second this. Angular. (Or at least put a big note about this in the docs!)

jnfaerch avatar May 05 '20 14:05 jnfaerch

+1 for this -- I'm building a Redwood app and would love to use this plugin.

tctrautman avatar Aug 18 '20 23:08 tctrautman

I'm using create-react-app in many cases. I've found netlify's prerender feature + a decent sitemap can give you SEO on par with SSR

acomito avatar Jun 24 '21 14:06 acomito