{"action":"created","issue":{"url":"https://api.github.com/repos/hexojs/hexo/issues/2294","repository_url":"https://api.github.com/repos/hexojs/hexo","labels_url":"https://api.github.com/repos/hexojs/hexo/issues/2294/labels{/name}","comments_url":"https://api.github.com/repos/hexojs/hexo/issues/2294/comments","events_url":"https://api.github.com/repos/hexojs/hexo/issues/2294/events","html_url":"https://github.com/hexojs/hexo/issues/2294","id":193272207,"number":2294,"title":"关于hexo API load()加载文件问题","user":{"login":"xbotao","id":6964173,"avatar_url":"https://avatars.githubusercontent.com/u/6964173?v=3","gravatar_id":"","url":"https://api.github.com/users/xbotao","html_url":"https://github.com/xbotao","followers_url":"https://api.github.com/users/xbotao/followers","following_url":"https://api.github.com/users/xbotao/following{/other_user}","gists_url":"https://api.github.com/users/xbotao/gists{/gist_id}","starred_url":"https://api.github.com/users/xbotao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbotao/subscriptions","organizations_url":"https://api.github.com/users/xbotao/orgs","repos_url":"https://api.github.com/users/xbotao/repos","events_url":"https://api.github.com/users/xbotao/events{/privacy}","received_events_url":"https://api.github.com/users/xbotao/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-12-03T07:26:37Z","updated_at":"2016-12-07T01:23:49Z","closed_at":"2016-12-07T00:34:08Z","body":"使用hexo api的问题，新建了一个node.js工程，用于调用hexo模块\r\n文件组织路径为，在node.js中调用hexo模块进行开发，调用`hexo.call('generate', {})`只能生成source目录下的文件，不能生成css文件，不知是什么原因?\r\n\r\n文件组织结构为如下\r\n![文件组织结构](http://oh1jgyw0v.bkt.clouddn.com/QQ%E6%88%AA%E5%9B%BE20161203232251.png)\r\n\r\n在app/index.js中调用hexo模块\r\n```\r\nvar Hexo = require('hexo');\r\nvar blogsPath = process.cwd() + '/blogs/';\r\nvar hexo = new Hexo(blogsPath, {});\r\n\r\nhexo.init().then(function(){\r\n  console.log('has init hexo module! @' + blogsPath);\r\n});\r\n\r\n//watch\\load\\call 等函数为异步，执行以后不能自动停止，应在返回以后按照顺序执行\r\nhexo.load().then(function(){\r\n  // You can call hexo.unwatch() later to stop watching.\r\n  console.log('has laod files! @' + blogsPath);\r\n  hexo.call('generate', {}).then(function(){\r\n    // ...\r\n    hexo.call('server', {}).then(function(){\r\n      win.loadURL(`http://localhost:4000/`);\r\n      //return hexo.exit();\r\n    });\r\n  });\r\n  \r\n});\r\n```\r\n \r\n运行app/index.js，生成文件输出为\r\n```\r\n[23:23:27] Finished 'run' after 7.2 ms\r\nINFO  Start processing\r\nhas init hexo module! @e:\\WorkSpace\\webProject\\electron\\lazyEditor/blogs/\r\nhas laod files! @e:\\WorkSpace\\webProject\\electron\\lazyEditor/blogs/\r\nINFO  Start processing\r\nINFO  Files loaded in 225 ms\r\nINFO  Generated: archives/2016/index.html\r\nINFO  Generated: archives/2016/12/index.html\r\nINFO  Generated: archives/index.html\r\nINFO  Generated: 2016/12/03/hello-world/index.html\r\nINFO  Generated: index.html\r\nINFO  5 files generated in 74 ms\r\nINFO  Start processing\r\nINFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.\r\n```\r\n切换blogs目录，直接使用`hexo g`指令，生成结果为\r\n```\r\nINFO  Generated: fancybox/fancybox_overlay.png\r\nINFO  Generated: css/fonts/fontawesome-webfont.eot\r\nINFO  Generated: fancybox/helpers/fancybox_buttons.png\r\nINFO  Generated: css/fonts/fontawesome-webfont.svg\r\nINFO  Generated: css/fonts/fontawesome-webfont.woff\r\nINFO  Generated: fancybox/helpers/jquery.fancybox-buttons.js\r\nINFO  Generated: css/fonts/FontAwesome.otf\r\nINFO  Generated: js/script.js\r\nINFO  Generated: css/style.css\r\nINFO  Generated: fancybox/helpers/jquery.fancybox-thumbs.js\r\nINFO  Generated: css/fonts/fontawesome-webfont.ttf\r\nINFO  Generated: fancybox/helpers/jquery.fancybox-buttons.css\r\nINFO  Generated: fancybox/helpers/jquery.fancybox-media.js\r\nINFO  Generated: fancybox/helpers/jquery.fancybox-thumbs.css\r\nINFO  Generated: css/images/banner.jpg\r\nINFO  23 files generated in 674 ms\r\n```\r\n\r\n通过比较，发现在nodejs工程中没有生成css文件，不知道这是什么原因造成的？是load()函数加载文件不全吗？"},"comment":{"url":"https://api.github.com/repos/hexojs/hexo/issues/comments/265327413","html_url":"https://github.com/hexojs/hexo/issues/2294#issuecomment-265327413","issue_url":"https://api.github.com/repos/hexojs/hexo/issues/2294","id":265327413,"user":{"login":"NoahDragon","id":5704064,"avatar_url":"https://avatars.githubusercontent.com/u/5704064?v=3","gravatar_id":"","url":"https://api.github.com/users/NoahDragon","html_url":"https://github.com/NoahDragon","followers_url":"https://api.github.com/users/NoahDragon/followers","following_url":"https://api.github.com/users/NoahDragon/following{/other_user}","gists_url":"https://api.github.com/users/NoahDragon/gists{/gist_id}","starred_url":"https://api.github.com/users/NoahDragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoahDragon/subscriptions","organizations_url":"https://api.github.com/users/NoahDragon/orgs","repos_url":"https://api.github.com/users/NoahDragon/repos","events_url":"https://api.github.com/users/NoahDragon/events{/privacy}","received_events_url":"https://api.github.com/users/NoahDragon/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T01:23:49Z","updated_at":"2016-12-07T01:23:49Z","body":"Glad it works."}}
{"actor":{"display_login":"NoahDragon"}}