urlpermalinksghosthexo

Use permalinks in config.yml


My categories correspond to my menu items. In my config.yml I specified for example:

menu:
  - name: phones
  - slug: phones
  - url: /categories/phones

Now how do I "remove" categories in the URL, so instead of blog.com/categories/phones the menu item directs to blog.com/phones?


Solution

  • Need to define categories permalinks in main Hexo _config.yml:

    category_dir: /
    

    Instead of:

    category_dir: categories