Skip to content

A plugin for Vuepress to create the robots.txt file 用来生成robots.txt文件的Vuepress插件

Notifications You must be signed in to change notification settings

HiYue/vuepress-plugin-robots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A plugin for Vuepress to create the robots.txt file 用来生成robots.txt文件的Vuepress插件

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •