-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Content type of the sitemap.xml is missing #467
Comments
@s-pace from Algolia also reported |
Let me try to fix this |
@rizafahmi It's yours! I've added an "issue-claimed" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim. I'll check in with you periodically so that we can keep the task updated with the progress. |
Thanks @yangshun ! |
Hi @lipis can you please confirm that the content-type is not I tried it with curl & httpie, it's already http http://localhost:3000/sitemap.xml -h
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 3060
Content-Type: application/xml; charset=utf-8
Date: Sun, 15 Apr 2018 14:48:38 GMT
ETag: W/"bf4-xyO2OFprLzDPuBKeUuyaw33D+Fk"
X-Powered-By: Express |
Type: Document And it renders it wrong in the browser.. Compare the two in the browser: |
So we use a third party npm library for the sitemap. https://github.com/ekalinin/sitemap.js (or https://www.npmjs.com/package/sitemap). https://github.com/facebook/Docusaurus/blob/master/lib/server/sitemap.js#L96 is where we set it. Maybe we are missing some options? I do notice we are doing instead of
|
👋 @JoelMarcey , Thanks for the details. One of the main point is to be compliant with the official standard. Definitely possible with the npm package. Happy to help if needed. Cheers |
@lipis both docusaurus and google was document on my side. But you're right about wrong rendering part. I'll check it out. |
@rizafahmi My bad.. check the Response Headers. The |
ah. i see. Thanks for the clarification @lipis |
Sorry @lipis to bother you again. There is actually I did validate the sitemap over https://validator.w3.org and https://www.xml-sitemaps.com/validate-xml-sitemap.html and all says valid. |
@s-pace Thanks for chiming in here. Hope all is well. Given what @rizafahmi says in the comment just above, do you think we what we have is already good and we do not need to make any changes? |
Not sure.. when I'm checking with cURL it's there.. but not in my Chrome :( So something is "wrong" and the best indicator is that it's not rendered as XML but as text.. not the most important thing in the world.. but still :) |
👋 @JoelMarcey My pleasure, hope you are doing well too. @rizafahmi Happy to try it with our tool. Could you provide me a testing link? 🙏 |
@s-pace This is the link that is being debated whether is wrong or correct? https://docusaurus.io/sitemap.xml This is a link that is assumed correct - https://www.google.com/sitemap.xml |
Works 💯. I have made an example:
<!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: '46899d51aa254ffb4fd068f3ae64ed40',
indexName: 'docusaurus_demo',
inputSelector: '### REPLACE ME ####',
algoliaOptions: { 'facetFilters': ["lang:$LANG", "version:$VERSION", "tags:$TAGS"] },
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
'facetFilters': ["lang:en", "version:latest", "tags:blog"]
We'd also be happy to get your feedback and thoughts about DocSearch - so we can continue to improve it. Have a nice day :) |
@s-pace Thank you! 👍 I commented on the docsearch commit you made that I think you changed the wrong config file. Let me know if that was the case. If so, we can fix that 😄 In the case of Docusaurus, we probably only need to add the |
Exactly! I use this index in order to show you how it would looks like. Let me know if I can merge it to the original one. |
Thanks @s-pace - I commented on the config changes over at algolia/docsearch-configs@db60b72 with a couple of questions. Assuming those are good, then I think we can merge it. |
Our sitemap is actually correct. The XML Viewer in chrome is wrong when we include alternate languages page on the sitemap. I tried https://www.w3schools.com/xml/xml_validator.asp & it's actually valid. If we really want to get that beautiful XML Viewer, removing the alternate languages will do so Edit: Closing this |
Hello i am facing same issue for xml. please check below link and help me to solve it |
Should be:
application/xml
https://stackoverflow.com/a/3272572/8418
The text was updated successfully, but these errors were encountered: