{"id":19893,"date":"2024-11-19T15:49:01","date_gmt":"2024-11-19T07:49:01","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19893\/"},"modified":"2024-11-19T15:49:01","modified_gmt":"2024-11-19T07:49:01","slug":"hexo%e6%80%8e%e4%b9%88%e9%83%a8%e7%bd%b2%e5%88%b0github","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19893\/","title":{"rendered":"hexo\u600e\u4e48\u90e8\u7f72\u5230github"},"content":{"rendered":"<p>hexo \u662f\u4e00\u6b3e\u975e\u5e38\u4f18\u79c0\u7684\u9759\u6001\u535a\u5ba2\u751f\u6210\u5668\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u642d\u5efa\u4e00\u4e2a\u535a\u5ba2\u7f51\u7ad9\uff0c\u800c\u4e14\u652f\u6301\u591a\u79cd\u4e3b\u9898\uff0c\u5341\u5206\u7684\u7075\u6d3b\u3002<\/p>\n<p>\u90a3\u4e48\u5982\u4f55\u5c06 Hexo \u90e8\u7f72\u5230 Github \u4e0a\u5462\uff1f\u4e0b\u9762\u5c31\u4e3a\u5927\u5bb6\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0b\u8fd9\u4e2a\u8fc7\u7a0b\u3002<\/p>\n<p>\u4e00\u3001\u51c6\u5907\u5de5\u4f5c<\/p>\n<ol>\n<li>\u6ce8\u518c Github \u8d26\u53f7<\/li>\n<\/ol>\n<p>\u5982\u679c\u6ca1\u6709 Github \u8d26\u53f7\uff0c\u9700\u8981\u5148\u6ce8\u518c\u4e00\u4e2a\u3002Github \u5b98\u7f51\uff1ahttps:\/\/github.com\/<\/p>\n<ol>\n<li>\u5b89\u88c5 Git<\/li>\n<\/ol>\n<p>Hexo \u8981\u5c06\u751f\u6210\u7684\u535a\u5ba2\u4e0a\u4f20\u5230 Github \u4e0a\uff0c\u9700\u8981\u4f7f\u7528 Git \u6765\u8fdb\u884c\u4ee3\u7801\u7ba1\u7406\u548c\u63d0\u4ea4\u3002\u56e0\u6b64\uff0c\u9700\u8981\u5b89\u88c5 Git\u3002<\/p>\n<p>\u5728 Windows \u4e0a\uff0c\u53ef\u4ee5\u5728 Git \u5b98\u7f51 https:\/\/git-scm.com\/ \u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u5b89\u88c5\u7a0b\u5e8f\u3002<\/p>\n<p>\u5728 Linux \u4e0a\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 yum \u6216\u8005 apt-get \u547d\u4ee4\u5b89\u88c5\u3002<\/p>\n<ol>\n<li>\u5b89\u88c5 Node.js<\/li>\n<\/ol>\n<p>Hexo \u662f\u57fa\u4e8e Node.js \u8bed\u8a00\u5f00\u53d1\u7684\uff0c\u56e0\u6b64\u9700\u8981\u5b89\u88c5 Node.js \u8fd0\u884c\u73af\u5883\u3002<\/p>\n<p>\u5728 Node.js \u5b98\u7f51 https:\/\/nodejs.org\/ \u4e0b\u8f7d\u5b89\u88c5\u6700\u65b0\u7248\u672c\u5373\u53ef\u3002<\/p>\n<p>\u4e8c\u3001Hexo \u535a\u5ba2\u521d\u59cb\u5316<\/p>\n<ol>\n<li>\u5b89\u88c5 Hexo<\/li>\n<\/ol>\n<p>\u6253\u5f00\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<pre>npm install -g hexo-cli<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u521d\u59cb\u5316 Hexo<\/li>\n<\/ol>\n<p>\u65b0\u5efa\u4e00\u4e2a\u7a7a\u76ee\u5f55\u7528\u4e8e\u5b58\u653e\u535a\u5ba2\uff0c\u8fdb\u5165\u8be5\u76ee\u5f55\u540e\uff0c\u5728\u547d\u4ee4\u884c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u521d\u59cb\u5316\uff1a<\/p>\n<pre>hexo init<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u5b89\u88c5\u63d2\u4ef6<\/li>\n<\/ol>\n<p>\u521d\u59cb\u5316\u5b8c\u6210\u540e\uff0c\u9700\u8981\u5b89\u88c5\u63d2\u4ef6\u6765\u652f\u6301\u535a\u5ba2\u7684\u751f\u6210\u548c\u5c55\u793a\u3002\u5e38\u7528\u7684\u63d2\u4ef6\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>hexo-deployer-git\uff1a\u7528\u4e8e\u5c06\u672c\u5730\u751f\u6210\u7684\u7f51\u7ad9\u53d1\u5e03\u5230 Github \u4e0a\u3002<\/li>\n<li>hexo-generator-sitemap\uff1a\u7528\u4e8e\u751f\u6210 sitemap\u3002<\/li>\n<li>hexo-generator-baidu-sitemap\uff1a\u7528\u4e8e\u751f\u6210\u767e\u5ea6\u6536\u5f55 sitemap\u3002<\/li>\n<li>hexo-renderer-pug\uff1a\u7528\u4e8e\u652f\u6301 Pug \u6a21\u677f\u5f15\u64ce\u6e32\u67d3\u3002<\/li>\n<\/ul>\n<p>\u5728\u547d\u4ee4\u884c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<pre>npm install hexo-deployer-git --save\nnpm install hexo-generator-sitemap --save\nnpm install hexo-generator-baidu-sitemap --save\nnpm install hexo-renderer-pug --save<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4e09\u3001Hexo \u914d\u7f6e<\/p>\n<ol>\n<li>\u7f51\u7ad9\u914d\u7f6e<\/li>\n<\/ol>\n<p>\u53ef\u4ee5\u5728 _config.yml \u6587\u4ef6\u4e2d\u8fdb\u884c\u7f51\u7ad9\u7684\u57fa\u672c\u4fe1\u606f\u914d\u7f6e\uff0c\u5982\u7f51\u7ad9\u7684\u6807\u9898\u3001\u4f5c\u8005\u3001\u8bed\u8a00\u3001\u4e3b\u9898\u7b49\u3002<\/p>\n<ol>\n<li>\u4e3b\u9898<\/li>\n<\/ol>\n<p>Hexo \u6709\u5f88\u591a\u4e3b\u9898\u53ef\u4f9b\u9009\u62e9\uff0c\u53ef\u4ee5\u5728\u5b98\u7f51 https:\/\/hexo.io\/themes\/ \u4e2d\u67e5\u770b\u3002\u5e38\u7528\u7684\u4e3b\u9898\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>hexo-theme-next\uff1a\u4e00\u6b3e\u975e\u5e38\u53d7\u6b22\u8fce\u7684\u4e3b\u9898\uff0c\u652f\u6301\u591a\u79cd\u914d\u7f6e\u9879\u3002<\/li>\n<li>hexo-theme-matery\uff1a\u53e6\u4e00\u6b3e\u975e\u5e38\u4f18\u79c0\u7684\u4e3b\u9898\uff0c\u89c6\u89c9\u6548\u679c\u5f88\u597d\u3002<\/li>\n<\/ul>\n<p>\u5c06\u4e3b\u9898\u4e0b\u8f7d\u5230\u672c\u5730\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u5b89\u88c5\uff1a<\/p>\n<pre>git clone https:\/\/github.com\/theme-next\/hexo-theme-next themes\/next<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u90e8\u7f72\u914d\u7f6e<\/li>\n<\/ol>\n<p>\u5728 _config.yml \u6587\u4ef6\u4e2d\u627e\u5230 deployment \u90e8\u5206\uff0c\u8fdb\u884c\u76f8\u5173\u914d\u7f6e\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>deploy:\n  type: git\n  repository: git@github.com:username\/username.github.io.git\n  branch: master<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2d\uff0ctype \u662f\u90e8\u7f72\u7c7b\u578b\uff0crepository \u662f Github \u4ed3\u5e93\u5730\u5740\uff0cbranch \u662f Github \u5206\u652f\u3002\u5c06 repository \u4e2d\u7684 username \u66ff\u6362\u6210\u81ea\u5df1\u7684 Github \u7528\u6237\u540d\u5373\u53ef\u3002<\/p>\n<p>\u56db\u3001\u751f\u6210\u535a\u5ba2\u5e76\u4e0a\u4f20\u5230 Github<\/p>\n<ol>\n<li>\u751f\u6210\u535a\u5ba2<\/li>\n<\/ol>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u751f\u6210\u535a\u5ba2\uff1a<\/p>\n<pre>hexo g<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u672c\u5730\u9884\u89c8<\/li>\n<\/ol>\n<p>\u751f\u6210\u535a\u5ba2\u540e\uff0c\u53ef\u4ee5\u5728\u672c\u5730\u9884\u89c8\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u672c\u5730\u670d\u52a1\uff1a<\/p>\n<pre>hexo s<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u7136\u540e\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165 http:\/\/localhost:4000 \u5373\u53ef\u9884\u89c8\u535a\u5ba2\u3002<\/p>\n<ol>\n<li>\u4e0a\u4f20\u535a\u5ba2<\/li>\n<\/ol>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5c06\u535a\u5ba2\u4e0a\u4f20\u5230 Github\uff1a<\/p>\n<pre>hexo d<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4e0a\u4f20\u6210\u529f\u540e\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165 https:\/\/username.github.io \u5373\u53ef\u8bbf\u95ee\u535a\u5ba2\u3002<\/p>\n<p>\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u4e0a\u4f20\uff0c\u9700\u8981\u8f93\u5165 Github \u7528\u6237\u540d\u548c\u5bc6\u7801\u3002<\/p>\n<p>\u4e94\u3001\u603b\u7ed3<\/p>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5c06 Hexo \u642d\u5efa\u597d\u7684\u535a\u5ba2\u5feb\u901f\u90e8\u7f72\u5230 Github \u4e0a\u4e86\u3002<\/p>\n<p>\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u5c06 Hexo \u535a\u5ba2\u6e90\u7801\u653e\u5230 Github \u4e0a\u8fdb\u884c\u5907\u4efd\u548c\u7248\u672c\u7ba1\u7406\uff0c\u65b9\u4fbf\u4ee5\u540e\u7684\u535a\u5ba2\u8fed\u4ee3\u548c\u7ef4\u62a4\u3002\u540c\u65f6\uff0cGithub Pages \u4e5f\u662f\u975e\u5e38\u597d\u7684\u535a\u5ba2\u6258\u7ba1\u5e73\u53f0\uff0c\u53ef\u4ee5\u4eab\u53d7\u5230\u514d\u8d39\u7684\u6258\u7ba1\u670d\u52a1\u3002<\/p>\n<p>\u5728\u535a\u5ba2\u642d\u5efa\u8fc7\u7a0b\u4e2d\uff0c\u9047\u5230\u95ee\u9898\u53ef\u4ee5\u67e5\u770b Hexo \u5b98\u7f51 https:\/\/hexo.io\/ \u7684\u6587\u6863\u548c Github \u4e0a\u7684\u4e3b\u9898\u4ed3\u5e93\uff0c\u4e5f\u53ef\u4ee5\u5230 Hexo \u7684\u5b98\u65b9\u8bba\u575b https:\/\/bbs.hexo.io\/ \u8fdb\u884c\u8ba8\u8bba\u548c\u6c42\u52a9\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fhexo\u600e\u4e48\u90e8\u7f72\u5230github\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>hexo \u662f\u4e00\u6b3e\u975e\u5e38\u4f18\u79c0\u7684\u9759\u6001\u535a\u5ba2\u751f\u6210\u5668\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u642d\u5efa\u4e00\u4e2a\u535a\u5ba2\u7f51\u7ad9\uff0c\u800c\u4e14\u652f\u6301\u591a\u79cd\u4e3b\u9898\uff0c\u5341\u5206\u7684\u7075\u6d3b\u3002 \u90a3\u4e48\u5982\u4f55\u5c06 Hexo \u90e8\u7f72\u5230 Github \u4e0a\u5462\uff1f\u4e0b\u9762\u5c31\u4e3a\u5927\u5bb6\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0b\u8fd9\u4e2a\u8fc7\u7a0b\u3002 \u4e00\u3001\u51c6\u5907\u5de5\u4f5c \u6ce8\u518c Github \u8d26\u53f7 \u5982\u679c\u6ca1\u6709 Github \u8d26\u53f7\uff0c\u9700\u8981\u5148\u6ce8\u518c\u4e00\u4e2a\u3002Github \u5b98\u7f51\uff1ahttps:\/\/github.com\/ \u5b89\u88c5 Git Hexo \u8981\u5c06\u751f\u6210\u7684\u535a\u5ba2\u4e0a\u4f20\u5230 Github \u4e0a\uff0c\u9700\u8981\u4f7f\u7528 Git \u6765\u8fdb\u884c\u4ee3\u7801\u7ba1\u7406\u548c\u63d0\u4ea4\u3002\u56e0\u6b64\uff0c\u9700\u8981\u5b89\u88c5 Git\u3002 \u5728 Windows \u4e0a\uff0c\u53ef\u4ee5\u5728 Git \u5b98\u7f51 https:\/\/git-scm.com\/ \u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u5b89\u88c5\u7a0b\u5e8f\u3002 \u5728 Linux \u4e0a\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 yum \u6216\u8005 apt-get \u547d\u4ee4\u5b89\u88c5\u3002 \u5b89\u88c5 Node.js Hexo \u662f\u57fa\u4e8e Node.js \u8bed\u8a00\u5f00\u53d1\u7684\uff0c\u56e0\u6b64\u9700\u8981\u5b89\u88c5 Node.js \u8fd0\u884c\u73af\u5883\u3002 \u5728 Node.js \u5b98\u7f51 https:\/\/nodejs.org\/ \u4e0b\u8f7d\u5b89\u88c5\u6700\u65b0\u7248\u672c\u5373\u53ef\u3002 \u4e8c\u3001Hexo \u535a\u5ba2\u521d\u59cb\u5316 \u5b89\u88c5 Hexo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-19893","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=19893"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19893\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}