feross / express-sitemap-xml Goto Github PK
View Code? Open in Web Editor NEWServe sitemap.xml from a list of URLs in Express
License: MIT License
Serve sitemap.xml from a list of URLs in Express
License: MIT License
I'm generating a sitemap without specifying a lastMod
intentionally since that property is optional, but the library is adding it regardless. Can we add an option to not include <lastmod>
unless explicitly set?
The HTTP content-type header is set to "text/html" rather than "application/xml".
You can try this on bitmidi.com.
β― curl -i https://bitmidi.com/sitemap.xml
HTTP/2 200
server: nginx
date: Fri, 09 Nov 2018 14:18:21 GMT
content-type: text/html; charset=utf-8
content-length: 445
vary: Accept-Encoding
x-content-type-options: nosniff
referrer-policy: strict-origin-when-cross-origin
strict-transport-security: max-age=31536000; includeSubDomains; preload
etag: W/"1bd-2bBiOMomgckrx3C9S+h6fksNNNc"
<?xml version="1.0" encoding="utf-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://bitmidi.com/sitemap-0.xml</loc>
<lastmod>2018-11-08</lastmod>
</sitemap>
<sitemap>
<loc>https://bitmidi.com/sitemap-1.xml</loc>
<lastmod>2018-11-08</lastmod>
</sitemap>
<sitemap>
<loc>https://bitmidi.com/sitemap-2.xml</loc>
<lastmod>2018-11-08</lastmod>
</sitemap>
</sitemapindex>
13.0.0
to 13.0.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
standard is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 4 commits.
c713e2e
13.0.1
72e0f1b
Update CHANGELOG.md
934a5b8
[email protected]
501624c
Update CHANGELOG.md
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
If I try to add an index URL to my sitemap, it always comes out in the sitemap with a trailing slash, which is not the canonical URL.
For example, if I give it a URL which is just an empty string, it returns one with a trailing slash:
const { buildSitemaps } = require('express-sitemap-xml')
const urls = ['']
async function run () {
const sitemaps = await buildSitemaps(urls, 'https://event1.io')
console.log(sitemaps['/sitemap.xml'])
// `<?xml version="1.0" encoding="utf-8"?>
// <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
// <url>
// <loc>https://event1.io/</loc>
// <lastmod>${getTodayStr()}</lastmod>
// </url>
// </urlset>`
}
I would expect it to look like this:
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://event1.io</loc>
<lastmod>${getTodayStr()}</lastmod>
</url>
</urlset>`
It looks as if this is due to the fact that the toAbsolute
function creates a new URL
object and returns the href
which always adds a trailing slash for the index URL.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.