{"id":2329,"date":"2025-07-26T02:00:02","date_gmt":"2025-07-25T18:00:02","guid":{"rendered":"https:\/\/flandre-scarlet.moe\/blog\/?p=2329"},"modified":"2025-07-26T02:00:02","modified_gmt":"2025-07-25T18:00:02","slug":"%e4%b8%ba%e6%9c%ac%e7%ab%99%e6%b7%bb%e5%8a%a0-github-pages-%e5%a4%87%e4%bb%bd","status":"publish","type":"post","link":"https:\/\/flandre-scarlet.moe\/blog\/2329\/","title":{"rendered":"\u4e3a\u672c\u7ad9\u6dfb\u52a0 github pages \u5907\u4efd"},"content":{"rendered":"<p>VPS \u9700\u8981\u5b9a\u671f\u7eed\u8d39\uff0c\u57df\u540d\u4e5f\u662f\uff0c\u4e07\u4e00\u6211\u54ea\u5929\u560e\u4e86\uff0c\u57df\u540d\u8fc7\u671f\u4e3b\u673a\u6b20\u8d39\uff0c\u6211\u7684\u535a\u5ba2\u4e5f\u5c31\u9500\u58f0\u533f\u8ff9\u4e86\u3002\u6211\u5e0c\u671b\u5b83\u80fd\u6d3b\u5f97\u4e45\u4e00\u70b9\uff0c\u6bd5\u7adf\u662f\u81ea\u5df1\u4e00\u624b\u5e26\u5927\u7684\u3002\u773c\u4e0b\u6700\u597d\u7684\u9009\u62e9\u5e94\u8be5\u5c31\u662f\u6258\u7ba1 github pages \u4e86\u5427\uff0c\u6bd4\u8d77\u88ab\u968f\u610f\u5173\u505c\u7684\u4ea7\u54c1\uff0c\u4f5c\u4e3a\u4e16\u754c\u4e0a\u6700\u5927\u7684\u4ee3\u7801\u6258\u7ba1\u7f51\u7ad9\u548c\u5f00\u6e90\u793e\u533a\uff0cgithub \u53ef\u4ee5\u88ab\u8f6c\u624b\uff0c\u4f46\u7edd\u4e0d\u4f1a\u8f7b\u6613\u6d88\u5931\u3002\u9664\u975e\u54ea\u5929\u8bf4\u8981 archive \u957f\u671f\u4e0d\u6d3b\u8dc3\u7684\u4ed3\u5e93\u548c\u8d26\u53f7\uff0c\u54c8\u54c8\u3002\u4e0d\u7ba1\u600e\u4e48\u8bf4\uff0c\u76ee\u524d\u6765\u770b\u90fd\u662f\u76f8\u5f53\u597d\u7684\u9009\u62e9\u4e86\u3002\u7528\u6237\u591a\u3001\u670d\u52a1\u7a33\u5b9a\u8fd8\u514d\u8d39\u3002<br \/>\n<!--more--><\/p>\n<p>\u4e8e\u662f\u5f00\u59cb\u7740\u624b\u5907\u4efd\u3002\u4e4b\u524d\u542c\u5230\u8fc7 Hugo \u548c Hexo \u8fd9\u4e9b\u9759\u6001\u7f51\u7ad9\u6846\u67b6\uff0c\u6ca1\u591a\u60f3\uff0c\u9009\u4e86 Hexo\uff0c\u5148\u4e0a\u624b\u641e\u8d77\u6765\u518d\u8bf4\u3002<\/p>\n<h3>\u8fc1\u79fb\u6587\u7ae0<\/h3>\n<p>\u9996\u5148\u5230 wordpress \u540e\u53f0\u81ea\u5e26\u5de5\u5177\u91cc\u5bfc\u51fa\u6240\u6709\u6570\u636e\uff0c\u5f97\u5230\u4e00\u4e2a xml \u6587\u4ef6\u3002<\/p>\n<p>\u7136\u540e\u5b89\u88c5 hexo \u8fd8\u6709\u5bfc\u5165\u5de5\u5177 hexo-migrator-wordpress\u3002\u5e76\u5c06 wordpress \u7684 xml \u5bfc\u5165\u6210 hexo \u7684\u6587\u7ae0\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">npm install hexo-migrator-wordpress --save\r\nhexo migrate wordpress WordPress.xml --paragraph-fix --import-image --skipduplicate\r\n<\/pre>\n<p>\u5bfc\u5165\u5b8c\u540e\u5176\u5b9e\u8fd8\u662f\u8981\u68c0\u67e5\u4e0b\u3002\u6bd4\u5982\u6709\u4e9b\u6587\u7ae0\u7684\u56fe\u7247\u94fe\u63a5\u6ca1\u6709\u8bc6\u522b\u51fa\u6765\uff0c\u53d8\u6210 markdown \u540e\u8fd8\u662f\u6307\u5411\u539f\u7ad9\uff0c\u5c31\u8981\u67e5\u627e\u66ff\u6362\u6210\u65b0\u7ad9\u7684\u56fe\u7247\u76ee\u5f55\u3002\u5bfc\u5165\u540e\u7684\u56fe\u7247\u662f\u6563\u843d\u5728 source \u76ee\u5f55\u4e0b\u7684\uff0c\u628a\u56fe\u7247\u5f52\u7c7b\u4e4b\u540e\u53c8\u8981\u6279\u91cf\u66ff\u6362\u6389 .md \u91cc\u7684\u6240\u6709\u94fe\u63a5\u3002<\/p>\n<p>\u4ee3\u7801\u5757\u4e5f\u8981\u4fee\u590d\uff0c\u8fd8\u597d\u662f<a href=\"https:\/\/hexo.io\/docs\/syntax-highlight#Configuration\" target=\"_blank\" rel=\"nofollow noopener\">\u539f\u751f\u652f\u6301<\/a>\u7684\uff0c\u628a\u6807\u7b7e\u66ff\u6362\u6210 {% code lang:php %} &#8230; {% endcode %} \u5c31\u597d\u4e86\u3002<\/p>\n<p>\u7528 migrator \u5bfc\u5165\u8fdb\u6765\u6709\u4e2a\u95ee\u9898\uff0cwp \u91cc\u4ee3\u7801\u5757\u7684\u6362\u884c\u5168\u6d88\u5931\u4e0d\u751f\u6548\u4e86\uff0c\u5e94\u8be5\u662f\u6ca1\u5904\u7406\u6362\u884c\u7b26\u3002\u6240\u4ee5\u526f\u7ad9\u73b0\u5728\u7684\u4ee3\u7801\u5757\u8fd8\u662f\u4e00\u7247\u72fc\u85c9\u3002\u4e0d\u77e5\u9053\u662f\u4e0d\u662f\u6211\u5bfc\u5165\u65f6\u6709\u4ec0\u4e48\u53c2\u6570\u6ca1\u6307\u5b9a\u597d\uff0c\u6709\u673a\u4f1a\u518d\u641e\u5427\u3002<\/p>\n<p>\u8fd8\u6709 post \u7684\u56fa\u5b9a\u94fe\u63a5\uff0c\u5bfc\u5165\u540e\u662f\u4ee5\u6587\u7ae0\u540d\u4e3a\u6c38\u4e45\u94fe\u63a5\u7684\uff0c\u5730\u5740\u680f\u91cc\u4e00\u5806 %XX \u770b\u5f97\u6211\u5934\u75bc\u3002\u89c2\u5bdf\u5230\u5bfc\u5165\u7684 .md \u6587\u4ef6\u4e2d\u542b\u6709 wp \u7684 id\uff0c\u6bd4\u5982\u6587\u4ef6\u5f00\u5934\u5c31\u6709\u6587\u7ae0\u5143\u6570\u636e<q>id: &#8216;2329&#8217;<\/q>\uff0c\u4e8e\u662f\u5230 hexo \u7684\u914d\u7f6e\u6587\u4ef6 _config.yml \u91cc\u627e\u5230 permalink \u6539\u6389\u5c31\u597d <q>permalink: :id\/<\/q>\u3002<\/p>\n<p>\u603b\u4e4b\u5c31\u662f\u8fd9\u6837\uff0c\u4e00\u70b9\u70b9\u4fee\u6539\u6587\u7ae0\u7684\u6570\u636e\u548c\u5206\u7c7b\uff0c\u8ba9\u5b83\u5c3d\u91cf\u8ddf\u539f\u6765\u4e00\u6837\u3002<\/p>\n<h3>\u5176\u4ed6<\/h3>\n<p>\u4e3b\u9898\u5c31\u9009\u7528\u4e86 Next\u3002\u6682\u65f6\u6ca1\u6709\u592a\u591a\u9700\u6c42\uff0c\u5c31\u5148\u7528\u7740\u4e86\u3002<\/p>\n<p>\u81f3\u4e8e\u8bc4\u8bba\uff0c\u73b0\u5728\u535a\u5ba2\u91cc\u7684\u8bc4\u8bba\u5176\u5b9e\u633a\u5c11\u3002\u800c\u4e14\u53ea\u662f\u5efa\u4e00\u4e2a\u5907\u4efd\u7ad9\uff0c\u5e76\u4e0d\u662f\u5b8c\u5168\u8fc1\u79fb\uff0c\u6240\u4ee5\u8bc4\u8bba\u5c31\u5148\u4e0d\u5904\u7406\u4e86\u3002\u7b49\u5230\u54ea\u4e00\u5929\u4e3b\u7ad9\u4e5f\u4e0d\u7528 wp \u65f6\u518d\u4e00\u5757\u8f6c\u79fb\u5427\u3002<\/p>\n<p>\u6709\u4e00\u4e24\u7bc7\u6587\u7ae0\u91cc\u7528\u4e86\u6570\u5b66\u516c\u5f0f\uff0c\u8fd9\u4e2a\u6682\u65f6\u4e5f\u6ca1\u641e\uff0c\u4f3c\u4e4e\u53ef\u4ee5\u7528 hexo-renderer-pandoc \u8fd9\u4e2a\u63d2\u4ef6\u3002<\/p>\n<p>\u6700\u540e\u518d\u5904\u7406\u4e00\u4e0b SEO\uff0c\u56e0\u4e3a\u73b0\u5728\u539f\u7ad9\u548c\u526f\u7ad9\u540c\u65f6\u8fd0\u884c\u4e86\uff0c\u641c\u7d22\u5f15\u64ce\u68c0\u67e5\u5230\u91cd\u590d\u5185\u5bb9\u53ef\u80fd\u4f1a\u964d\u6743\u4e4b\u7c7b\u4e71\u4e03\u516b\u69fd\u7684\uff0c\u6240\u4ee5\u6253\u7b97\u628a\u526f\u7ad9\u7981\u7528\u722c\u866b\u3002<br \/>\n\u4e00\u5f00\u59cb\u6211\u662f\u6dfb\u52a0\u4e86 canonical \u89c4\u8303\uff0c\u628a\u526f\u7ad9\u7684\u9875\u9762\u5c3d\u53ef\u80fd\u5bf9\u5e94\u5230\u539f\u7ad9\u9875\u9762\uff0c\u6587\u7ae0\u81ea\u4e0d\u5fc5\u8bf4\uff0c\u8fd8\u6709\u5206\u7c7b\u76ee\u5f55\u3001tags \u548c\u5206\u9875\u9875\u9762\uff0c\u90fd\u52a0\u4e0a\u4e86\u539f\u7ad9\u5730\u5740\u3002\u8fd9\u91cc\u8fd8\u8981\u5410\u69fd\u4e0b\uff0chexo \u6dfb\u52a0\u7684 canonical \u5730\u5740\u57df\u540d\u4f3c\u4e4e\u53ea\u80fd\u662f\u526f\u7ad9\u7684\u5730\u5740\uff08\u5373 <q>_config.yml<\/q> \u91cc\u7684 <q>url:<\/q> \uff09\uff0c\u5bfc\u81f4\u6211\u4e0d\u5f97\u4e0d\u518d\u641e\u4e2a\u811a\u672c\u66ff\u6362\u57df\u540d\u548c\u4e00\u4e9b url path \u4e0a\u7684\u5dee\u5f02\u3002<\/p>\n<p>\u7136\u540e\u53c8\u62c5\u5fc3\u53ea\u8bbe\u7f6e canonical \u4f1a\u4e0d\u4f1a\u6709\u610f\u5916\u72b6\u51b5\u5bfc\u81f4\u526f\u7ad9\u4ecd\u7136\u88ab\u7d22\u5f15\uff0c\u4e07\u4e00\u641c\u7d22\u5f15\u64ce\u4e0d\u8bb2\u6b66\u5fb7\u5462\u3002\u8981\u662f\u4e24\u4e2a\u9875\u9762\u540c\u65f6\u51fa\u73b0\u90a3\u4e5f\u633a\u5934\u75bc\u3002\u6240\u4ee5\u6700\u540e\u53c8\u6253\u7b97\u52a0\u4e0a noindex \u548c robots.txt \u9650\u5236\u3002<br \/>\nrobots.txt \u91cc\u8bbe\u7f6e Disallow\u3002\u7136\u540e\u6240\u6709 html \u9875\u9762\u7684 head \u91cc\u90fd\u52a0\u4e0a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow, noarchive, nosnippet, noimageindex&quot;&gt;\r\n<\/pre>\n<p>\u5230\u8fd9\u91cc\u5c31\u7b97\u5dee\u4e0d\u591a\u642d\u5b8c\u4e86\uff0cpush \u5230 github \u4e0a<a href=\"https:\/\/kerisa.github.io\/\" target=\"_blank\" rel=\"nofollow noopener\">\u770b\u770b\u6548\u679c<\/a>\u3002<\/p>\n<p>\u526f\u7ad9\u7684\u7f51\u5740\u4e5f\u5df2\u7ecf\u6dfb\u52a0\u5230\u7f51\u7ad9\u5e95\u90e8\u4e86\ud83d\udc47<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VPS \u9700\u8981\u5b9a\u671f\u7eed\u8d39\uff0c\u57df\u540d\u4e5f\u662f\uff0c\u4e07\u4e00\u6211\u54ea\u5929\u560e\u4e86\uff0c\u57df\u540d\u8fc7\u671f\u4e3b\u673a\u6b20\u8d39\uff0c\u6211\u7684\u535a\u5ba2\u4e5f\u5c31\u9500\u58f0\u533f\u8ff9\u4e86\u3002\u6211\u5e0c\u671b\u5b83\u80fd\u6d3b\u5f97\u4e45\u4e00\u70b9&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/flandre-scarlet.moe\/blog\/2329\/\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85],"tags":[272,270,269,271,96],"class_list":["post-2329","post","type-post","status-publish","format-standard","hentry","category-programs","tag-canonical","tag-github-pages","tag-hexo","tag-noindex","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/2329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/comments?post=2329"}],"version-history":[{"count":8,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/2329\/revisions"}],"predecessor-version":[{"id":2337,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/posts\/2329\/revisions\/2337"}],"wp:attachment":[{"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/media?parent=2329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/categories?post=2329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flandre-scarlet.moe\/blog\/wp-json\/wp\/v2\/tags?post=2329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}