{"id":43,"date":"2024-07-09T15:38:18","date_gmt":"2024-07-09T07:38:18","guid":{"rendered":"https:\/\/blog.62510360.xyz\/?p=43"},"modified":"2024-07-09T15:38:53","modified_gmt":"2024-07-09T07:38:53","slug":"hexo-github-pages-cloudflare-pages-%e5%ae%8c%e6%95%b4%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/blog.62510360.xyz\/?p=43","title":{"rendered":"Hexo + GitHub Pages + Cloudflare Pages \u5b8c\u6574\u6307\u5357"},"content":{"rendered":"\n<p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Hexo\u6846\u67b6\u642d\u5efa\u4e00\u4e2a\u4e2a\u4eba\u535a\u5ba2\uff0c\u5e76\u5c06\u5176\u90e8\u7f72\u5230GitHub Pages\u548cCloudflare Pages\u4e0a\u3002\u4e3b\u8981\u5185\u5bb9\u5305\u62ec\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u73af\u5883\u51c6\u5907\uff1a\u5b89\u88c5Node.js\u548cGit<\/li>\n\n\n\n<li>\u914d\u7f6eGit\u548cGitHub\uff1a\u8bbe\u7f6eSSH\u5bc6\u94a5\uff0c\u521b\u5efaGitHub\u4ed3\u5e93<\/li>\n\n\n\n<li>\u521d\u59cb\u5316Hexo\u9879\u76ee\uff1a\u5b89\u88c5Hexo\uff0c\u521b\u5efa\u65b0\u535a\u5ba2<\/li>\n\n\n\n<li>\u90e8\u7f72\u5230GitHub Pages\uff1a\u914d\u7f6e\u90e8\u7f72\u8bbe\u7f6e\uff0c\u63a8\u9001\u9759\u6001\u6587\u4ef6<\/li>\n\n\n\n<li>\u90e8\u7f72\u5230Cloudflare Pages\uff1a\u8fde\u63a5GitHub\u4ed3\u5e93\uff0c\u81ea\u52a8\u90e8\u7f72<\/li>\n\n\n\n<li>\u57fa\u672c\u4f7f\u7528\u65b9\u6cd5\uff1a\u521b\u5efa\u65b0\u6587\u7ae0\uff0c\u672c\u5730\u9884\u89c8\uff0c\u53d1\u5e03\u66f4\u65b0<\/li>\n<\/ul>\n\n\n\n<p>\u8fd9\u4e2a\u6559\u7a0b\u9002\u5408\u90a3\u4e9b\u60f3\u8981\u5feb\u901f\u642d\u5efa\u4e2a\u4eba\u535a\u5ba2\uff0c\u4f46\u53c8\u4e0d\u60f3\u82b1\u8d39\u592a\u591a\u6210\u672c\u7684\u4eba\u3002\u901a\u8fc7\u4f7f\u7528Hexo\u3001GitHub\u548cCloudflare\u7684\u514d\u8d39\u670d\u52a1\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u4e00\u4e2a\u9ad8\u6548\u3001\u7b80\u6d01\u7684\u535a\u5ba2\u7f51\u7ad9\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1-\u4e8b\u524d\u51c6\u5907\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#1-%E4%BA%8B%E5%89%8D%E5%87%86%E5%A4%87\"><\/a>1.\u4e8b\u524d\u51c6\u5907<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u57df\u540d\uff08<strong>\u975e\u5fc5\u987b<\/strong>\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u514d\u8d39\u57df\u540d\uff0c\u6216\u8005<code>GitHub.io<\/code>\u6216<code>Pages.dev<\/code>\u5206\u914d\u7684\u57df\u540d\u4e5f\u53ef\u4ee5\uff09<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>\uff08<strong>\u5fc5\u987b<\/strong>\uff0c\u4f60\u9700\u8981\u6ce8\u518c\u4e00\u4e2aGitHub\u5e10\u53f7\uff09<\/li>\n\n\n\n<li><a href=\"https:\/\/dash.cloudflare.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Cloudflare<\/a>\uff08<strong>\u975e\u5fc5\u987b<\/strong>\uff0c\u4f60\u9700\u8981\u6ce8\u518c\u4e00\u4e2aCloudflare\u5e10\u53f7\uff0c\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u5c06\u535a\u5ba2\u90e8\u7f72\u5728CF\u7684CDN\u91cc\u52a0\u901f\uff0c\u4f46\u662f\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528<code>GitHub.io<\/code>\u5206\u914d\u7684\u57df\u540d\uff09<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-\u8f6f\u4ef6\u652f\u6301\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#2-%E8%BD%AF%E4%BB%B6%E6%94%AF%E6%8C%81\"><\/a>2.\u8f6f\u4ef6\u652f\u6301<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#2-1-%E5%AE%89%E8%A3%85-Node\">Node<\/a>\uff08<strong>\u5fc5\u987b<\/strong>\uff09<\/li>\n\n\n\n<li><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#2-2-%E5%AE%89%E8%A3%85-Git\">Git<\/a>\uff08<strong>\u5fc5\u987b<\/strong>\uff09<\/li>\n\n\n\n<li><a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">VSCode<\/a>\uff08<strong>\u975e\u5fc5\u987b<\/strong>\uff0c\u8fd9\u662f\u4e00\u6b3e\u8f7b\u91cf\u578b\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u517b\u6210\u4e00\u4e2a\u5f88\u597d\u7684\u7f16\u7a0b\u4e60\u60ef\uff09<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-1-\u5b89\u88c5-Node\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#2-1-%E5%AE%89%E8%A3%85-Node\"><\/a>2.1.\u5b89\u88c5 Node<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6253\u5f00Node\u5b98\u7f51\uff0c\u4e0b\u8f7d\u548c\u81ea\u5df1\u7cfb\u7edf\u76f8\u914d\u7684Node\u7684\u5b89\u88c5\u7a0b\u5e8f\uff0c\u5426\u5219\u4f1a\u51fa\u73b0\u5b89\u88c5\u95ee\u9898\u3002\u4e0b\u8f7d\u5730\u5740\uff1a<a href=\"https:\/\/nodejs.org\/en\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/nodejs.org\/en<\/a><\/li>\n\n\n\n<li>\u4e0b\u8f7d\u540e\u5b89\u88c5\uff0c\u5b89\u88c5\u7684\u76ee\u5f55\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u76ee\u5f55<code>C:\/Program Files\/nodejs\/<\/code><\/li>\n\n\n\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002\u5728\u952e\u76d8\u6309\u4e0bwin + R\u952e\uff0c\u8f93\u5165CMD\uff0c\u7136\u540e\u56de\u8f66\uff0c\u6253\u5f00CMD\u7a97\u53e3\uff0c\u6267\u884c<code>node -v<\/code>\u547d\u4ee4\uff0c\u770b\u5230\u7248\u672c\u4fe1\u606f\uff0c\u5219\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/5ca2f549a4489064d3444.jpg\"><\/a><\/li>\n\n\n\n<li>\u4fee\u6539npm\u6e90\u3002npm\u4e0b\u8f7d\u5404\u79cd\u6a21\u5757\uff0c\u9ed8\u8ba4\u662f\u4ece\u56fd\u5904\u670d\u52a1\u5668\u4e0b\u8f7d\uff0c\u901f\u5ea6\u8f83\u6162\uff0c\u5efa\u8bae\u914d\u7f6e\u6210\u534e\u4e3a\u4e91\u955c\u50cf\u6e90\u3002\u6253\u5f00CMD\u7a97\u53e3\uff0c\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4:CMD1<br>npm config set registry https:\/\/mirrors.huaweicloud.com\/repository\/npm\/<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-2-\u5b89\u88c5-Git\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#2-2-%E5%AE%89%E8%A3%85-Git\"><\/a>2.2.\u5b89\u88c5 Git<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u8fdb\u5165\u5b98\u7f51\u4e0b\u8f7d\u9002\u5408\u4f60\u5f53\u524d\u7cfb\u7edf\u7684 Git\uff1a<a href=\"https:\/\/git-scm.com\/downloads\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/git-scm.com\/downloads<\/a><br><a href=\"https:\/\/img.090227.xyz\/file\/14b9fdf14c49320e531fb.jpg\"><\/a><\/li>\n\n\n\n<li>\u4e0b\u8f7d\u540e\u50bb\u74dc\u5f0f\u5b89\u88c5Git\u5373\u53ef\uff0c\u5b89\u88c5\u7684\u76ee\u5f55\u6700\u597d\u4f7f\u7528\u9ed8\u8ba4\u76ee\u5f55<code>C:\/Program Files\/Git<\/code><\/li>\n\n\n\n<li>\u70b9\u51fb\u7535\u8111\u5de6\u4e0b\u89d2\u5f00\u59cb\u5373\u53ef\u770b\u89c1<code>Git CMD<\/code>\u3001<code>Git Bash<\/code>\u3001<code>Git GUI<\/code>\u3002\n<ul class=\"wp-block-list\">\n<li><code>Git CMD<\/code>\u00a0\u662fwindows \u547d\u4ee4\u884c\u7684\u6307\u4ee4\u98ce\u683c<\/li>\n\n\n\n<li><code>Git Bash<\/code>\u00a0\u662flinux\u7cfb\u7edf\u7684\u6307\u4ee4\u98ce\u683c\uff08\u5efa\u8bae\u4f7f\u7528\uff09<\/li>\n\n\n\n<li><code>Git GUI<\/code>\u662f\u56fe\u5f62\u5316\u754c\u9762\uff08\u65b0\u624b\u5b66\u4e60\u4e0d\u5efa\u8bae\u4f7f\u7528\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3-\u914d\u7f6e-Git-\u5bc6\u94a5\u5e76\u8fde\u63a5\u81f3-Github\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#3-%E9%85%8D%E7%BD%AE-Git-%E5%AF%86%E9%92%A5%E5%B9%B6%E8%BF%9E%E6%8E%A5%E8%87%B3-Github\"><\/a>3.\u914d\u7f6e Git \u5bc6\u94a5\u5e76\u8fde\u63a5\u81f3 Github<\/h2>\n\n\n\n<p>\u5e38\u7528 Git \u547d\u4ee4<\/p>\n\n\n\n<p>SHELL<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<\/td><td>git config -l \/\/\u67e5\u770b\u6240\u6709\u914d\u7f6e<br>git config &#8211;system &#8211;list \/\/\u67e5\u770b\u7cfb\u7edf\u914d\u7f6e<br>git config &#8211;global &#8211;list \/\/\u67e5\u770b\u7528\u6237\uff08\u5168\u5c40\uff09\u914d\u7f6e<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/img.090227.xyz\/file\/f403664b22ad3488a5fb4.jpg\"><img decoding=\"async\" src=\"https:\/\/img.090227.xyz\/file\/f403664b22ad3488a5fb4.jpg\" alt=\"\u542f\u52a8Git\"\/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-1-\u914d\u7f6e\u7528\u6237\u540d\u548c\u90ae\u7bb1\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#3-1-%E9%85%8D%E7%BD%AE%E7%94%A8%E6%88%B7%E5%90%8D%E5%92%8C%E9%82%AE%E7%AE%B1\"><\/a>3.1. \u914d\u7f6e\u7528\u6237\u540d\u548c\u90ae\u7bb1<\/h3>\n\n\n\n<p>SHELL<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<\/td><td>git config &#8211;global user.name &#8220;\u4f60\u7684\u7528\u6237\u540d&#8221;<br>git config &#8211;global user.email &#8220;\u4f60\u7684\u90ae\u7bb1&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u901a\u8fc7<code>git config -l<\/code>&nbsp;\u68c0\u67e5\u662f\u5426\u914d\u7f6e\u6210\u529f\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/67dca39142021e2214e2b.jpg\"><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-2-\u914d\u7f6e\u516c\u94a5\u8fde\u63a5Github\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#3-2-%E9%85%8D%E7%BD%AE%E5%85%AC%E9%92%A5%E8%BF%9E%E6%8E%A5Github\"><\/a>3.2. \u914d\u7f6e\u516c\u94a5\u8fde\u63a5Github<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u751f\u6210ssh\u516c\u94a5\uff0c\u6b64\u516c\u94a5\u7528\u4e8e\u4f60\u7684\u8ba1\u7b97\u673a\u8fde\u63a5GithubSHELL1<br>ssh-keygen -t rsa -C &#8220;\u4f60\u7684\u90ae\u7bb1&#8221;<br>\u63d0\u793a<code>Enter file in which to save the key<\/code>\u76f4\u63a5<strong>\u4e00\u8def\u56de\u8f66<\/strong>\u5373\u53ef\uff0c\u65b0\u624b\u5c0f\u767d\u4e0d\u63a8\u8350\u8bbe\u7f6e\u5bc6\u94a5<br><a href=\"https:\/\/img.090227.xyz\/file\/45d70737c64caeb4393ad.jpg\"><\/a><br>\u4e4b\u540e\u6253\u5f00C\u76d8\u4e0b\u7528\u6237\u6587\u4ef6\u5939\u4e0b\u7684.ssh\u7684\u6587\u4ef6\u5939\uff0c\u4f1a\u770b\u5230\u4ee5\u4e0b\u6587\u4ef6\n<ul class=\"wp-block-list\">\n<li><code>id_rsa<\/code>\u79c1\u94a5<\/li>\n\n\n\n<li><code>id_rsa.pub<\/code>\u516c\u94a5<br><a href=\"https:\/\/img.090227.xyz\/file\/40bd636f749347666f9f7.jpg\"><\/a><br>\u7528\u8bb0\u4e8b\u672c\u6253\u5f00\u4e0a\u8ff0\u56fe\u7247\u4e2d\u7684\u516c\u94a5<code>id_rsa.pub<\/code>\uff0c\u590d\u5236\u91cc\u9762\u7684\u5185\u5bb9\uff0c\u7136\u540e\u5f00\u59cb\u5728github\u4e2d\u914d\u7f6essh\u5bc6\u94a5\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/0086246f3ccc703b9035e.jpg\"><\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u5c06 SSH KEY \u914d\u7f6e\u5230 GitHub<br>\u8fdb\u5165github\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u5934\u50cf \u9009\u62e9<code>settings<\/code>\uff0c\u8fdb\u5165\u8bbe\u7f6e\u9875\u540e\u9009\u62e9\u00a0<code>SSH and GPG keys<\/code>\uff0c\u540d\u5b57\u968f\u4fbf\u8d77\uff0c\u516c\u94a5\u586b\u5230<code>Key<\/code>\u90a3\u4e00\u680f\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/75fc281237bfc6751a295.jpg\"><\/a><br><a href=\"https:\/\/img.090227.xyz\/file\/993edae3bbca9489dc156.jpg\"><\/a><br><a href=\"https:\/\/img.090227.xyz\/file\/fa8a7628c285e6be5c0a4.png\"><\/a><br><a href=\"https:\/\/img.090227.xyz\/file\/f3fa79cf3d639ef2d5bcb.png\"><\/a><\/li>\n\n\n\n<li>\u6d4b\u8bd5\u8fde\u63a5\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4SHELL1<br>ssh -T git@github.com<br>\u7b2c\u4e00\u6b21\u8fde\u63a5\u4f1a\u63d0\u793a<code>Are you sure you want to continue connecting (yes\/no\/[fingerprint])?<\/code>\uff0c\u8f93\u5165<code>yes<\/code>\u5373\u53ef<br><a href=\"https:\/\/img.090227.xyz\/file\/faa0077eeab8c82f1de9e.png\"><\/a><br>\u51fa\u73b0\u8fde\u63a5\u5230\u8d26\u6237\u7684\u4fe1\u606f\uff0c\u8bf4\u660e\u5df2\u7ecf\u5927\u529f\u544a\u6210\uff0c\u81f3\u6b64\u5b8c\u6210\u4e86\u73af\u5883\u51c6\u5907\u5de5\u4f5c\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/faa0077eeab8c82f1de9e.png\"><\/a><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-3-\u521b\u5efaGitHub-io\u4ed3\u5e93\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#3-3-%E5%88%9B%E5%BB%BAGitHub-io%E4%BB%93%E5%BA%93\"><\/a>3.3. \u521b\u5efaGitHub.io\u4ed3\u5e93<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684<code>+<\/code>\u6309\u94ae\uff0c\u9009\u62e9<strong>New repository<\/strong>\uff0c\u521b\u5efa\u4e00\u4e2a<code>&lt;\u7528\u6237\u540d>.github.io<\/code>\u7684\u4ed3\u5e93\u3002<\/li>\n\n\n\n<li>\u4ed3\u5e93\u540d\u5b57\u7684\u683c\u5f0f\u5fc5\u987b\u4e3a\uff1a<code>&lt;\u7528\u6237\u540d>.github.io<\/code>\u00a0(\u6ce8\u610f\uff1a\u524d\u7f00\u5fc5\u987b\u4e3a\u7528\u6237\u540d\uff0c\u6b64\u4e3a\u9884\u89c8\u535a\u5ba2\u9700\u8981\uff0c\u540e\u671f\u53ef\u4fee\u6539\u4ed3\u5e93\u540d)<\/li>\n\n\n\n<li>\u53ef\u89c1\u6027\u5fc5\u987b\u9009\u62e9\u00a0<code>Public<\/code>\u00a0\u65b9\u4fbf\u7b2c\u4e00\u6b21\u90e8\u7f72\u68c0\u67e5\u95ee\u9898\uff0c\u70b9\u51fb\u00a0<strong>Creat repository<\/strong>\u00a0\u8fdb\u884c\u521b\u5efa\u5373\u53ef<br><a href=\"https:\/\/img.090227.xyz\/file\/3d9274644460cd1ffeb26.png\"><\/a><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4-\u521d\u59cb\u5316-Hexo-\u535a\u5ba2\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#4-%E5%88%9D%E5%A7%8B%E5%8C%96-Hexo-%E5%8D%9A%E5%AE%A2\"><\/a>4.\u521d\u59cb\u5316 Hexo \u535a\u5ba2<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\u6765\u4fdd\u5b58\u535a\u5ba2\u6e90\u7801\uff08\u6211\u8fd9\u91cc\u9009\u7684\u8def\u5f84\u4e3a<code>D:\/Hexo-Blog<\/code>\uff09\uff0c\u5728\u6587\u4ef6\u5939\u5185\u53f3\u952e\u9f20\u6807\uff0c\u9009\u62e9<code>Open Git Bash here<\/code><br><a href=\"https:\/\/img.090227.xyz\/file\/f78e04406dc803d610538.png\"><\/a><\/li>\n\n\n\n<li>\u5728<code>Git BASH<\/code>\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5 HexoSHELL1<br>npm install -g hexo-cli &amp;&amp; hexo -v<br><a href=\"https:\/\/img.090227.xyz\/file\/808bff9b7ab5b13fcd200.png\"><\/a><\/li>\n\n\n\n<li>\u5b89\u88c5\u5b8c\u540e\u8f93\u5165<code>hexo -v<\/code>\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/17349517f78516f7ac8ff.png\"><\/a><\/li>\n\n\n\n<li>\u521d\u59cb\u5316 Hexo \u9879\u76ee\u5b89\u88c5\u76f8\u5173\u4f9d\u8d56\u3002SHELL1<br>2<br>3<br>hexo init blog-demo<br>cd blog-demo<br>npm i<br><a href=\"https:\/\/img.090227.xyz\/file\/1c130d7beed537111d448.png\"><\/a><\/li>\n\n\n\n<li>\u521d\u59cb\u5316\u9879\u76ee\u540e\uff0c<code>blog-demo<\/code>\u6709\u5982\u4e0b\u7ed3\u6784\uff1a<br><a href=\"https:\/\/img.090227.xyz\/file\/74128294708705e22e188.png\"><\/a><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>node_modules<\/strong>\uff1a\u4f9d\u8d56\u5305<\/li>\n\n\n\n<li><strong>scaffolds<\/strong>\uff1a\u751f\u6210\u6587\u7ae0\u7684\u4e00\u4e9b\u6a21\u677f<\/li>\n\n\n\n<li><strong>source<\/strong>\uff1a\u7528\u6765\u5b58\u653e\u4f60\u7684\u6587\u7ae0<\/li>\n\n\n\n<li><strong>themes<\/strong>\uff1a\u4e3b\u9898<\/li>\n\n\n\n<li><strong>.npmignore<\/strong>\uff1a\u53d1\u5e03\u65f6\u5ffd\u7565\u7684\u6587\u4ef6\uff08\u53ef\u5ffd\u7565\uff09<\/li>\n\n\n\n<li><strong>_config.landscape.yml<\/strong>\uff1a\u4e3b\u9898\u7684\u914d\u7f6e\u6587\u4ef6<\/li>\n\n\n\n<li><strong>config.yml<\/strong>\uff1a\u535a\u5ba2\u7684\u914d\u7f6e\u6587\u4ef6<\/li>\n\n\n\n<li><strong>package.json<\/strong>\uff1a\u9879\u76ee\u540d\u79f0\u3001\u63cf\u8ff0\u3001\u7248\u672c\u3001\u8fd0\u884c\u548c\u5f00\u53d1\u7b49\u4fe1<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li>\u8f93\u5165<code>hexo cl &amp;&amp; hexo s<\/code>\u542f\u52a8\u9879\u76ee<br><a href=\"https:\/\/img.090227.xyz\/file\/e8c930919bb49270bde5a.png\"><\/a><\/li>\n\n\n\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8f93\u5165\u5730\u5740\uff1a<a href=\"http:\/\/localhost:4000\/\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/localhost:4000\/<\/a>\u00a0\uff0c\u770b\u5230\u4e0b\u9762\u7684\u6548\u679c\uff0c\u8bf4\u660e\u4f60\u7684\u535a\u5ba2\u5df2\u7ecf\u6784\u5efa\u6210\u529f\u4e86\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/e285037815104f68f4514.jpg\"><\/a><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5-\u5c06\u9759\u6001\u535a\u5ba2\u6302\u8f7d\u5230-GitHub-Pages\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#5-%E5%B0%86%E9%9D%99%E6%80%81%E5%8D%9A%E5%AE%A2%E6%8C%82%E8%BD%BD%E5%88%B0-GitHub-Pages\"><\/a>5.\u5c06\u9759\u6001\u535a\u5ba2\u6302\u8f7d\u5230 GitHub Pages<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5b89\u88c5 hexo-deployer-gitSHELL1<br>npm install hexo-deployer-git &#8211;save<\/li>\n\n\n\n<li>\u4fee\u6539\u00a0<code>_config.yml<\/code>\u00a0\u6587\u4ef6<br>\u5728blog-demo\u76ee\u5f55\u4e0b\u7684_config.yml\uff0c\u5c31\u662f\u6574\u4e2aHexo\u6846\u67b6\u7684\u914d\u7f6e\u6587\u4ef6\u4e86\u3002\u53ef\u4ee5\u5728\u91cc\u9762\u4fee\u6539\u5927\u90e8\u5206\u7684\u914d\u7f6e\u3002\u8be6\u7ec6\u53ef\u53c2\u8003\u5b98\u65b9\u7684<a href=\"https:\/\/hexo.io\/zh-cn\/docs\/configuration\" target=\"_blank\" rel=\"noreferrer noopener\">\u914d\u7f6e\u63cf\u8ff0<\/a>\u3002<br>\u4fee\u6539\u6700\u540e\u4e00\u884c\u7684\u914d\u7f6e\uff0c\u5c06repository\u4fee\u6539\u4e3a\u4f60\u81ea\u5df1\u7684github\u9879\u76ee\u5730\u5740\u5373\u53ef\uff0c\u8fd8\u6709\u5206\u652f\u8981\u6539\u4e3a<code>main<\/code>\u4ee3\u8868\u4e3b\u5206\u652f\uff08\u6ce8\u610f\u7f29\u8fdb\uff09\u3002<br>deploy:<br>type: git<br>repository: git@github.com:cmliussss2024\/cmliussss2024.github.io.git<br>branch: main<\/li>\n\n\n\n<li>\u4fee\u6539\u597d\u914d\u7f6e\u540e\uff0c\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u5c06\u4ee3\u7801\u90e8\u7f72\u5230 GitHub\uff08Hexo\u4e09\u8fde\uff09\u3002<br>\/\/ Git BASH\u7ec8\u7aef<br>hexo clean &amp;&amp; hexo generate &amp;&amp; hexo deploy<br><br>\/\/ \u6216\u8005<br><br>\/\/ VSCODE\u7ec8\u7aef<br>hexo cl; hexo g; hexo d<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>hexo clean<\/strong>\uff1a\u5220\u9664\u4e4b\u524d\u751f\u6210\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u7528<code>hexo cl<\/code>\u7f29\u5199\u3002<\/li>\n\n\n\n<li><strong>hexo generate<\/strong>\uff1a\u751f\u6210\u9759\u6001\u6587\u7ae0\uff0c\u53ef\u4ee5\u7528<code>hexo g<\/code>\u7f29\u5199<\/li>\n\n\n\n<li><strong>hexo deploy<\/strong>\uff1a\u90e8\u7f72\u6587\u7ae0\uff0c\u53ef\u4ee5\u7528<code>hexo d<\/code>\u7f29\u5199<br><a href=\"https:\/\/img.090227.xyz\/file\/18b052b831896bf00cfc4.jpg\"><\/a><br><em>\u6ce8\u610f\uff1adeploy\u65f6\u53ef\u80fd\u8981\u4f60\u8f93\u5165 username \u548c password\u3002<\/em><\/li>\n<\/ul>\n\n\n\n<p>\u5982\u679c\u51fa\u73b0<strong>Deploy done<\/strong>\uff0c\u5219\u8bf4\u660e\u90e8\u7f72\u6210\u529f\u4e86\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/93a5d61648491a5278556.jpg\"><\/a><br>\u7a0d\u7b49\u4e24\u5206\u949f\uff0c\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1a<a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/cmliussss2024.github.io\/\">https:\/\/cmliussss2024.github.io<\/a>&nbsp;\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u770b\u5230\u535a\u5ba2\u5185\u5bb9\u4e86\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/1239b1270fcdc8bd896a6.jpg\"><\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6-\u5c06\u9759\u6001\u535a\u5ba2\u6302\u8f7d\u5230-Cloudflare-Pages\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#6-%E5%B0%86%E9%9D%99%E6%80%81%E5%8D%9A%E5%AE%A2%E6%8C%82%E8%BD%BD%E5%88%B0-Cloudflare-Pages\"><\/a>6.\u5c06\u9759\u6001\u535a\u5ba2\u6302\u8f7d\u5230 Cloudflare Pages<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5728\u00a0<code>Workers \u548c Pages<\/code>\u00a0\u4e2d\u9009\u62e9\u00a0<code>Pages<\/code>\u00a0\u7684\u00a0<code>\u8fde\u63a5\u5230 Git<\/code><br><a href=\"https:\/\/img.090227.xyz\/file\/b3eae4e84c4c7c31af665.jpg\"><\/a><br><a href=\"https:\/\/img.090227.xyz\/file\/440581264cb313ed77e75.jpg\"><\/a><\/li>\n\n\n\n<li>\u7136\u540e\u767b\u5f55\u4f60Blog\u4ed3\u5e93\u5bf9\u5e94\u7684GitHub\u5e10\u53f7<br><a href=\"https:\/\/img.090227.xyz\/file\/733c0a673bb66670b7ca1.jpg\"><\/a><br><a href=\"https:\/\/img.090227.xyz\/file\/8fb282e32991167a98f57.jpg\"><\/a><\/li>\n\n\n\n<li>\u70b9\u51fb<code>\u4fdd\u5b58\u5e76\u90e8\u7f72<\/code>\u540e\u7b49\u5f85\u90e8\u7f72\u5b8c\u6210\u5373\u53ef\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/60cca5e2200e260327227.jpg\"><\/a><\/li>\n\n\n\n<li>\u63d0\u793a<code>\u6210\u529f\uff01\u60a8\u7684\u9879\u76ee\u5df2\u90e8\u7f72\u5230\u4ee5\u4e0b\u533a\u57df\uff1a\u5168\u7403<\/code>\u540e\uff0c\u6d4f\u89c8\u5668\u8bbf\u95ee\uff1a<a href=\"https:\/\/cmliussss2024-github-io.pages.dev\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/cmliussss2024-github-io.pages.dev<\/a>\u00a0\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u770b\u5230\u535a\u5ba2\u5185\u5bb9\u4e86\u3002<br><a href=\"https:\/\/img.090227.xyz\/file\/0f2a697243725c6fa2ab8.jpg\"><\/a><br><em>\u8fd9\u65f6\u4f60\u4e5f\u5c31\u53ef\u4ee5\u5c06\u4f60\u7684<code>&lt;\u7528\u6237\u540d>.github.io<\/code>\u7684\u4ed3\u5e93\u8bbe\u7f6e\u4e3a<code>Private<\/code>\u79c1\u5e93\u4e86<\/em><\/li>\n\n\n\n<li>\u5982\u679c\u4f60\u6709\u81ea\u5df1\u7684\u57df\u540d\uff0c\u4f60\u53ef\u4ee5\u5728\u8fd9\u91cc\u7ed1\u5b9a\u4f60\u81ea\u5df1\u7684\u81ea\u5b9a\u4e49\u57df\uff0c\u5373\u53ef<br><a href=\"https:\/\/img.090227.xyz\/file\/2c9ce4b9b67c09376bb91.jpg\"><\/a><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"\u5982\u4f55\u4f7f\u7528\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8\"><\/a>\u5982\u4f55\u4f7f\u7528<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u65b0\u5efa\u4e00\u7bc7\u535a\u6587\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#%E6%96%B0%E5%BB%BA%E4%B8%80%E7%AF%87%E5%8D%9A%E6%96%87\"><\/a>\u65b0\u5efa\u4e00\u7bc7\u535a\u6587<\/h2>\n\n\n\n<p>SHELL<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>hexo new \u8fd9\u662f\u4e00\u7bc7\u65b0\u7684\u535a\u6587<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7136\u540e\u7528\u6587\u672c\u7f16\u8f91\u5668\u53bb\u7f16\u8f91<code>_posts\/\u8fd9\u662f\u4e00\u7bc7\u65b0\u7684\u535a\u6587.md<\/code>\u91cc\u7684\u5185\u5bb9\u5373\u53ef\uff0c\u6ce8\u610f\u8981\u4f7f\u7528<strong>Markdown<\/strong>\u683c\u5f0f\u4e66\u5199\u3002<br>\u8be6\u7ec6\u4f7f\u7528\u65b9\u6cd5\u53ef\u4ee5\u67e5\u9605&nbsp;<a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/hexo.io\/zh-cn\/docs\/writing\">https:\/\/hexo.io\/zh-cn\/docs\/writing<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u7f16\u8f91\u5b8c\u6587\u7ae0\u4fdd\u5b58\u540e\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff0c\u751f\u6210\u672c\u5730\u9875\u9762-http-localhost-4000-\uff0c\u8fdb\u884c\u9884\u89c8\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#%E7%BC%96%E8%BE%91%E5%AE%8C%E6%96%87%E7%AB%A0%E4%BF%9D%E5%AD%98%E5%90%8E%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E5%A6%82%E4%B8%8B%E5%91%BD%E4%BB%A4%EF%BC%8C%E7%94%9F%E6%88%90%E6%9C%AC%E5%9C%B0%E9%A1%B5%E9%9D%A2-http-localhost-4000-%EF%BC%8C%E8%BF%9B%E8%A1%8C%E9%A2%84%E8%A7%88\"><\/a>\u7f16\u8f91\u5b8c\u6587\u7ae0\u4fdd\u5b58\u540e\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff0c\u751f\u6210\u672c\u5730\u9875\u9762&nbsp;<a target=\"_blank\" rel=\"noreferrer noopener\" href=\"http:\/\/localhost:4000\/\">http:\/\/localhost:4000\/<\/a>&nbsp;\uff0c\u8fdb\u884c\u9884\u89c8<\/h2>\n\n\n\n<p>SHELL<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<\/td><td>\/\/ Git BASH\u7ec8\u7aef<br>hexo cl &amp;&amp; hexo s<br><br>\/\/ \u6216\u8005<br><br>\/\/ VSCODE\u7ec8\u7aef<br>hexo cl; hexo s<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u786e\u8ba4\u65e0\u8bef\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5c06\u672c\u5730\u6587\u7ae0\u63a8\u9001\u81f3GitHub\u4ed3\u5e93\u5373\u53ef\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#%E7%A1%AE%E8%AE%A4%E6%97%A0%E8%AF%AF%E5%90%8E%E4%BD%BF%E7%94%A8%E4%BB%A5%E4%B8%8B%E5%91%BD%E4%BB%A4%EF%BC%8C%E5%B0%86%E6%9C%AC%E5%9C%B0%E6%96%87%E7%AB%A0%E6%8E%A8%E9%80%81%E8%87%B3GitHub%E4%BB%93%E5%BA%93%E5%8D%B3%E5%8F%AF\"><\/a>\u786e\u8ba4\u65e0\u8bef\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5c06\u672c\u5730\u6587\u7ae0\u63a8\u9001\u81f3GitHub\u4ed3\u5e93\u5373\u53ef<\/h2>\n\n\n\n<p>SHELL<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<\/td><td>\/\/ Git BASH\u7ec8\u7aef<br>hexo cl &amp;&amp; hexo g &amp;&amp; hexo d<br><br>\/\/ \u6216\u8005<br><br>\/\/ VSCODE\u7ec8\u7aef<br>hexo cl; hexo g; hexo d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4e0b\u4e00\u671f\u4f1a\u8bb2\u8bb2\u8fdb\u9636\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c<strong>\u4e3b\u9898\u7f8e\u5316<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"VSCODE-\u7ec8\u7aef\u9996\u6b21\u6267\u884c\u62a5\u9519\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#VSCODE-%E7%BB%88%E7%AB%AF%E9%A6%96%E6%AC%A1%E6%89%A7%E8%A1%8C%E6%8A%A5%E9%94%99\"><\/a>VSCODE \u7ec8\u7aef\u9996\u6b21\u6267\u884c\u62a5\u9519<\/h1>\n\n\n\n<p>\u4f7f\u7528\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00 powershell ,\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4<\/p>\n\n\n\n<p>POWERSHELL<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>Set-ExecutionPolicy RemoteSigned<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"\u53c2\u8003\u8d44\u6599\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\"><\/a>\u53c2\u8003\u8d44\u6599<\/h1>\n\n\n\n<p><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/hexo.io\/zh-cn\/\">https:\/\/hexo.io\/zh-cn\/<\/a><br><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/www.fomal.cc\/posts\/e593433d.html\">https:\/\/www.fomal.cc\/posts\/e593433d.html<\/a><br><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/docs.anheyu.com\/\">https:\/\/docs.anheyu.com\/<\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"\u81f4\u8c22\u9879\u76ee\"><a href=\"https:\/\/blog.090227.xyz\/p\/HexoBlogNo1\/#%E8%87%B4%E8%B0%A2%E9%A1%B9%E7%9B%AE\"><\/a>\u81f4\u8c22\u9879\u76ee<\/h1>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/github.com\/hexojs\/hexo\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Hexo\u6846\u67b6\u642d\u5efa\u4e00\u4e2a\u4e2a\u4eba\u535a\u5ba2\uff0c\u5e76\u5c06\u5176\u90e8\u7f72\u5230GitHub Pages\u548cCloudflare [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-wlzy"],"_links":{"self":[{"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43"}],"version-history":[{"count":1,"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.62510360.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}