如何为hexo

时间:2016-12-30 19:03:37

标签: css npm gulp hexo

我正在尝试将我的jekyll主题迁移到hexo。在该主题中,我使用gulp和一系列依赖项,例如kouto-swiss。现在,我在hexo创建了一个裸骨博客,并将我的jekyll css文件放在hexo主题的css文件夹中。

当我尝试使用主题构建网站时,我收到错误:

Error: /home/hkr/Desarrollo/blog/themes/cards/source/css/main.styl:21:9
   21| @import "kouto-swiss"
---------------^

我尝试将"kouto-swiss"添加为hexo博客的依赖项,如下所示:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.2.2"
  },
  "dependencies": {
    "gulp": "^3.9.1",
    "hexo": "^3.2.0",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.2.0",
    "hexo-renderer-marked": "^0.2.10",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-server": "^0.2.0",
    "kouto-swiss": "^1.0.0" <<-- Tried as dependency
  },
  "devDependencies": {
    "del": "^2.2.2",
    "gulp-clean-css": "^2.3.2",
    "gulp-htmlclean": "^2.7.8",
    "gulp-htmlmin": "^3.0.0",
    "gulp-imagemin": "^3.1.1",
    "gulp-uglify": "^2.0.0",
    "hexo": "^3.2.2",
    "kouto-swiss": "^1.0.0", <<-- And a dev dependency
    "run-sequence": "^1.2.2"
  }
}

但我无法让hexo clean && hexo generate工作,我不断获得:failed to locate @import file kouto-swiss.styl

有人能告诉我我做错了吗?

此致

注意

我可以解决这个错误写作:

@import "../../../../node_modules/kouto-swiss"

但我不认为这是正确的做法。有没有办法简单地写@import "kouto-swiss"

0 个答案:

没有答案