Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added information on sitemap generation #1145

Merged
merged 6 commits into from May 31, 2022
Merged

docs: added information on sitemap generation #1145

merged 6 commits into from May 31, 2022

Conversation

heychazza
Copy link
Contributor

πŸ”— Linked issue

Atinux/content-wind#5

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Sometimes users may want to generate a sitemap file, to make it easier for Google to index the content within your website. I personally had this issue, and after a discussion with @Atinux within Atinux/content-wind#5, he felt this could be good addition to the docs.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented May 25, 2022

βœ… Deploy Preview for nuxt-content ready!

Name Link
πŸ”¨ Latest commit 844bd12
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/629608d47bc16d0009b79523
😎 Deploy Preview https://deploy-preview-1145--nuxt-content.netlify.app/playground
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@heychazza
Copy link
Contributor Author

heychazza commented May 25, 2022

Just realised those using static sites won't be able to utilise this.. so solely only for those with SSR.

Live Example: https://stackblitz.com/edit/github-d1ngrx-aydi6d?file=nuxt.config.ts

@Tahul
Copy link
Contributor

Tahul commented May 26, 2022

Hello @heychazza :)

That looks like a nice addition to the docs!

Do you think it could be worth to implement this feature natively in @nuxt/content?

We already have navigation generation, so I guess it would not be so hard to create a sitemap out of this.

Maybe we could collaborate on this PR towards a native feature with its own documentation page?

cc @Atinux @farnabaz

@heychazza
Copy link
Contributor Author

heychazza commented May 26, 2022

Hello @heychazza :)

That looks like a nice addition to the docs!

Do you think it could be worth to implement this feature natively in @nuxt/content?

We already have navigation generation, so I guess it would not be so hard to create a sitemap out of this.

Maybe we could collaborate on this PR towards a native feature with its own documentation page?

cc @Atinux @farnabaz

Hey buddy, I think this would be a superb addition to give people out-the-box sitemap generation for their blogs.

I'd be happy to help! :)

@farnabaz
Copy link
Member

Generating sitemaps mostly is project specific thing and generalizing it in content module may create some edge case issues.

  • How we should treat partials? ignore then or assume they are standalone page? (if we think of them as a page we should have a rule to exclude _dir, _theme files)
  • What should we do with non-markdown files?
  • Users should be able to include/exclude contents in sitemap (also include their custom pages under pages/ directory)

Having documentation about how to create sitemap seems good to me, but we should have some notes about the partials, non-markdown and content filtering.

@Atinux
Copy link
Member

Atinux commented May 26, 2022

I don't think adding it into Content features is worth it like @farnabaz said, it is specific to each website and an example how to achieve it best from my POV.

I would maybe create a new category for these features, what about "Recipes"?

We could later on showcase also how to leverage the scheme-org module by @harlan-zw for instance.

@heychazza
Copy link
Contributor Author

I don't think adding it into Content features is worth it like @farnabaz said, it is specific to each website and an example how to achieve it best from my POV.

I would maybe create a new category for these features, what about "Recipes"?

We could later on showcase also how to leverage the scheme-org module by @harlan-zw for instance.

How about the idea of having a module for it? I know @nuxt/sitemap exists, but seems like content v2 isn’t yet supported

@Atinux
Copy link
Member

Atinux commented May 26, 2022

Let's start with an example in the documentation and get feedback from it first ☺️

@Atinux
Copy link
Member

Atinux commented May 26, 2022

For sitemap generation when using nuxt generate, we can advice to push the /sitemap.xml route into the nitro.prerender option in nuxt.config

@harlan-zw
Copy link
Contributor

Recipes sound good.

I'm sure we'll also see a bunch of specialised boilerplates and tutorials popping up which will also help users get set up for common use cases.

Also, last I heard on the sitemap module was that nitro would handle this as a plugin, so recommending bespoke sitemap generation may not be helpful once it's released.

@Atinux
Copy link
Member

Atinux commented May 27, 2022

Well we will be able to update the example once Nitro offers a better way to do it :)

@Atinux Atinux merged commit 834f52e into nuxt:main May 31, 2022
@benoitdemaegdt
Copy link

benoitdemaegdt commented Jun 28, 2022

Hey there πŸ‘‹

I'm a bit late on this PR since it is already merged πŸ˜…
However I was wondering why did you choose to use a server route for generating a sitemap and not a module ?

This is an attempt to have a module for generating a sitemap for dynamic sites powered by @nuxt/content and prerendered. So far it seems to be working even if code may be improved for better clarity.

I would be happy to talk about it and share progress if you are interested πŸ˜„

Copy link
Member

Atinux commented Jun 29, 2022

Nice work @benoitdemaegdt

It would be nice to update the structure to use the module starter for best packaging: https://github.com/nuxt/starter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants