1.0.1 • Published 5 years ago

vuepress-plugin-robots v1.0.1

Weekly downloads
606
License
MIT
Repository
github
Last release
5 years ago

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