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

added sitemap #87

Merged
merged 2 commits into from
Feb 4, 2021
Merged

added sitemap #87

merged 2 commits into from
Feb 4, 2021

Conversation

Neobii
Copy link

@Neobii Neobii commented Feb 4, 2021

This adds a sitemap and robots file in postbuild with next-sitemap.

siteUrl: 'https://vulcan.next',
generateRobotsTxt: true,
//outDir: './out/', for static builds
exclude: ['/vns/*', '/login', '/profile', '/signup', '/admin', '/auth'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead have a whitelist approach with include? Vulcan app are often private app so it make more sense to whitelist what you want to see in the sitemap than what you don't want to see

Copy link
Author

@Neobii Neobii Feb 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like that package supports include at the moment. However, I can change the robots disallow to allow.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The robots.txt file I'm thinking of is something like?
allow: ['/','/docs/*'],

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is in the postbuild command, you might want to add this file to .gitignore

@@ -0,0 +1,14 @@
# *
User-agent: *
Disallow: /vns/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it also autogenerated? It could also be in .gitignore

@eric-burel
Copy link
Collaborator

eric-burel commented Feb 4, 2021

Great stuff thank you! Would you mind adding a word about this feature in the documentation? The file is there: /src/pages/docs/features.md

I try to keep track of all features we add progressively

@eric-burel eric-burel merged commit d1c2378 into VulcanJS:devel Feb 4, 2021
@eric-burel
Copy link
Collaborator

Sounds good to me thanks for the quick update and the work!

@Neobii
Copy link
Author

Neobii commented Feb 4, 2021

No problem, should I write a test for this?

@eric-burel
Copy link
Collaborator

that could help indeed, you could add a test in "/tests/vns", for example inspired from "packages.test.ts". You could run the relevant yarn command as done in this example and check that the files are created as expected, I think that would be sufficient to tell that the sitemap script is working ok

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.

2 participants