{"id":19920,"date":"2024-11-19T14:27:10","date_gmt":"2024-11-19T06:27:10","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19920\/"},"modified":"2024-11-19T14:27:10","modified_gmt":"2024-11-19T06:27:10","slug":"githubhexo%e6%80%8e%e4%b9%88%e6%90%ad%e5%bb%ba%e5%8d%9a%e5%ae%a2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19920\/","title":{"rendered":"Github+Hexo\u600e\u4e48\u642d\u5efa\u535a\u5ba2"},"content":{"rendered":"<p>\u5728\u8fd9\u4e2a\u6570\u5b57\u5316\u65f6\u4ee3\uff0c\u62e5\u6709\u4e00\u4e2a\u81ea\u5df1\u7684\u535a\u5ba2\u662f\u4e00\u4ef6\u5341\u5206\u6709\u7528\u7684\u4e8b\u60c5\u3002\u53ef\u80fd\u4f60\u4f1a\u95ee\uff0c\u4e3a\u4ec0\u4e48\u9700\u8981\u62e5\u6709\u4e00\u4e2a\u535a\u5ba2\u5462\uff1f\u8fd9\u662f\u56e0\u4e3a\u9996\u5148\uff0c\u535a\u5ba2\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u5c55\u793a\u81ea\u5df1\u6280\u80fd\u7684\u5e73\u53f0\uff0c\u5176\u6b21\uff0c\u901a\u8fc7\u535a\u5ba2\u53ef\u4ee5\u4e0e\u5176\u4ed6\u6709\u5171\u540c\u5174\u8da3\u7684\u4eba\u8fdb\u884c\u4ea4\u6d41\u548c\u6c9f\u901a\uff0c\u6700\u540e\uff0c\u535a\u5ba2\u8fd8\u53ef\u4ee5\u4e3a\u4f60\u521b\u9020\u5546\u4e1a\u673a\u4f1a\u3002<\/p>\n<p>\u90a3\u4e48\u600e\u4e48\u624d\u80fd\u5feb\u901f\u3001\u7b80\u5355\u5730\u642d\u5efa\u4e00\u4e2a\u535a\u5ba2\u5462\uff1f\u8fd9\u91cc\u63a8\u8350\u4f7f\u7528 Github \u548c Hexo\uff0c\u901a\u8fc7\u4e8c\u8005\u7684\u7ed3\u5408\u53ef\u4ee5\u8fc5\u901f\u5730\u642d\u5efa\u81ea\u5df1\u7684\u535a\u5ba2\u3002<\/p>\n<p>\u9996\u5148\uff0c\u4ecb\u7ecd\u4e00\u4e0b Github \u548c Hexo \u8fd9\u4e24\u4e2a\u5de5\u5177\u3002Github \u662f\u4e00\u6b3e\u9762\u5411\u5f00\u53d1\u8005\u7684\u7f51\u7ad9\uff0c\u63d0\u4f9b\u4e86\u4ee3\u7801\u6258\u7ba1\u3001\u7248\u672c\u63a7\u5236\u7b49\u670d\u52a1\u3002Hexo \u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u9759\u6001\u535a\u5ba2\u6846\u67b6\uff0c\u80fd\u591f\u5c06 Markdown \u6587\u6863\u5feb\u901f\u8f6c\u5316\u4e3a\u9759\u6001\u7684 HTML \u9875\u9762\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u6765\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Github \u548c Hexo \u642d\u5efa\u535a\u5ba2\u3002\u9996\u5148\u9700\u8981\u5728 Github \u4e0a\u521b\u5efa\u81ea\u5df1\u7684\u4ed3\u5e93\uff0c\u4f5c\u4e3a\u535a\u5ba2\u7684\u6258\u7ba1\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u9700\u8981\u5b89\u88c5 Hexo \uff0c\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>npm install hexo-cli -g<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u8981\u521d\u59cb\u5316 Hexo\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>hexo init blog<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4f1a\u5728\u4f60\u7684\u7535\u8111\u4e0a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a blog \u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u542b\u4e86 Hexo \u7684\u4e00\u4e9b\u57fa\u672c\u6587\u4ef6\u3002<\/p>\n<p>\u8fdb\u5165\u5230 blog \u76ee\u5f55\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u672c\u5730\u670d\u52a1\u5668\uff1a<\/p>\n<pre>hexo server<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u65f6\u5019\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8f93\u5165 http:\/\/localhost:4000\uff0c\u4f60\u5c31\u53ef\u4ee5\u770b\u5230\u4f60\u7684\u535a\u5ba2\u4e86\u3002<\/p>\n<p>\u73b0\u5728\u4f60\u53ef\u4ee5\u5f00\u59cb\u5199\u535a\u5ba2\u4e86\u3002Hexo \u63d0\u4f9b\u4e86\u4e00\u4e9b\u9ed8\u8ba4\u7684\u547d\u4ee4\uff0c\u5e2e\u52a9\u4f60\u5feb\u901f\u521b\u5efa\u6587\u7ae0\u3001\u90e8\u7f72\u535a\u5ba2\u7b49\u3002\u6bd4\u5982\uff0c\u521b\u5efa\u4e00\u7bc7\u6587\u7ae0\uff1a<\/p>\n<pre>hexo new \"Hello World\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u4f1a\u5728 source\/_posts \u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a hello-world.md \u7684 Markdown \u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u6253\u5f00\u5b83\u8fdb\u884c\u7f16\u8f91\u3002<\/p>\n<p>\u7f16\u8f91\u5b8c\u6587\u7ae0\u540e\uff0c\u9700\u8981\u5c06\u535a\u5ba2\u90e8\u7f72\u5230 Github \u4e0a\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>hexo deploy<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u65f6\u5019\u4f60\u5c31\u53ef\u4ee5\u5728 Github \u4e0a\u770b\u5230\u4f60\u7684\u535a\u5ba2\u4e86\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u8fd9\u53ea\u662f Hexo \u7684\u57fa\u672c\u529f\u80fd\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u8bb8\u591a\u63d2\u4ef6\u53ef\u4ee5\u8ba9\u4f60\u66f4\u597d\u5730\u5b9a\u5236\u548c\u7f8e\u5316\u4f60\u7684\u535a\u5ba2\u3002\u6bd4\u5982\uff0c\u5728 Hexo \u4e2d\u5b89\u88c5\u4e3b\u9898\uff1a<\/p>\n<pre>git clone https:\/\/github.com\/iissnan\/hexo-theme-next themes\/next<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u7136\u540e\u5728 Hexo \u7684\u914d\u7f6e\u6587\u4ef6 _config.yml \u4e2d\u914d\u7f6e\u4e3b\u9898\uff1a<\/p>\n<pre>theme: next<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u65f6\u5019\u4f60\u7684\u535a\u5ba2\u5c31\u5e94\u8be5\u6709\u4e86\u4e00\u4e2a\u6f02\u4eae\u7684\u4e3b\u9898\u3002<\/p>\n<p>\u603b\u7ed3\u4e00\u4e0b\uff0c\u4f7f\u7528 Github \u548c Hexo \u642d\u5efa\u535a\u5ba2\u7684\u597d\u5904\u5728\u4e8e\u5feb\u901f\u3001\u4fbf\u6377\u3001\u514d\u8d39\u3002\u901a\u8fc7 Hexo \u7684 Markdown \u64b0\u5199\uff0c\u8ba9\u4f60\u7684\u535a\u5ba2\u53d8\u5f97\u7b80\u6d01\u660e\u4e86\uff0c\u52a0\u4e0a\u4e30\u5bcc\u7684\u4e3b\u9898\u548c\u63d2\u4ef6\uff0c\u53ef\u4ee5\u8ba9\u4f60\u7684\u535a\u5ba2\u5177\u5907\u66f4\u5f3a\u7684\u8868\u73b0\u529b\u3002\u4f5c\u4e3a\u4e00\u4e2a\u6280\u672f\u4eba\u5458\uff0c\u62e5\u6709\u81ea\u5df1\u7684\u535a\u5ba2\u53ef\u4ee5\u8ba9\u4f60\u5c55\u793a\u81ea\u5df1\u7684\u6280\u672f\u80fd\u529b\uff0c\u5438\u5f15\u66f4\u591a\u7684\u6f5c\u5728\u96c7\u4e3b\u6216\u5ba2\u6237\u3002\u540c\u65f6\uff0c\u901a\u8fc7\u535a\u5ba2\u53ef\u4ee5\u7ed3\u8bc6\u66f4\u591a\u7684\u6709\u5171\u540c\u5174\u8da3\u7684\u4eba\uff0c\u6269\u5927\u81ea\u5df1\u7684\u793e\u4ea4\u5708\u5b50\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fGithub+Hexo\u600e\u4e48\u642d\u5efa\u535a\u5ba2\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>\u5728\u8fd9\u4e2a\u6570\u5b57\u5316\u65f6\u4ee3\uff0c\u62e5\u6709\u4e00\u4e2a\u81ea\u5df1\u7684\u535a\u5ba2\u662f\u4e00\u4ef6\u5341\u5206\u6709\u7528\u7684\u4e8b\u60c5\u3002\u53ef\u80fd\u4f60\u4f1a\u95ee\uff0c\u4e3a\u4ec0\u4e48\u9700\u8981\u62e5\u6709\u4e00\u4e2a\u535a\u5ba2\u5462\uff1f\u8fd9\u662f\u56e0\u4e3a\u9996\u5148\uff0c\u535a\u5ba2\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u5c55\u793a\u81ea\u5df1\u6280\u80fd\u7684\u5e73\u53f0\uff0c\u5176\u6b21\uff0c\u901a\u8fc7\u535a\u5ba2\u53ef\u4ee5\u4e0e\u5176\u4ed6\u6709\u5171\u540c\u5174\u8da3\u7684\u4eba\u8fdb\u884c\u4ea4\u6d41\u548c\u6c9f\u901a\uff0c\u6700\u540e\uff0c\u535a\u5ba2\u8fd8\u53ef\u4ee5\u4e3a\u4f60\u521b\u9020\u5546\u4e1a\u673a\u4f1a\u3002 \u90a3\u4e48\u600e\u4e48\u624d\u80fd\u5feb\u901f\u3001\u7b80\u5355\u5730\u642d\u5efa\u4e00\u4e2a\u535a\u5ba2\u5462\uff1f\u8fd9\u91cc\u63a8\u8350\u4f7f\u7528 Github \u548c Hexo\uff0c\u901a\u8fc7\u4e8c\u8005\u7684\u7ed3\u5408\u53ef\u4ee5\u8fc5\u901f\u5730\u642d\u5efa\u81ea\u5df1\u7684\u535a\u5ba2\u3002 \u9996\u5148\uff0c\u4ecb\u7ecd\u4e00\u4e0b Github \u548c Hexo \u8fd9\u4e24\u4e2a\u5de5\u5177\u3002Github \u662f\u4e00\u6b3e\u9762\u5411\u5f00\u53d1\u8005\u7684\u7f51\u7ad9\uff0c\u63d0\u4f9b\u4e86\u4ee3\u7801\u6258\u7ba1\u3001\u7248\u672c\u63a7\u5236\u7b49\u670d\u52a1\u3002Hexo \u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u9759\u6001\u535a\u5ba2\u6846\u67b6\uff0c\u80fd\u591f\u5c06 Markdown \u6587\u6863\u5feb\u901f\u8f6c\u5316\u4e3a\u9759\u6001\u7684 HTML \u9875\u9762\u3002 \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u6765\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Github \u548c Hexo \u642d\u5efa\u535a\u5ba2\u3002\u9996\u5148\u9700\u8981\u5728 Github \u4e0a\u521b\u5efa\u81ea\u5df1\u7684\u4ed3\u5e93\uff0c\u4f5c\u4e3a\u535a\u5ba2\u7684\u6258\u7ba1\u3002 \u63a5\u4e0b\u6765\u9700\u8981\u5b89\u88c5 Hexo \uff0c\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a npm install hexo-cli -g \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u8981\u521d\u59cb\u5316 Hexo\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a hexo init blog \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u4f1a\u5728\u4f60\u7684\u7535\u8111\u4e0a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a blog \u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u542b\u4e86 Hexo \u7684\u4e00\u4e9b\u57fa\u672c\u6587\u4ef6\u3002 \u8fdb\u5165\u5230 blog \u76ee\u5f55\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u672c\u5730\u670d\u52a1\u5668\uff1a hexo server \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u65f6\u5019\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8f93\u5165 http:\/\/localhost:4000\uff0c\u4f60\u5c31\u53ef\u4ee5\u770b\u5230\u4f60\u7684\u535a\u5ba2\u4e86\u3002 \u73b0\u5728\u4f60\u53ef\u4ee5\u5f00\u59cb\u5199\u535a\u5ba2\u4e86\u3002Hexo \u63d0\u4f9b\u4e86\u4e00\u4e9b\u9ed8\u8ba4\u7684\u547d\u4ee4\uff0c\u5e2e\u52a9\u4f60\u5feb\u901f\u521b\u5efa\u6587\u7ae0\u3001\u90e8\u7f72\u535a\u5ba2\u7b49\u3002\u6bd4\u5982\uff0c\u521b\u5efa\u4e00\u7bc7\u6587\u7ae0\uff1a hexo new &#8220;Hello [&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-19920","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19920","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=19920"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19920\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}