hexojs / hexo-generator-feed

Feed generator for Hexo.

Home Page:http://hexo.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Tip: set the `url` config if your site is put in a subdirectory.

shuiRong opened this issue · comments

firstly, I got a error:

TypeError [ERR_INVALID_URL]: Invalid URL: http://
    at onParseError (internal/url.js:241:17)
    at new URL (internal/url.js:319:5)
    at new URL (internal/url.js:316:22)
    at cache.apply (/Users/xxxxx/Code/Blog/node_modules/hexo-generator-feed/node_modules/hexo-util/lib/url_for.js:35:18)
    at Cache.apply (/Users/xxxxx/Code/Blog/node_modules/hexo-generator-feed/node_modules/hexo-util/lib/cache.js:27:46)
    at Hexo.urlForHelper (/Users/xxxxx/Code/Blog/node_modules/hexo-generator-feed/node_modules/hexo-util/lib/url_for.js:30:16)
    at Hexo.autodiscoveryInject (/Users/xxxxx/Code/Blog/node_modules/hexo-generator-feed/lib/autodiscovery.js:14:64)
    at Hexo.tryCatcher (/Users/xxxxx/Code/Blog/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/Users/xxxxx/Code/Blog/node_modules/bluebird/js/release/method.js:15:34)

I finally found the reason: I need to set this config item. (in your root folder file _config.yml)

## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: '/blog/'