extrahop / metalsmith-sitemap Goto Github PK
View Code? Open in Web Editor NEWA metalsmith plugin for generating a sitemap.xml file.
License: MIT License
A metalsmith plugin for generating a sitemap.xml file.
License: MIT License
It would make sense for it to accept an array of minimatch strings, but that does not seem to be the case. So what does it accept? I couldn't find it in the documentation.
Hello! Thank you for creating such a useful plugin. Here is my question: Is it a bug or a feature that metalsmith-sitemap doesn't generate entry for the root directory <loc>hostname/</loc>
? I would like to add this important entry to my sitemap.xml. How can I do this?
Rather than require a hostname opt, can you also look and see if it is available from the metalsmith metadata? This way I can define a hostname from an earlier plugin.
Affected lines:
https://github.com/ExtraHop/metalsmith-sitemap/blob/master/lib/index.js#L48-L50
Happy to send a pull request if you authorize the change.
according to your docs lastmod should be a Date object, however, the sitemap module https://github.com/ekalinin/sitemap.js/blob/master/lib/sitemap.js has the following code:
// The date of last modification (YYYY-MM-DD)
else if (conf['lastmod']) {
// append the timezone offset so that dates are treated as local time.
// Otherwise the Unit tests fail sometimes.
var timezoneOffset = 'UTC-' + (new Date().getTimezoneOffset() / 60) + '00';
timezoneOffset = timezoneOffset.replace('--', '-');
var dt = new Date(conf['lastmod'] + ' ' + timezoneOffset);
this.lastmod = ut.getTimestampFromDate(dt, conf['lastmodrealtime']);
}
which assumes that last modification is a string (YYYY-MM-DD). You should either update your docs or internally render the lastmod toString() in the lastmodISO
field, to bypass this manipulation.
I have this frontmatter at the top of my blog root page:
---
template: blog.hbs
title: Blog
meta-description: MySite Blog
sitemap.changefreq: weekly
private: false
---
And my site build chain looks like:
.use(sitemap({
hostname: 'http://www.mysite.com/'
}))
and it is at the bottom of the chain, just before build. The sitemap output is:
<url>
<loc>http://www.mysite.com/pages/about</loc>
<lastmod>2015-06-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>http://www.mysite.com/pages/blog</loc>
<lastmod>2015-06-24</lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>http://www.mysite.com/pages/contact-us</loc>
<lastmod>2015-06-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority>
</url>
I have also tried setting a default of monthly in the build options, and they all get set to monthly, with no overrides from the frontmatter
I noticed that the NPM package is at v1.0.0
, but there is only one tag pushed to Github which is v0.0.10
. Would you be able to make tags and push those to Github so we can see differences between versions?
Sitemaps files shouldn't exceed 10MB or 50,000 URLs per file. This means you need a sitemap index file. Not sure if this should go into metalsmith-sitemap
or in sitemap.js
.
For more infomation, see: http://www.sitemaps.org/faq.html#faq_sitemap_size
I only found this project because another person was using it on his site. I's not listed in the plugins section of metalsmith.io.
Maybe it would be a nice idea to get it listed there?
What's the best way for issues and PRs to get dealt with? If ExtraHop's not maintaining this, maybe it could be transferred to https://github.com/metalsmith ?
I need to exclude a folder with files in them. Is there any way to do this? The folder is being generated by my pagination plugin.
[email protected]
is no longer npm install
able because of a broken dependency a few levels below that (to-function -> remove-try-require -> replace-method -> recast
)
Hi there, would you still update and publish this vital plugin if I create a PR modernizing it and adding a bunch of features?
new Buffer
with Buffer.from
engines.node
property to package.jsonpeerDependencies.metalsmith
property to package.jsonI setup the sitemap plugin like:
.use(sitemap({
hostname: 'http://www.myserver.com/',
defaults: {
changefreq: 'monthly'
}
}))
and also have a few files with this frontmatter:
---
template: page.hbs
title: Thank You
private: true
---
And the hostname IS being set, but changefreq is still set to 'daily', and the files with private:true are still being inserted into the sitemap.
omitIndex removes index.html by doing a chomp right. This leaves the trailing / on the URL. This may be correct for nested directories but it is odd to have a trailing / on the root of a site.
Google is failing to index one entry of the sitemap. My gut tells me it is the root page but google does not provide the insight into what page is failing.
Would be happy to write a fix if you can think of a good way to support both directories and the root site. Should it just be a hard coded check?
Currently, if a metalsmith attribute of "private" is set on the file, it is skipped during the sitemap build process.
This field should be configurable.
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.