常用命令详解

Hexo 框架可以帮助我们快速创建一个属于自己的博客网站,熟悉 Hexo 框架提供的命令有利于我们管理博客

1、hexo init
hexo init 命令用于初始化本地文件夹为网站的根目录

$ hexo init [folder]
folder 可选参数,用以指定初始化目录的路径,若无指定则默认为当前目录
2、hexo new
hexo new 命令用于新建文章,一般可以简写为 hexo n

$ hexo new [layout] <br>layout 可选参数,用以指定文章类型,若无指定则默认由配置文件中的 default_layout 选项决定</p><p>title 必填参数,用以指定文章标题,如果参数值中含有空格,则需要使用双引号包围</p><p>3、hexo generate<br>hexo generate 命令用于生成静态文件,一般可以简写为 hexo g</p><p>$ hexo generate<br>-d 选项,指定生成后部署,与 hexo d -g 等价<br>详细信息请参考:<span class="external-link"><a class="no-external-link" href="https://hexo.io/docs/generating" target="_blank"><i data-feather="external-link"></i>https://hexo.io/docs/generating</a></span></p><p>4、hexo server<br>hexo server 命令用于启动本地服务器,一般可以简写为 hexo s</p><p>$ hexo server<br>-p 选项,指定服务器端口,默认为 4000</p><p>-i 选项,指定服务器 IP 地址,默认为 0.0.0.0</p><p>-s 选项,静态模式 ,仅提供 public 文件夹中的文件并禁用文件监视</p><p>说明 :运行服务器前需要安装 hexo-server 插件</p><p>$ npm install hexo-server --save<br>详细信息请参考:<span class="external-link"><a class="no-external-link" href="https://hexo.io/docs/server.html" target="_blank"><i data-feather="external-link"></i>https://hexo.io/docs/server.html</a></span></p><p>5、hexo deploy<br>hexo deploy 命令用于部署网站,一般可以简写为 hexo d</p><p>$ hexo deploy<br>-g 选项,指定生成后部署,与 hexo g -d 等价<br>说明 :部署前需要修改 _config.yml 配置文件,下面以 git 为例进行说明</p><p>deploy:</p><pre><code>type: git repo: <repository url> branch: master message: 自定义提交消息,默认为Site updated: {{ now('YYYY-MM-DD HH:mm:ss') }}</code></pre><p>详细信息请参考:<span class="external-link"><a class="no-external-link" href="https://hexo.io/docs/deployment.html" target="_blank"><i data-feather="external-link"></i>https://hexo.io/docs/deployment.html</a></span></p><p>6、hexo clean<br>hexo clean 命令用于清理缓存文件,是一个比较常用的命令</p><p>$ hexo clean<br>网站显示异常时可尝试此操作</p><p>7、Option<br>(1)hexo --safe<br>hexo --safe 表示安全模式,用于禁用加载插件和脚本</p><p>$ hexo --safe<br>安装新插件时遇到问题可尝试此操作</p><p>(2)hexo --debug<br>hexo --debug 表示调试模式,用于将消息详细记录到终端和 debug.log 文件</p><p>$ hexo --debug<br>(3)hexo --silent<br>hexo --silent 表示静默模式,用于静默输出到终端</p><p>$ hexo --silent</p><!--more--><p>指令大全<br> init<br>$ hexo init [folder]<br>新建一个网站。如果没有设置 folder ,Hexo 默认在目前的文件夹建立网站。</p><p>This command is a shortcut that runs the following steps:</p><p>Git clone hexo-starter including hexo-theme-landscape into the current directory or a target folder if specified.<br>Install dependencies using a package manager: Yarn 1, pnpm or npm, whichever is installed; if there are more than one installed, the priority is as listed. npm is bundled with Node.js by default.<br>new<br>$ hexo new [layout] <title><br>新建一篇文章。如果没有设置 layout 的话,默认使用 _config.yml 中的 default_layout 参数代替。如果标题包含空格的话,请使用引号括起来。</p><p>$ hexo new "post title with whitespace"<br>参数 描述<br>-p, --path 自定义新文章的路径<br>-r, --replace 如果存在同名文章,将其替换<br>-s, --slug 文章的 Slug,作为新文章的文件名和发布后的 URL<br>默认情况下,Hexo 会使用文章的标题来决定文章文件的路径。对于独立页面来说,Hexo 会创建一个以标题为名字的目录,并在目录中放置一个 index.md 文件。你可以使用 --path 参数来覆盖上述行为、自行决定文件的目录:</p><p>hexo new page --path about/me "About me"<br>以上命令会创建一个 source/about/me.md 文件,同时 Front Matter 中的 title 为 "About me"</p><p>注意!title 是必须指定的!如果你这么做并不能达到你的目的:</p><p>hexo new page --path about/me<br>此时 Hexo 会创建 source/_posts/about/me.md,同时 me.md 的 Front Matter 中的 title 为 "page"。这是因为在上述命令中,hexo-cli 将 page 视为指定文章的标题、并采用默认的 layout。</p><p>generate<br>$ hexo generate<br>生成静态文件。</p><p>选项 描述<br>-d, --deploy 文件生成后立即部署网站<br>-w, --watch 监视文件变动<br>-b, --bail 生成过程中如果发生任何未处理的异常则抛出异常<br>-f, --force 强制重新生成文件<br>Hexo 引入了差分机制,如果 public 目录存在,那么 hexo g 只会重新生成改动的文件。<br>使用该参数的效果接近 hexo clean && hexo generate<br>-c, --concurrency 最大同时生成文件的数量,默认无限制<br>该命令可以简写为</p><p>$ hexo g<br>publish<br>$ hexo publish [layout] <filename><br>发表草稿。</p><p>server<br>$ hexo server<br>启动服务器。默认情况下,访问网址为: <span class="external-link"><a class="no-external-link" href="http://localhost:4000/" target="_blank"><i data-feather="external-link"></i>http://localhost:4000/</a></span>。</p><p>选项 描述<br>-p, --port 重设端口<br>-s, --static 只使用静态文件<br>-l, --log 启动日记记录,使用覆盖记录格式<br>deploy<br>$ hexo deploy<br>部署网站。</p><p>参数 描述<br>-g, --generate 部署之前预先生成静态文件<br>该命令可以简写为:</p><p>$ hexo d<br>render<br>$ hexo render <file1> [file2] ...<br>渲染文件。</p><p>参数 描述<br>-o, --output 设置输出路径<br>migrate<br>$ hexo migrate <type><br>从其他博客系统 迁移内容。</p><p>clean<br>$ hexo clean<br>清除缓存文件 (db.json) 和已生成的静态文件 (public)。</p><p>在某些情况(尤其是更换主题后),如果发现您对站点的更改无论如何也不生效,您可能需要运行该命令。</p><p>list<br>$ hexo list <type><br>列出网站资料。</p><p>version<br>$ hexo version<br>显示 Hexo 版本。</p><p>选项<br>安全模式<br>$ hexo --safe<br>在安全模式下,不会载入插件和脚本。当您在安装新插件遭遇问题时,可以尝试以安全模式重新执行。</p><p>调试模式<br>$ hexo --debug<br>在终端中显示调试信息并记录到 debug.log。当您碰到问题时,可以尝试用调试模式重新执行一次,并 提交调试信息到 GitHub。</p><p>简洁模式<br>$ hexo --silent<br>隐藏终端信息。</p><p>自定义配置文件的路径</p><h1>使用 custom.yml 代替默认的 _config.yml</h1><p>$ hexo server --config custom.yml</p><h1>使用 custom.yml 和 custom2.json,其中 custom2.json 优先级更高</h1><p>$ hexo generate --config custom.yml,custom2.json,custom3.yml<br>自定义配置文件的路径,指定这个参数后将不再使用默认的 _config.yml。<br>你可以使用一个 YAML 或 JSON 文件的路径,也可以使用逗号分隔(无空格)的多个 YAML 或 JSON 文件的路径。例如:</p><h1>使用 custom.yml 代替默认的 _config.yml</h1><p>$ hexo server --config custom.yml</p><h1>使用 custom.yml, custom2.json 和 custom3.yml,其中 custom3.yml 优先级最高,其次是 custom2.json</h1><p>$ hexo generate --config custom.yml,custom2.json,custom3.yml<br>当你指定了多个配置文件以后,Hexo 会按顺序将这部分配置文件合并成一个 _multiconfig.yml。如果遇到重复的配置,排在后面的文件的配置会覆盖排在前面的文件的配置。这个原则适用于任意数量、任意深度的 YAML 和 JSON 文件。</p><p>显示草稿<br>$ hexo --draft<br>显示 source/_drafts 文件夹中的草稿文章。</p><p>自定义 CWD<br>$ hexo --cwd /path/to/cwd<br>自定义当前工作目录(Current working directory)的路径。</p></div> <!--文章的页脚部件:打赏和其他信息的输出--> <div class="show-foot"><div class="notebook" data-toggle="tooltip" data-original-title="February 25, 2021 8:20 am"> <i class="fontello fontello-clock-o"></i> <span>Last modification:February 25, 2021</span> </div><div class="copyright" data-toggle="tooltip" data-html="true" data-original-title="For reprint, please keep the reprint address of this article, and the copyright belongs to the author"><span>© Allow specification reprint</span> </div> </div> <!--打赏模块--> <div class="support-author"> <button id="support_author" data-toggle="modal" data-target="#myModal" class="box-shadow-wrap-lg btn_post_footer btn btn-pay btn-yellow btn-rounded"><svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true"><path d="M10.084 7.606c3.375-1.65 7.65-1.154 10.493 1.487 3.497 3.25 3.497 8.519 0 11.77-3.498 3.25-9.167 3.25-12.665 0-.897-.834-2.488-2.96-2.488-5.085" stroke="currentColor" stroke-width="1.4" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.392 14.78s1.532-1.318-.053-2.79c-1.585-1.473-3.17-.404-3.719.403-.549.807.495 2.082.93 2.69.434.61 1.364 2.182-.054 3.202-1.417 1.012-3.002.658-4.153-.708-1.15-1.367-.602-3.365 0-3.924M17.338 11.982l1.159-1.076M9.87 18.922l.937-.871" stroke="currentColor" stroke-width="1.4" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path><path d="M.8 1.205s7.15 4.673 8.773 6.182c1.623 1.508 3.231 4.008 1.616 5.509-2.195 2.04-4.054.595-6.737-.75-.884-.447-3.15-1.777-3.15-1.777M10.136.9l1.047 3.188" stroke="currentColor" stroke-width="1.4" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Support</span></button> <div id="myModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <div class="modal-dialog modal-sm" role="document"> <div class="modal-content box-shadow-wrap-lg"> <div class="modal-header box-shadow-bottom-normal"> <button type="button" class="close" data-dismiss="modal"><i style="vertical-align: bottom;" data-feather="x-circle"></i></button> <h4 class="modal-title">Appreciate the author</h4> </div> <div class="modal-body"> <div class="solid-tab tab-container post_tab"> <ul class="nav no-padder b-b scroll-hide" role="tablist"> <li class="nav-item active" role="presentation"><a class="nav-link active" style="" data-toggle="tab" role="tab" data-target="#alipay_author"><i class="iconfont icon-alipay" aria-hidden="true"></i>AliPay</a></li><li class="nav-item " role="presentation"><a class="nav-link " style="" data-toggle="tab" role="tab" data-target="#wechatpay_author"><i class="iconfont icon-wechatpay" aria-hidden="true"></i>WeChat</a></li> </ul> <div class="tab-content no-border"><div role="tabpanel" id="alipay_author" class="tab-pane fade active in"> <img noGallery class="pay-img tab-pane" id="alipay_author" role="tabpanel" src="https://www.iysheng.com/usr/themes/handsome/assets/img/loading.svg" data-original="https://pic1.rpgsky.net/imgcn/2020/02/24/2ec8f42384524367412609a04eabc5d4.png" /> </div><div role="tabpanel" id="wechatpay_author" class="tab-pane fade "> <img noGallery class="pay-img tab-pane" id="wechatpay_author" role="tabpanel" src="https://www.iysheng.com/usr/themes/handsome/assets/img/loading.svg" data-original="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-41032e11-40d4-47c2-93f1-5bd01453bb9f/1b2d118e-47b5-4d63-8536-57bd3cd7052e.jpg" /> </div> </div><!--tab-content--> </div> <!--tab-container--></div> <!--modal-body--> </div><!--modal-content--> </div><!--modal-dialog--> </div><!--modal--> <button id="star_post" data-cid="68" class="box-shadow-wrap-lg btn_post_footer like_button btn btn-pay btn-rounded"> <svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shake-little unlike_svg feather feather-thumbs-up"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg> <div class="circle-rounded"></div> <svg class="liked_svg" style="transform: scale(2.2);" xmlns="http://www.w3.org/2000/svg" viewBox="30 30 60 60" width="60" height="60" preserveAspectRatio="xMidYMid meet"> <g clip-path="url(#__lottie_element_1061)"> <g style="display: block;" transform="matrix(1,-0.0000012433954452717444,0.0000012433954452717444,1,47.87498474121094,47.057003021240234)" opacity="1"> <g class="like_rotate"> <g opacity="1" transform="matrix(1,0,0,1,14.376999855041504,11.416000366210938)"> <path stroke-linecap="butt" stroke-linejoin="miter" fill-opacity="0" stroke-miterlimit="10" stroke="rgb(255,255,255)" stroke-opacity="1" stroke-width="2" d=" M-7.936999797821045,9.531000137329102 C-7.936999797821045,9.531000137329102 3.378000020980835,9.531000137329102 3.378000020980835,9.531000137329102 C3.815999984741211,9.531000137329102 4.209000110626221,9.258999824523926 4.360000133514404,8.847000122070312 C4.360000133514404,8.847000122070312 7.501999855041504,0.36000001430511475 7.501999855041504,0.36000001430511475 C8.020000457763672,-1.0360000133514404 6.986000061035156,-2.5199999809265137 5.497000217437744,-2.5199999809265137 C5.497000217437744,-2.5199999809265137 -0.5669999718666077,-2.5199999809265137 -0.5669999718666077,-2.5199999809265137 C-0.6399999856948853,-2.5199999809265137 -0.6859999895095825,-2.5969998836517334 -0.6499999761581421,-2.6600000858306885 C-0.36800000071525574,-3.1679999828338623 0.6269999742507935,-4.922999858856201 0.8870000243186951,-5.764999866485596 C1.309000015258789,-7.13100004196167 0.847000002861023,-8.715999603271484 -1.4539999961853027,-9.519000053405762 C-1.4759999513626099,-9.526000022888184 -1.4989999532699585,-9.527000427246094 -1.5180000066757202,-9.519000053405762 C-1.5299999713897705,-9.513999938964844 -1.5410000085830688,-9.505999565124512 -1.5490000247955322,-9.494000434875488 C-1.7309999465942383,-9.234999656677246 -2.6489999294281006,-7.934000015258789 -3.6419999599456787,-6.52400016784668 C-4.795000076293945,-4.888000011444092 -6.050000190734863,-3.1059999465942383 -6.380000114440918,-2.638000011444092 C-6.434000015258789,-2.562000036239624 -6.519000053405762,-2.5199999809265137 -6.611000061035156,-2.5199999809265137 C-6.611000061035156,-2.5199999809265137 -7.938000202178955,-2.5199999809265137 -7.938000202178955,-2.5199999809265137 C-7.982999801635742,-2.5199999809265137 -8.020000457763672,-2.4839999675750732 -8.020000457763672,-2.437999963760376 C-8.020000457763672,-2.437999963760376 -8.020000457763672,9.447999954223633 -8.020000457763672,9.447999954223633 C-8.020000457763672,9.494000434875488 -7.982999801635742,9.531000137329102 -7.936999797821045,9.531000137329102z"></path> <path fill="rgb(255,255,255)" fill-opacity="1" d=" M-7.936999797821045,9.531000137329102 C-7.936999797821045,9.531000137329102 3.378000020980835,9.531000137329102 3.378000020980835,9.531000137329102 C3.815999984741211,9.531000137329102 4.209000110626221,9.258999824523926 4.360000133514404,8.847000122070312 C4.360000133514404,8.847000122070312 7.501999855041504,0.36000001430511475 7.501999855041504,0.36000001430511475 C8.020000457763672,-1.0360000133514404 6.986000061035156,-2.5199999809265137 5.497000217437744,-2.5199999809265137 C5.497000217437744,-2.5199999809265137 -0.5669999718666077,-2.5199999809265137 -0.5669999718666077,-2.5199999809265137 C-0.6399999856948853,-2.5199999809265137 -0.6859999895095825,-2.5969998836517334 -0.6499999761581421,-2.6600000858306885 C-0.36800000071525574,-3.1679999828338623 0.6269999742507935,-4.922999858856201 0.8870000243186951,-5.764999866485596 C1.309000015258789,-7.13100004196167 0.847000002861023,-8.715999603271484 -1.4539999961853027,-9.519000053405762 C-1.4759999513626099,-9.526000022888184 -1.4989999532699585,-9.527000427246094 -1.5180000066757202,-9.519000053405762 C-1.5299999713897705,-9.513999938964844 -1.5410000085830688,-9.505999565124512 -1.5490000247955322,-9.494000434875488 C-1.7309999465942383,-9.234999656677246 -2.6489999294281006,-7.934000015258789 -3.6419999599456787,-6.52400016784668 C-4.795000076293945,-4.888000011444092 -6.050000190734863,-3.1059999465942383 -6.380000114440918,-2.638000011444092 C-6.434000015258789,-2.562000036239624 -6.519000053405762,-2.5199999809265137 -6.611000061035156,-2.5199999809265137 C-6.611000061035156,-2.5199999809265137 -7.938000202178955,-2.5199999809265137 -7.938000202178955,-2.5199999809265137 C-7.982999801635742,-2.5199999809265137 -8.020000457763672,-2.4839999675750732 -8.020000457763672,-2.437999963760376 C-8.020000457763672,-2.437999963760376 -8.020000457763672,9.447999954223633 -8.020000457763672,9.447999954223633 C-8.020000457763672,9.494000434875488 -7.982999801635742,9.531000137329102 -7.936999797821045,9.531000137329102z"></path> </g> <g opacity="1" transform="matrix(1,0,0,1,2.694000005722046,14.967000007629395)"> <path fill="rgb(255,255,255)" fill-opacity="1" d=" M0.5019999742507935,7.0269999504089355 C0.5019999742507935,7.0269999504089355 -0.5019999742507935,7.0269999504089355 -0.5019999742507935,7.0269999504089355 C-0.7789999842643738,7.0269999504089355 -1.003999948501587,6.802000045776367 -1.003999948501587,6.525000095367432 C-1.003999948501587,6.525000095367432 -1.003999948501587,-6.525000095367432 -1.003999948501587,-6.525000095367432 C-1.003999948501587,-6.802000045776367 -0.7789999842643738,-7.0269999504089355 -0.5019999742507935,-7.0269999504089355 C-0.5019999742507935,-7.0269999504089355 0.5019999742507935,-7.0269999504089355 0.5019999742507935,-7.0269999504089355 C0.7789999842643738,-7.0269999504089355 1.003999948501587,-6.802000045776367 1.003999948501587,-6.525000095367432 C1.003999948501587,-6.525000095367432 1.003999948501587,6.525000095367432 1.003999948501587,6.525000095367432 C1.003999948501587,6.802000045776367 0.7789999842643738,7.0269999504089355 0.5019999742507935,7.0269999504089355z"></path> </g> </g> </g> </g> </svg> <span>Like <span id="like_label" class="like_label">0</span></span> </button><div class="mt20 text-center article__reward-info"> <span class="mr10">如果觉得我的文章对你有用,请随意投币</span> </div> </div><!--support-author--> <!--/文章的页脚部件:打赏和其他信息的输出--> </div> </article> </div> <!--上一篇&下一篇--> <nav class="m-t-lg m-b-lg"> <ul class="pager"> <li class="next"> <a class="box-shadow-wrap-normal" href="https://www.iysheng.com/index.php/archives/67/" title="Windows下创建名为.password文件" data-toggle="tooltip"> Next </a></li> <li class="previous"> <a class="box-shadow-wrap-normal" href="https://www.iysheng.com/index.php/archives/69/" title="记一次博客搭建(Cloud studio+github+hexo)搭建一个随地更新的静态hexo博客" data-toggle="tooltip"> Previous </a></li> </ul> </nav> <!--评论--> <style> textarea#comment{ background-image: url('https://s2.ax1x.com/2019/07/20/ZzaGcV.png'); background-color: #ffffff; transition: all 0.25s ease-in-out 0s; } textarea#comment:focus { background-position-y: 105px; transition: all 0.25s ease-in-out 0s; } </style> <div id="comments"> <!--评论列表--> <div id="post-comment-list" class="skt-loading"><script type="text/javascript" id='outputCommentJS'> (function () { window.TypechoComment = { dom : function (id) { return document.getElementById(id); }, create : function (tag, attr) { var el = document.createElement(tag); for (var key in attr) { el.setAttribute(key, attr[key]); } return el; }, reply : function (cid, coid) { var comment = this.dom(cid), parent = comment.parentNode, response = this.dom('respond-post-68'), input = this.dom('comment-parent'), form = 'form' == response.tagName ? response : response.getElementsByTagName('form')[0], textarea = response.getElementsByTagName('textarea')[0]; if (null == input) { input = this.create('input', { 'type' : 'hidden', 'name' : 'parent', 'id' : 'comment-parent' }); form.appendChild(input); } input.setAttribute('value', coid); if (null == this.dom('comment-form-place-holder')) { var holder = this.create('div', { 'id' : 'comment-form-place-holder' }); response.parentNode.insertBefore(holder, response); } comment.appendChild(response); this.dom('cancel-comment-reply-link').style.display = ''; if (null != textarea && 'text' == textarea.name) { textarea.focus(); } return false; }, cancelReply : function () { var response = this.dom('respond-post-68'), holder = this.dom('comment-form-place-holder'), input = this.dom('comment-parent'); if (null != input) { input.parentNode.removeChild(input); } if (null == holder) { return true; } this.dom('cancel-comment-reply-link').style.display = 'none'; holder.parentNode.insertBefore(response, holder); return false; } }; })(); </script> <script type="text/javascript"> var registCommentEvent = function() { var event = document.addEventListener ? { add: 'addEventListener', focus: 'focus', load: 'DOMContentLoaded' } : { add: 'attachEvent', focus: 'onfocus', load: 'onload' }; var r = document.getElementById('respond-post-68'); if (null != r) { var forms = r.getElementsByTagName('form'); if (forms.length > 0) { var f = forms[0], textarea = f.getElementsByTagName('textarea')[0], added = false; var submitButton = f.querySelector('button[type="submit"]'); if (null != textarea && 'text' == textarea.name) { var referSet = function () { if (!added) { // console.log('commentjs'); const child = f.querySelector('input[name="_"]'); const child2 = f.querySelector('input[name="checkReferer"]'); if (child!=null){ f.removeChild(child); } if (child2!=null){ f.removeChild(child2); } var input = document.createElement('input'); input.type = 'hidden'; input.name = '_'; input.value = (function () { var _jsP = '769'//'hQ' +'e9'//'R3' +//'WSK' 'e52'+//'uh' '42'+'qU'//'qU' +'f50'//'T' +//'E1d' 'e7c'+'o4U'//'o4U' +//'xp' '257'+'77'//'wRa' +//'e' 'd40'+//'9' '6cf'+//'7' 'dd'+/* 'lBr'//'lBr' */''+'19'//'Sp' +//'K' 'K'+'uoi'//'uoi' +//'wt' 'e', _G6O = [[10,12],[16,19],[31,32],[31,34]]; for (var i = 0; i < _G6O.length; i ++) { _jsP = _jsP.substring(0, _G6O[i][0]) + _jsP.substring(_G6O[i][1]); } return _jsP; })(); f.appendChild(input); input = document.createElement('input'); input.type = 'hidden'; input.name = 'checkReferer'; input.value = 'false'; f.appendChild(input); added = true; } };//end of reset referSet(); } } } }; $(function(){ registCommentEvent(); }); </script></div> <!--如果允许评论,会出现评论框和个人信息的填写--> <div id="respond-post-68" class="respond comment-respond no-borders"> <h4 id="reply-title" class="comment-reply-title m-t-lg m-b">Leave a Comment <small data-toggle="tooltip" data-placement="right" title="使用cookie技术保留您的个人信息以便您下次快速评论,继续评论表示您已同意该条款"> <i style="vertical-align: -1px" data-feather="alert-circle"></i> </small> <small class="cancel-comment-reply"> <a id="cancel-comment-reply-link" href="https://www.iysheng.com/index.php/archives/68/#respond-post-68" rel="nofollow" style="display:none" onclick="return TypechoComment.cancelReply();">Cancel reply</a> </small> </h4> <form id="comment_form" method="post" action="https://www.iysheng.com/index.php/archives/68/comment" class="comment-form" role="form"> <input type="hidden" name="receiveMail" id="receiveMail" value="yes" /> <div class="comment-form-comment form-group"> <label class="padder-v-sm" for="comment">Comment <span class="required text-danger">*</span></label> <textarea id="comment" class="textarea form-control OwO-textarea" name="text" rows="5" placeholder="say something…" onkeydown="if(event.ctrlKey&&event.keyCode==13){document.getElementById('submit').click();return false};"></textarea> <div class="OwO padder-v-sm"></div> <div class="secret_comment" id="secret_comment" data-toggle="tooltip" data-original-title="When this function is enabled, your comments are only visible to both the author and the comment"> <label class="secret_comment_label control-label">Private comment</label> <div class="secret_comment_check"> <label class="i-switch i-switch-sm bg-info m-b-ss m-r"> <input type="checkbox" id="secret_comment_checkbox"> <i></i> </label> </div> </div> </div> <!--判断是否登录--> <div id="author_info" class="row row-sm"> <div class="comment-form-author form-group col-sm-6 col-md-4"> <label for="author">Name <span class="required text-danger">*</span></label> <div> <img class="author-avatar" src="https://secure.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=65&r=G&d=" nogallery/> <input id="author" class="form-control" name="author" type="text" value="" maxlength="245" placeholder="Name or nickname"> <div class="random_user_name shake-constant">🎲</div> </div> </div> <div class="comment-form-email form-group col-sm-6 col-md-4"> <label for="email">Email <span class="required text-danger">*</span> </label> <input type="text" name="mail" id="mail" class="form-control" placeholder="E-mail (required)" value="" /> </div> <div class="comment-form-url form-group col-sm-12 col-md-4"> <label for="url">Site </label> <input id="url" class="form-control" name="url" type="url" value="" maxlength="200" placeholder="Website or blog"></div> </div> <!--提交按钮--> <div class="form-group"> <button type="submit" name="submit" id="submit" class="submit btn-rounded box-shadow-wrap-lg btn-gd-primary padder-lg"> <span>Leave a Comment</span> <span class="text-active">submitting...</span> </button> <i class="animate-spin fontello fontello-spinner hide" id="spin"></i> <input type="hidden" name="comment_post_ID" id="comment_post_ID"> <input type="hidden" name="comment_parent" id="comment_parent"> </div> </form> </div> </div> </div> <div class="resize-pane"> <div id="trigger_right_content" class="trigger_content"><div class="trigger_drag_content"></div></div> <div id="trigger_right_button" data-placement="left" data-toggle="tooltip" data-original-title="点击展开右侧边栏" class="normal-widget resize-pane-trigger box-shadow-wrap-lg"><i data-feather="sidebar"></i></div> </div> </div> <!--文章右侧边栏开始--> <aside id="rightAside" class="asideBar col w-md bg-white-only bg-auto no-border-xs" role="complementary"> <div id="sidebar"> <section id="tabs-4" class="widget widget_tabs clear"> <div class="nav-tabs-alt no-js-hide"> <ul class="nav nav-tabs nav-justified box-shadow-bottom-normal tablist" role="tablist"> <li data-index="0" class="active" role="presentation"> <a data-target="#widget-tabs-4-hots" role="tab" aria-controls="widget-tabs-4-hots" aria-expanded="true" data-toggle="tab"><div class="sidebar-icon wrapper-sm"><i data-feather="thumbs-up"></i></div><span class="sr-only">Popular articles</span> </a></li> <li role="presentation" data-index="1"> <a data-target="#widget-tabs-4-comments" role="tab" aria-controls="widget-tabs-4-comments" aria-expanded="false" data-toggle="tab"><div class="sidebar-icon wrapper-sm"><i data-feather="message-square"></i></div> <span class="sr-only">Latest comments</span> </a></li> <li data-index="2" role="presentation"> <a data-target="#widget-tabs-4-random" role="tab" aria-controls="widget-tabs-4-random" aria-expanded="false" data-toggle="tab"> <div class="sidebar-icon wrapper-sm"><i data-feather="gift"></i></div> <span class="sr-only">Random articles</span> </a></li> <span class="navs-slider-bar"></span> </ul> </div> <div class="tab-content"> <!--热门文章--> <div id="widget-tabs-4-hots" class="tab-pane fade in wrapper-md active" role="tabpanel"> <h5 class="widget-title m-t-none text-md">Popular articles</h5> <ul class="list-group no-bg no-borders pull-in m-b-none"> <li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/39/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/4.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/39/" title="GSC POP UP PARADE 哔哩哔哩 22 33娘 手办开箱!"> GSC POP UP PARADE 哔哩哔哩 22 33娘 手办开箱! </a></h4> <small class="text-muted post-head-icon"><span class="meta-views"> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">5</span> </span></small></div></li><li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/53/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/8.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/53/" title="学生也可以用的低价vps月付最低0.79刀?!(站长私藏干货)"> 学生也可以用的低价vps月付最低0.79刀?!(站长私藏干货) </a></h4> <small class="text-muted post-head-icon"><span class="meta-views"> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">4</span> </span></small></div></li><li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/47/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/9.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/47/" title="如何使用低配电脑玩绝地求生(泰服)"> 如何使用低配电脑玩绝地求生(泰服) </a></h4> <small class="text-muted post-head-icon"><span class="meta-views"> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">3</span> </span></small></div></li><li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/54/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/10.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/54/" title="[活动进行中]3月23日-28日Codelabs一周免费畅玩,参与开发者主题帖互动瓜分8亿码豆,等你来嗨!"> [活动进行中]3月23日-28日Codelabs一周免费畅玩,参与开发者主题帖互动瓜分8亿码豆,等你来嗨! </a></h4> <small class="text-muted post-head-icon"><span class="meta-views"> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">3</span> </span></small></div></li><li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/61/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/3.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/61/" title="博客目前的改动以及博主生活近况~"> 博客目前的改动以及博主生活近况~ </a></h4> <small class="text-muted post-head-icon"><span class="meta-views"> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">3</span> </span></small></div></li> </ul> </div> <!--最新评论--> <div id="widget-tabs-4-comments" class="tab-pane fade wrapper-md no-js-show" role="tabpanel"> <h5 class="widget-title m-t-none text-md">Latest comments</h5> <ul class="list-group no-borders pull-in auto m-b-none no-bg"> <li class="list-group-item"> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-12" class="pull-left thumb-sm avatar m-r"> <img nogallery src="https://secure.gravatar.com/avatar/6d66996085f797326865dd1f1b1251ff?s=65&r=G&d=" class="img-40px photo img-square normal-shadow"> </a> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-12" class="text-muted"> <!--<i class="iconfont icon-comments-o text-muted pull-right m-t-sm text-sm" title="" aria-hidden="true" data-toggle="tooltip" data-placement="auto left"></i> <span class="sr-only"></span>--> </a> <div class="clear"> <div class="text-ellipsis"> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-12" title="Andu"> Andu </a> </div> <small class="text-muted"> <span> 名称:Andu 's blog网址:https://www.x... </span> </small> </div> </li> <li class="list-group-item"> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-11" class="pull-left thumb-sm avatar m-r"> <img nogallery src="https://secure.gravatar.com/avatar/6d66996085f797326865dd1f1b1251ff?s=65&r=G&d=" class="img-40px photo img-square normal-shadow"> </a> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-11" class="text-muted"> <!--<i class="iconfont icon-comments-o text-muted pull-right m-t-sm text-sm" title="" aria-hidden="true" data-toggle="tooltip" data-placement="auto left"></i> <span class="sr-only"></span>--> </a> <div class="clear"> <div class="text-ellipsis"> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-11" title="Andu"> Andu </a> </div> <small class="text-muted"> <span> Andu博客 </span> </small> </div> </li> <li class="list-group-item"> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-10" class="pull-left thumb-sm avatar m-r"> <img nogallery src="https://secure.gravatar.com/avatar/c6f48f994bafc2015faf74623b42badd?s=65&r=G&d=" class="img-40px photo img-square normal-shadow"> </a> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-10" class="text-muted"> <!--<i class="iconfont icon-comments-o text-muted pull-right m-t-sm text-sm" title="" aria-hidden="true" data-toggle="tooltip" data-placement="auto left"></i> <span class="sr-only"></span>--> </a> <div class="clear"> <div class="text-ellipsis"> <a href="https://www.iysheng.com/index.php/17.html/comment-page-1#comment-10" title="Yalisiting"> Yalisiting </a> </div> <small class="text-muted"> <span> 要有节操 https://xn--w7u347d.cc/ </span> </small> </div> </li> <li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/22/comment-page-1#comment-7" class="pull-left thumb-sm avatar m-r"> <img nogallery src="https://q2.qlogo.cn/g?b=qq&nk=3368617779&s=100" class="img-40px photo img-square normal-shadow"> </a> <a href="https://www.iysheng.com/index.php/archives/22/comment-page-1#comment-7" class="text-muted"> <!--<i class="iconfont icon-comments-o text-muted pull-right m-t-sm text-sm" title="" aria-hidden="true" data-toggle="tooltip" data-placement="auto left"></i> <span class="sr-only"></span>--> </a> <div class="clear"> <div class="text-ellipsis"> <a href="https://www.iysheng.com/index.php/archives/22/comment-page-1#comment-7" title="默笙"> 默笙 </a> </div> <small class="text-muted"> <span> 来了OωO </span> </small> </div> </li> <li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/53/comment-page-1#comment-0" class="pull-left thumb-sm avatar m-r"> <img nogallery src="https://secure.gravatar.com/avatar/cd9dcbd5a03a2b089b90d216a51077f5?s=65&r=G&d=" class="img-40px photo img-square normal-shadow"> </a> <a href="https://www.iysheng.com/index.php/archives/53/comment-page-1#comment-0" class="text-muted"> <!--<i class="iconfont icon-comments-o text-muted pull-right m-t-sm text-sm" title="" aria-hidden="true" data-toggle="tooltip" data-placement="auto left"></i> <span class="sr-only"></span>--> </a> <div class="clear"> <div class="text-ellipsis"> <a href="https://www.iysheng.com/index.php/archives/53/comment-page-1#comment-0" title="成长中的少年"> 成长中的少年 </a> </div> <small class="text-muted"> <span> 路过~这个商家的线路很一般~没必要省这点钱吧,腾讯云学生机也才... </span> </small> </div> </li> </ul> </div> <!--随机文章--> <div id="widget-tabs-4-random" class="tab-pane fade wrapper-md no-js-show" role="tabpanel"> <h5 class="widget-title m-t-none text-md">Random articles</h5> <ul class="list-group no-bg no-borders pull-in"> <li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/15/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/4.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/15/" title="bilibili网站后台工程源码"> bilibili网站后台工程源码 </a></h4> <small class="text-muted post-head-icon"><span class="meta-views "> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">0</span> </span></small></div></li><li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/59/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/8.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/59/" title="御坂美琴生日快乐~"> 御坂美琴生日快乐~ </a></h4> <small class="text-muted post-head-icon"><span class="meta-views "> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">0</span> </span></small></div></li><li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/34/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/9.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/34/" title="受到肺炎疫情影响,这些日本动画宣布延期开播"> 受到肺炎疫情影响,这些日本动画宣布延期开播 </a></h4> <small class="text-muted post-head-icon"><span class="meta-views "> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">0</span> </span></small></div></li><li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/22/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/10.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/22/" title="PR视频剪辑通关秘籍课程"> PR视频剪辑通关秘籍课程 </a></h4> <small class="text-muted post-head-icon"><span class="meta-views "> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">1</span> </span></small></div></li><li class="list-group-item"> <a href="https://www.iysheng.com/index.php/archives/75/" class="pull-left thumb-sm m-r"><img src="https://www.iysheng.com/usr/themes/handsome/assets/img/sj2/3.jpg" class="img-40px normal-shadow img-square"></a> <div class="clear"> <h4 class="h5 l-h text-second"> <a href="https://www.iysheng.com/index.php/archives/75/" title="分享几张照片吧~(拍摄设备iPhone11+iPhone13)"> 分享几张照片吧~(拍摄设备iPhone11+iPhone13) </a></h4> <small class="text-muted post-head-icon"><span class="meta-views "> <span class="right-small-icons"><i data-feather="message-circle"></i></span> <span class="sr-only">评论数:</span> <span class="meta-value">0</span> </span></small></div></li> </ul> </div> </div> </section> <!--博客信息--> <section id="blog_info" class="widget widget_categories wrapper-md clear"> <h5 class="widget-title m-t-none text-md">Blog Info</h5> <ul class="list-group box-shadow-wrap-normal"> <li class="list-group-item text-second"><span class="blog-info-icons"> <i data-feather="award"></i></span> <span class="badge pull-right">44</span>Posts Num</li> <li class="list-group-item text-second"> <span class="blog-info-icons"> <i data-feather="message-circle"></i></span> <span class="badge pull-right">58</span>Comments Num</li> <li class="list-group-item text-second"><span class="blog-info-icons"> <i data-feather="calendar"></i></span> <span class="badge pull-right">4 Y 15 D</span>Operating Days</li> <li class="list-group-item text-second"><span class="blog-info-icons"> <i data-feather="activity"></i></span> <span class="badge pull-right">3 Weeks Ago</span>Last activity</li> </ul> </section> <!--非文章页面--> <!--文章页面--> <section id="tag_cloud-2" class="widget widget_tag_cloud wrapper-md clear"> <h5 class="widget-title m-t-none text-md">Article tags</h5> <div class="post-tags tags l-h-2x"> no tag </div> </section> <div id="tag_toc_body" class="tag_toc_body"> <section id="tag_toc" class="widget widget_categories wrapper-md clear"> <h5 class="widget-title m-t-none text-md">Article Directory</h5> <div class="tags l-h-2x box-shadow-wrap-normal"> <div id="toc" class="small-scroll-bar overflow-y-auto"></div> </div> </section> </div> </div> </aside> <!--文章右侧边栏结束--> </div> </main> <div id="morphing-content" class="hidden read_mode_article"> <div class="page"> <h1 class="title">hexo常用命令</h1> <div class="metadata singleline"><a href="#" rel="author" class="byline">Admin</a> • <span class="delimiter"></span><time class="date">2021 年 02 月 25 日</time></div> <textarea id="morphing-content-real_origin_text"><p>常用命令详解</p><p>Hexo 框架可以帮助我们快速创建一个属于自己的博客网站,熟悉 Hexo 框架提供的命令有利于我们管理博客</p><p>1、hexo init<br>hexo init 命令用于初始化本地文件夹为网站的根目录</p><p>$ hexo init [folder]<br>folder 可选参数,用以指定初始化目录的路径,若无指定则默认为当前目录<br>2、hexo new<br>hexo new 命令用于新建文章,一般可以简写为 hexo n</p><p>$ hexo new [layout] <title><br>layout 可选参数,用以指定文章类型,若无指定则默认由配置文件中的 default_layout 选项决定</p><p>title 必填参数,用以指定文章标题,如果参数值中含有空格,则需要使用双引号包围</p><p>3、hexo generate<br>hexo generate 命令用于生成静态文件,一般可以简写为 hexo g</p><p>$ hexo generate<br>-d 选项,指定生成后部署,与 hexo d -g 等价<br>详细信息请参考:<span class="external-link"><a class="no-external-link" href="https://hexo.io/docs/generating" target="_blank"><i data-feather="external-link"></i>https://hexo.io/docs/generating</a></span></p><p>4、hexo server<br>hexo server 命令用于启动本地服务器,一般可以简写为 hexo s</p><p>$ hexo server<br>-p 选项,指定服务器端口,默认为 4000</p><p>-i 选项,指定服务器 IP 地址,默认为 0.0.0.0</p><p>-s 选项,静态模式 ,仅提供 public 文件夹中的文件并禁用文件监视</p><p>说明 :运行服务器前需要安装 hexo-server 插件</p><p>$ npm install hexo-server --save<br>详细信息请参考:<span class="external-link"><a class="no-external-link" href="https://hexo.io/docs/server.html" target="_blank"><i data-feather="external-link"></i>https://hexo.io/docs/server.html</a></span></p><p>5、hexo deploy<br>hexo deploy 命令用于部署网站,一般可以简写为 hexo d</p><p>$ hexo deploy<br>-g 选项,指定生成后部署,与 hexo g -d 等价<br>说明 :部署前需要修改 _config.yml 配置文件,下面以 git 为例进行说明</p><p>deploy:</p><pre><code>type: git repo: &lt;repository url&gt; branch: master message: 自定义提交消息,默认为Site updated: {{ now('YYYY-MM-DD HH:mm:ss') }}</code></pre><p>详细信息请参考:<span class="external-link"><a class="no-external-link" href="https://hexo.io/docs/deployment.html" target="_blank"><i data-feather="external-link"></i>https://hexo.io/docs/deployment.html</a></span></p><p>6、hexo clean<br>hexo clean 命令用于清理缓存文件,是一个比较常用的命令</p><p>$ hexo clean<br>网站显示异常时可尝试此操作</p><p>7、Option<br>(1)hexo --safe<br>hexo --safe 表示安全模式,用于禁用加载插件和脚本</p><p>$ hexo --safe<br>安装新插件时遇到问题可尝试此操作</p><p>(2)hexo --debug<br>hexo --debug 表示调试模式,用于将消息详细记录到终端和 debug.log 文件</p><p>$ hexo --debug<br>(3)hexo --silent<br>hexo --silent 表示静默模式,用于静默输出到终端</p><p>$ hexo --silent</p><!--more--><p>指令大全<br> init<br>$ hexo init [folder]<br>新建一个网站。如果没有设置 folder ,Hexo 默认在目前的文件夹建立网站。</p><p>This command is a shortcut that runs the following steps:</p><p>Git clone hexo-starter including hexo-theme-landscape into the current directory or a target folder if specified.<br>Install dependencies using a package manager: Yarn 1, pnpm or npm, whichever is installed; if there are more than one installed, the priority is as listed. npm is bundled with Node.js by default.<br>new<br>$ hexo new [layout] <title><br>新建一篇文章。如果没有设置 layout 的话,默认使用 _config.yml 中的 default_layout 参数代替。如果标题包含空格的话,请使用引号括起来。</p><p>$ hexo new "post title with whitespace"<br>参数 描述<br>-p, --path 自定义新文章的路径<br>-r, --replace 如果存在同名文章,将其替换<br>-s, --slug 文章的 Slug,作为新文章的文件名和发布后的 URL<br>默认情况下,Hexo 会使用文章的标题来决定文章文件的路径。对于独立页面来说,Hexo 会创建一个以标题为名字的目录,并在目录中放置一个 index.md 文件。你可以使用 --path 参数来覆盖上述行为、自行决定文件的目录:</p><p>hexo new page --path about/me "About me"<br>以上命令会创建一个 source/about/me.md 文件,同时 Front Matter 中的 title 为 "About me"</p><p>注意!title 是必须指定的!如果你这么做并不能达到你的目的:</p><p>hexo new page --path about/me<br>此时 Hexo 会创建 source/_posts/about/me.md,同时 me.md 的 Front Matter 中的 title 为 "page"。这是因为在上述命令中,hexo-cli 将 page 视为指定文章的标题、并采用默认的 layout。</p><p>generate<br>$ hexo generate<br>生成静态文件。</p><p>选项 描述<br>-d, --deploy 文件生成后立即部署网站<br>-w, --watch 监视文件变动<br>-b, --bail 生成过程中如果发生任何未处理的异常则抛出异常<br>-f, --force 强制重新生成文件<br>Hexo 引入了差分机制,如果 public 目录存在,那么 hexo g 只会重新生成改动的文件。<br>使用该参数的效果接近 hexo clean && hexo generate<br>-c, --concurrency 最大同时生成文件的数量,默认无限制<br>该命令可以简写为</p><p>$ hexo g<br>publish<br>$ hexo publish [layout] <filename><br>发表草稿。</p><p>server<br>$ hexo server<br>启动服务器。默认情况下,访问网址为: <span class="external-link"><a class="no-external-link" href="http://localhost:4000/" target="_blank"><i data-feather="external-link"></i>http://localhost:4000/</a></span>。</p><p>选项 描述<br>-p, --port 重设端口<br>-s, --static 只使用静态文件<br>-l, --log 启动日记记录,使用覆盖记录格式<br>deploy<br>$ hexo deploy<br>部署网站。</p><p>参数 描述<br>-g, --generate 部署之前预先生成静态文件<br>该命令可以简写为:</p><p>$ hexo d<br>render<br>$ hexo render <file1> [file2] ...<br>渲染文件。</p><p>参数 描述<br>-o, --output 设置输出路径<br>migrate<br>$ hexo migrate <type><br>从其他博客系统 迁移内容。</p><p>clean<br>$ hexo clean<br>清除缓存文件 (db.json) 和已生成的静态文件 (public)。</p><p>在某些情况(尤其是更换主题后),如果发现您对站点的更改无论如何也不生效,您可能需要运行该命令。</p><p>list<br>$ hexo list <type><br>列出网站资料。</p><p>version<br>$ hexo version<br>显示 Hexo 版本。</p><p>选项<br>安全模式<br>$ hexo --safe<br>在安全模式下,不会载入插件和脚本。当您在安装新插件遭遇问题时,可以尝试以安全模式重新执行。</p><p>调试模式<br>$ hexo --debug<br>在终端中显示调试信息并记录到 debug.log。当您碰到问题时,可以尝试用调试模式重新执行一次,并 提交调试信息到 GitHub。</p><p>简洁模式<br>$ hexo --silent<br>隐藏终端信息。</p><p>自定义配置文件的路径</p><h1>使用 custom.yml 代替默认的 _config.yml</h1><p>$ hexo server --config custom.yml</p><h1>使用 custom.yml 和 custom2.json,其中 custom2.json 优先级更高</h1><p>$ hexo generate --config custom.yml,custom2.json,custom3.yml<br>自定义配置文件的路径,指定这个参数后将不再使用默认的 _config.yml。<br>你可以使用一个 YAML 或 JSON 文件的路径,也可以使用逗号分隔(无空格)的多个 YAML 或 JSON 文件的路径。例如:</p><h1>使用 custom.yml 代替默认的 _config.yml</h1><p>$ hexo server --config custom.yml</p><h1>使用 custom.yml, custom2.json 和 custom3.yml,其中 custom3.yml 优先级最高,其次是 custom2.json</h1><p>$ hexo generate --config custom.yml,custom2.json,custom3.yml<br>当你指定了多个配置文件以后,Hexo 会按顺序将这部分配置文件合并成一个 _multiconfig.yml。如果遇到重复的配置,排在后面的文件的配置会覆盖排在前面的文件的配置。这个原则适用于任意数量、任意深度的 YAML 和 JSON 文件。</p><p>显示草稿<br>$ hexo --draft<br>显示 source/_drafts 文件夹中的草稿文章。</p><p>自定义 CWD<br>$ hexo --cwd /path/to/cwd<br>自定义当前工作目录(Current working directory)的路径。</p></textarea> <div id="morphing-content-real_origin"></div> </div> </div> <!-- footer --> </div><!-- /content --> <!--right panel--> <style> .topButton>.btn{ top: 0; } </style> <div class="topButton panel panel-default"> <button id="goToTop" class="fix-padding btn btn-default rightSettingBtn pos-abt hide border-radius-half-left" data-toggle="tooltip" data-placement="left" data-original-title="Top"> <span class="settings-icon2"><i width="13px" height="13px" data-feather="corner-right-up"></i></span> <!-- <i class="fontello fontello-chevron-circle-up" aria-hidden="true"></i>--> </button> </div> <div class="tag_toc_body hide"> <div class="tocify-mobile-panel panel panel-default setting_body_panel right_panel" aria-hidden="true"> <button class="fix-padding rightSettingBtn border-radius-half-left btn btn-default pos-abt " data-toggle="tooltip" data-placement="left" data-original-title="目录" data-toggle-class=".tocify-mobile-panel=active, .settings=false"> <span class="settings-icon2"><i width="13px" height="13px" data-feather="list"></i></span> </button> <div class="panel-heading">Article Directory</div> <div class="setting_body toc-mobile-body"> <div class="panel-body"> <div id="tocTree" class="tocTree overflow-y-auto"></div> </div> </div> </div> </div> <footer id="footer" class="app-footer" role="footer"> <!-- <div class="wrapper bg-light">--> <!-- <a class="pull-right hidden-xs text-ellipsis">--> <!-- <span class="label badge" style="margin-right: 10px;">Powered by typecho</span>--> <!-- <a href="https://www.ihewro.com/archives/489/" class="label badge">Theme by handsome</a>--> <!-- </a>--> <!-- <a href="" target="_blank" rel="noopener noreferrer" class="label badge" data-toggle="tooltip" data-original-title="">Copyright ©2021</a>--> <!-- </div>--> <div class="wrapper bg-light"> <span class="pull-right hidden-xs text-ellipsis"> Powered by <a target="_blank" href="http://www.typecho.org">Typecho</a> | Theme by <a target="_blank" href="https://www.ihewro.com/archives/489/">handsome</a> </span> <span class="text-ellipsis">© 2022 Copyright <a href="https://beian.miit.gov.cn/" target="_blank">鲁ICP备 2021026306号 </a></span> </div> </footer> </div><!--end of .app app-header-fixed--> <script type="text/javascript" src="https://www.iysheng.com/usr/plugins/PandaBangumi/js/PandaBangumi.22.js?v=2.1"></script><div class="pio-container right"><div class="pio-action"></div><canvas id="pio" width="280" height="250"></canvas></div><script src='https://www.iysheng.com/usr/plugins/Pio/static/l2d.js'></script> <script src='https://www.iysheng.com/usr/plugins/Pio/static/pio.js'></script> <script>var pio = new Paul_Pio({"mode":"static","hidden":false,"content":[],"tips":true,"model":["https://www.iysheng.com/usr/plugins/Pio/models/22/model.json"]});</script> <!--定义全局变量--> <style> #mode_set{ display: none; } </style> <!--主题核心js--> <script src="https://www.iysheng.com/usr/themes/handsome/assets/js/function.min.js?v=8.4.12022041901"></script> <script src="https://www.iysheng.com/usr/themes/handsome/assets/js/core.min.js?v=8.4.12022041901"></script> <script> $(function () { if ('serviceWorker' in navigator) { if (LocalConst.USE_CACHE) { navigator.serviceWorker.addEventListener('controllerchange', function (ev) { try { if (LocalConst.SERVICE_WORKER_INSTALLED){ $.message({ title:"检测到本地缓存需要更新", message:"<a href='#' onclick='window.location.reload();'>点击刷新页面</a>更新本地缓存", type:'warning', time: '300000' }); }else{ console.log("controllerchange:first sw install success"); } }catch (e) { console.log("controllerchange error",e); } }); } } }) </script> <!--主题组件js加载--> <script src="https://www.iysheng.com/usr/themes/handsome/assets/js/features/jquery.pjax.min.js" type="text/javascript"></script> <!--pjax动画组件--> <!--截图插件--> <script src="https://www.iysheng.com/usr/themes/handsome/assets/js/features/html2canvas.min.js"></script> <!--主题组件js加载结束--> <!--用户自定义js--> <script type="text/javascript"> </script> </body> </html><!--html end--> <!-- / footer -->