Have ideas to improve npm?Join in the discussion! »

vuepress-plugin-robots

1.0.1 • Public • Published

Robots.txt file plugin for Vuepress

Install

  • NPM
npm install vuepress-plugin-robots

Usage

Vuepress v0.x

NOT SUPPORT

Vuepress v1.x

Put your options in .vuepress/config.js file, please note: host option is mandatory.

// .vuepress/config.js
 
module.exports = {
  plugins: {
    'robots': {
        /**
         * @host
         * Mandatory, You have to provide the host URL
         */   
        host: "https://your-website",
        /**
         * @disallowAll
         * Optional: if it's true, all others options are ignored and exclude all robots from the entire server
         */
        disallowAll: false,
        /**
         * @allowAll
         * Optional: if it's true and @disallowAll is false, all others options are ignored and allow all robots complete access
         */
        allowAll: true,      
        /**
         * @sitemap
         * Optional, by default: sitemap.xml
         */ 
        sitemap: "/sitemap.xml",
        /**
         * @policies
         * Optional, by default: null
         */ 
        policies: [
            {
                userAgent: '*',
                disallow: [
                    '/admin','/login'
                ],
                allow: [    // Optional: Allowed paths. 
                    'products','blog'
                ]
            }
        ]
    },
  }
}

Thanks

Thanks to generate-robotstxt

Changelog

License

MIT

Install

npm i vuepress-plugin-robots

DownloadsWeekly Downloads

420

Version

1.0.1

License

MIT

Unpacked Size

4.83 kB

Total Files

3

Last publish

Collaborators

  • avatar