Skip to content

Latest commit

 

History

History
71 lines (63 loc) · 1.06 KB

README.md

File metadata and controls

71 lines (63 loc) · 1.06 KB

hexo-robots

a hexo plugin that help you create robots.txt file when you build the site.

install

pnpm install hexo-robots

config

the following is the default config when you install this plugin.

// hexo _config.yml
robots:
  user_agent: "*"
  allow:
    - /
    - /archives/
    - /page/
    - /schedule/
    - /tags/
  disallow:
    - /js/
    - /css/
    - /images/
  sitemaps:

if you have multi user_agent config you can use the following way:

robots:
  user_agent: "*"
  allow:
    - /
    - /archives/
    - /page/
    - /schedule/
    - /tags/
  disallow:
    - /js/
    - /css/
    - /images/
  sitemaps:
  more:
    - user_agent: "other_agent_name_1"
      allow:
        - /
        - /archives/
        - /page/
        - /schedule/
        - /tags/
      disallow:
        - /js/
        - /css/
        - /images/
    - user_agent: "other_agent_name_2"
      allow:
        - /
        - /archives/
        - /page/
        - /schedule/
        - /tags/
      disallow:
        - /js/
        - /css/
        - /images/