Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
metalsmith-robots
Advanced tools
A metalsmith plugin for generating a robots.txt file
This plugin allows you to generate a robots.txt file. It accepts global options, and can be triggered from a file's frontmatter with the public
and private
keywords. Works well with metalsmith-mapsite, as that also accepts setting a page to private from the frontmatter.
For support questions please use stack overflow or the metalsmith slack channel.
$ npm install metalsmith-robots
Configuration in metalsmith.json
:
{
"plugins": {
"metalsmith-robots": {
"useragent": "googlebot",
"allow": ["index.html", "about.html"],
"disallow": ["404.html"],
"sitemap": "https://www.site.com/sitemap.xml"
}
}
}
Which will generate the following robots.txt:
User-agent: googlebot
Allow: index.html
Allow: about.html
Disallow: 404.html
Sitemap: https://www.site.com/sitemap.xml
You can pass options to metalsmith-robots
with the Javascript API or CLI. The options are:
useragent
: the useragent - String, default: *
allow
: an array of the url(s) to allow - Array of Stringsdisallow
: an array of the url(s) to disallow - Array of Stringssitemap
: the sitemap url - StringurlMangle
: mangle paths in allow
and disallow
- FunctionBesides these options, settings public: true
or private: true
in a file's frontmatter will add that page to the allow
or disallow
option respectively. metalsmith-robots
expects at least one of the last three options, without them it will not generate a robots.txt.
To make sure paths start with a /
you can mangle urls that are provided via allow
and disallow
.
.use(robots({
urlMangle: (filepath) => {
return (filepath.slice(0, 1) !== '/') ? `/${filepath}` : filepath;
}
}))
MIT
FAQs
A metalsmith plugin for generating a robots.txt file
The npm package metalsmith-robots receives a total of 10 weekly downloads. As such, metalsmith-robots popularity was classified as not popular.
We found that metalsmith-robots demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.