美文网首页
hexo安装的一般步骤

hexo安装的一般步骤

作者: DamagedBoy | 来源:发表于2017-06-29 23:48 被阅读0次

    1:安装hexo

    npm install hexo-cli -g
    

    2:初始化一个项目

    hexo init <fileName>
    

    3:进入目录

    cd fileName
    

    4:

    nmp install 
    

    5:

    nmp server (localhost:4000)
    

    执行命令过程中获取会出错,解决办法如下:

    npm install hexo --no-optional
    

    如果上诉命令不成功,则执行:

    sudo npm uninstall hexo-cli -g
    sudo npm install hexo-cli -g 
    

    然后问题得到解决

    简单发布文章的步骤:
    1,hexo init <fileDir>
    2,cd fileDir
    3,hexo s 启动服务
    4,hexo new 'hello world' 创建文章
    会在source _posts 目录下生成当前 创建的文章的md文件
    5,编辑md文件
    6,运行hexo g 发布文章,将会在public _posts 文件夹下
    生成当前时间对应文章标题的index.html文件
    7,访问:http://localhost:4000/2017/03/09/文章/index.html

    相关文章

      网友评论

          本文标题:hexo安装的一般步骤

          本文链接:https://www.haomeiwen.com/subject/rgzvcxtx.html