{"id":2187,"date":"2015-11-30T20:16:57","date_gmt":"2015-11-30T12:16:57","guid":{"rendered":"http:\/\/armvs.com\/?p=42"},"modified":"2015-11-30T20:16:57","modified_gmt":"2015-11-30T12:16:57","slug":"%e4%bd%bf%e7%94%a8-github-jekyll-%e6%89%93%e9%80%a0%e8%87%aa%e5%b7%b1%e7%9a%84%e7%8b%ac%e7%ab%8b%e5%8d%9a%e5%ae%a2-%e7%a8%8b%e5%ba%8f%e7%8c%bf%e7%9a%84fecebook","status":"publish","type":"post","link":"https:\/\/acevs.com\/2187\/","title":{"rendered":"\u4f7f\u7528 GitHub, Jekyll \u6253\u9020\u81ea\u5df1\u7684\u72ec\u7acb\u535a\u5ba2 \u7a0b\u5e8f\u733f\u7684fecebook"},"content":{"rendered":"<h1>\u4f7f\u7528 GitHub, Jekyll \u6253\u9020\u81ea\u5df1\u7684\u72ec\u7acb\u535a\u5ba2<\/h1>\n<div class=\"article_meta\">\n<div><span class=\"timestamp\">\u8f6c\u8f7d\u81ea\u00a0<\/span><span class=\"from\"><i class=\"icon-globe\"><\/i> <a class=\"cut cut28 from\" href=\"http:\/\/www.tuicool.com\/sites\/vQZRB3\" target=\"_blank\" rel=\"noopener noreferrer\">CSDN\u535a\u5ba2<\/a><\/span><\/div>\n<div class=\"source\"><\/div>\n<\/div>\n<div id=\"nei\" class=\"article_body\">\n<div>\n<h2>\u4f7f\u7528 GitHub, Jekyll \u6253\u9020\u81ea\u5df1\u7684\u72ec\u7acb\u535a\u5ba2<\/h2>\n<p><a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">GitHub<\/a> \u662f\u4e00\u4e2a\u4ee3\u7801\u6258\u7ba1\u7f51\u7ad9\uff0c\u73b0\u5728\u5f88\u591a\u5f00\u6e90\u9879\u76ee\u90fd\u653e\u5728GitHub\u4e0a\u3002 \u5229\u7528GitHub\uff0c\u53ef\u4ee5\u8ba9\u5168\u7403\u5404\u5730\u7684\u7a0b\u5e8f\u5458\u4eec\u4e00\u8d77\u534f\u4f5c\u5f00\u53d1\u3002GitHub \u63d0\u4f9b\u4e86\u4e00\u79cd\u529f\u80fd\uff0c\u53eb\u00a0 <a href=\"https:\/\/help.github.com\/categories\/20\/articles\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">GitHub Pages<\/a> , \u5229\u7528\u8fd9\u4e2a\u529f\u80fd\uff0c\u6211 \u4eec\u53ef\u4ee5\u4e3a\u9879\u76ee\u5efa\u7acb\u7f51\u7ad9\uff0c\u5f53\u7136\uff0c\u8fd9\u4e5f\u610f\u5473\u7740\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 GitHub Pages \u5efa\u7acb\u81ea\u5df1\u7684\u7f51\u7ad9\u3002<\/p>\n<p><a href=\"http:\/\/jekyllrb.com\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">Jekyll<\/a> \u662f\u4e00\u4e2a\u7b80\u5355\u7684\uff0c\u9488\u5bf9\u535a\u5ba2\u8bbe\u8ba1\u7684\u9759\u6001\u7f51\u7ad9\u751f\u6210\u5668\u3002\u4f7f\u7528 GitHub \u548c Jekyll\uff0c\u6211\u4eec\u53ef\u4ee5\u6253\u9020\u81ea\u5df1\u7684\u72ec\u7acb\u535a\u5ba2\uff0c\u4f60\u53ef\u4ee5\u81ea\u7531\u5730\u5b9a\u5236\u7f51\u7ad9\u7684\u98ce\u683c\uff0c\u5e76\u4e14\u8fd9 \u4e00\u5207\u90fd\u662f\u514d\u8d39\u7684\u3002<\/p>\n<p>\u8fd9\u662f\u6211\u5728GitHub\u4e0a\u81ea\u5df1\u5efa\u7acb\u7684 <a href=\"http:\/\/minixalpha.github.io\/StrayBirds\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">\u535a\u5ba2<\/a> \u00a0\u53ca <a href=\"https:\/\/github.com\/minixalpha\/StrayBirds\/tree\/master\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">\u6e90\u4ee3\u7801<\/a> \u00a0\uff08\u4e24\u4e2a\u5206\u652f\uff09\uff0c\u5728\u4e0b\u6587\u7684\u8bb2\u89e3\u4e2d\uff0c\u4f60\u53ef\u4ee5\u968f\u65f6\u67e5\u770b\u535a\u5ba2\u7684\u6e90\u4ee3\u7801\uff0c\u4ee5\u4fbf\u6709\u76f4\u89c2\u7684\u8ba4\u8bc6\u3002<\/p>\n<p>\u7f51\u7ad9\u622a\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img2.tuicool.com\/vimaI3F.jpg\" alt=\"\" \/><\/p>\n<p>GitHub Pages \u7684\u00a0 <a href=\"http:\/\/pages.github.com\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">\u4e3b\u9875<\/a> \u00a0\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u5165\u95e8\u6307\u5f15\uff0c\u9605\u8bfb\u5e76 \u64cd\u4f5c\u4e00\u4e0b\uff0c\u4f1a\u6709\u4e00\u4e2a\u76f4\u89c2\u7b80\u5355\u7684\u8ba4\u8bc6\u3002<\/p>\n<p>\u962e\u4e00\u5cf0\u7684\u6587\u7ae0\u300a <a href=\"http:\/\/www.ruanyifeng.com\/blog\/2012\/08\/blogging_with_jekyll.html\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">\u642d\u5efa\u4e00\u4e2a\u514d\u8d39\u7684\uff0c\u65e0\u9650\u6d41\u91cf\u7684Blog----github Pages\u548cJekyll\u5165\u95e8<\/a>\u300b\u662f\u4f7f\u7528 GitHub \u548c Jekyll \u642d\u5efa\u72ec\u7acb\u535a\u5ba2\u975e\u5e38\u597d\u7684\u5165\u95e8\u6587\u7ae0\uff0c \u5f3a\u70c8\u5efa\u8bae\u5148\u9605\u8bfb\u5e76\u64cd\u4f5c\u4e00\u904d \u3002<\/p>\n<p>\u5728\u5b66\u4e60\u5b8c\u962e\u4e00\u5cf0\u540c\u5b66\u7684\u6587\u7ae0\u540e\uff0c\u4f60\u5c31\u5df2\u7ecf\u6709\u80fd\u529b\u642d\u5efa\u81ea\u5df1\u7684\u72ec\u7acb\u535a\u5ba2\u4e86\uff0c\u4f46\u662f\u8fd9\u4e2a\u535a\u5ba2 \u53ea\u6709\u6700\u57fa\u672c\u7684\u529f\u80fd\uff0c\u5e76\u4e14\u4e5f\u4e0d\u597d\u770b\u3002\u8fd9\u65f6\u5019\uff0c\u4f60\u9762\u4e34\u51e0\u4e2a\u9009\u62e9:<\/p>\n<ol>\n<li>\u5b8c\u5168\u81ea\u5df1\u5b9a\u5236\u535a\u5ba2<\/li>\n<li>\u627e\u4e00\u4efd\u6846\u67b6\uff0c\u4fee\u6539\u540e\u4f7f\u7528<\/li>\n<li>\u4eceGitHub\u4e0afork\u522b\u4eba\u7684\u535a\u5ba2\u4ee3\u7801\uff0c\u5728\u5176\u4e2d\u6dfb\u52a0\u81ea\u5df1\u7684\u6587\u7ae0<\/li>\n<\/ol>\n<p>\u5982\u679c\u9009\u62e9 2, \u90a3\u4e48\u00a0 <a href=\"http:\/\/jekyllbootstrap.com\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">jekyll-bootstrap<\/a> \u662f\u4e00\u4e2a\u9009\u62e9\u3002 \u5982\u679c\u9009\u62e9 3, \u90a3\u4e48\u81ea\u5df1Google\u4e00\u4e0b\u00a0 <code class=\"prettyprint\">github.io \u535a\u5ba2<\/code> \u00a0\u80fd\u627e\u5230\u4e0d\u5c11\u535a\u5ba2,\u53bbfork,\u7136\u540e\u4fee\u6539\u4e00\u4e0b\u5c31\u597d\u3002 \u5982\u679c\u9009\u62e9 1, \u90a3\u4e48\u53ef\u4ee5\u597d\u597d\u770b\u770b\u540e\u6587\u7684\u5185\u5bb9\u3002<\/p>\n<h2><\/h2>\n<ul>\n<li>\u673a\u5236\u4e00 \u7b80\u5355\u5730\u8bf4\uff0c\u4f60\u5728 GitHub \u4e0a\u6709\u4e00\u4e2a\u8d26\u53f7\uff0c\u540d\u4e3a <code class=\"prettyprint\">username<\/code> (\u4efb\u610f)\uff0c \u6709\u4e00\u4e2a\u9879\u76ee\uff0c\u540d\u4e3a\u00a0 <code class=\"prettyprint\">username.github.io<\/code> (\u56fa\u5b9a\u683c\u5f0f\uff0cusername\u4e0e\u8d26\u53f7\u540d\u4e00\u81f4)\uff0c \u9879\u76ee\u5206\u652f\u540d\u4e3a\u00a0 <code class=\"prettyprint\">master<\/code> (\u56fa\u5b9a)\uff0c\u8fd9\u4e2a\u5206\u652f\u6709\u7740\u7c7b\u4f3c\u4e0b\u9762\u7684 \u76ee\u5f55\u7ed3\u6784:<\/li>\n<\/ul>\n<pre class=\"prettyprint perl\"><code>.\n\u251c\u2500\u2500 <span class=\"keyword\">index<\/span>.html\n\u251c\u2500\u2500 _config.yml\n\u251c\u2500\u2500 assets\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 blog-images\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 css\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fonts\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 images\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 javascripts\n\u251c\u2500\u2500 _includes\n\u251c\u2500\u2500 _layouts\n\u251c\u2500\u2500 _plugins\n\u251c\u2500\u2500 _posts\n\u2514\u2500\u2500 _site\n<\/code><\/pre>\n<p>\u8fd9\u6837\uff0c\u5f53\u4f60\u8bbf\u95ee\u00a0 <code class=\"prettyprint\">http:\/\/username.github.io\/<\/code> \u65f6\uff0cGitHub \u4f1a\u4f7f\u7528 Jekyll \u89e3\u6790 \u7528\u6237\u00a0 <code class=\"prettyprint\">username<\/code> \u540d\u4e0b\u7684 <code class=\"prettyprint\">username.github.io<\/code> \u9879\u76ee\u4e2d\uff0c\u5206\u652f\u4e3a <code class=\"prettyprint\">master<\/code> \u00a0\u7684\u6e90\u4ee3\u7801\uff0c\u4e3a\u4f60\u6784\u5efa\u4e00\u4e2a\u9759\u6001\u7f51\u7ad9\uff0c\u5e76\u5c06\u751f\u6210\u7684\u00a0 <code class=\"prettyprint\">index.html<\/code> \u00a0\u5c55\u793a\u7ed9\u4f60\u3002<\/p>\n<p>\u5173\u4e8e\u8fd9\u4e2a\u76ee\u5f55\u66f4\u591a\u7684\u5185\u5bb9\uff0c\u6211\u4eec\u8fd8\u4e0d\u9700\u8981\u5173\u5fc3\uff0c\u5982\u679c\u4f60\u597d\u5947\u5fc3\u6bd4\u8f83\u91cd\uff0c\u53ef\u4ee5\u5148\u770b \u540e\u6587 <code class=\"prettyprint\">\u6e90\u4ee3\u7801<\/code> \u4e00\u8282\u3002<\/p>\n<p>\u770b\u5b8c\u4e0a\u9762\u7684\u89e3\u91ca\uff0c\u4f60\u53ef\u80fd\u4f1a\u6709\u4e00\u4e9b\u7591\u95ee\uff0c\u56e0\u4e3a\u6309\u7167\u4e0a\u9762\u7684\u8bf4\u6cd5\uff0c\u4e00\u4e2a\u7528\u6237\u53ea\u80fd\u6709\u4e00\u4e2a \u7f51\u7ad9\uff0c\u90a3\u6211\u6709\u5f88\u591a\u9879\u76ee\uff0c\u6bcf\u4e2a\u9879\u76ee\u90fd\u9700\u8981\u4e00\u4e2a\u9879\u76ee\u7f51\u7ad9\uff0c\u8be5\u600e\u4e48\u529e\u5462\uff1f\u53e6\u5916\uff0c\u5728\u962e\u4e00\u5cf0 \u540c\u5b66\u7684\u6587\u7ae0\u4e2d\uff0c\u7279\u522b\u63d0\u5230\uff0c\u5206\u652f\u540d\u5e94\u8be5\u4e3a\u00a0 <code class=\"prettyprint\">gh-pages<\/code> \uff0c\u8fd9\u53c8\u662f\u600e\u4e48\u56de\u4e8b\u5462\uff1f<\/p>\n<p>\u539f\u6765\uff0cGitHub\u8ba4\u4e3a\uff0c\u4e00\u4e2aGitHub\u8d26\u53f7\u5bf9\u5e94\u4e00\u4e2a\u7528\u6237\u6216\u8005\u4e00\u4e2a\u7ec4\u7ec7\uff0cGitHub\u4f1a \u7ed9\u8fd9\u4e2a\u7528\u6237\u5206\u914d\u4e00\u4e2a\u57df\u540d\uff1a <code class=\"prettyprint\">username.github.io<\/code> \uff0c\u5f53\u7528\u6237\u8bbf\u95ee\u8fd9\u4e2a\u57df\u540d\u65f6\uff0c GitHub\u4f1a\u53bb\u89e3\u6790 <code class=\"prettyprint\">username<\/code> \u7528\u6237\u4e0b\uff0c <code class=\"prettyprint\">username.github.io<\/code> \u9879\u76ee\u7684 <code class=\"prettyprint\">master<\/code> \u5206\u652f\uff0c \u8fd9\u4e0e\u6211\u4eec\u4e4b\u524d\u7684\u63cf\u8ff0\u4e00\u81f4\u3002<br \/>\n\u53e6\u5916\uff0cGitHub\u8fd8\u4e3a\u6bcf\u4e2a\u9879\u76ee\u63d0\u4f9b\u4e86\u57df\u540d\uff0c\u4f8b\u5982\uff0c\u4f60\u6709\u4e00\u4e2a\u9879\u76ee\u540d\u4e3a <code class=\"prettyprint\">blog<\/code> \uff0c GitHub\u4e3a\u8fd9\u4e2a\u9879\u76ee\u63d0\u4f9b\u7684\u57df\u540d\u4e3a <code class=\"prettyprint\">username.github.io\/blog<\/code> \uff0c \u5f53\u4f60\u8bbf\u95ee\u8fd9\u4e2a\u57df\u540d\u65f6\uff0cGitHub\u4f1a\u53bb\u89e3\u6790 <code class=\"prettyprint\">username<\/code> \u7528\u6237\u4e0b\uff0c <code class=\"prettyprint\">blog<\/code> \u9879\u76ee\u7684 <code class=\"prettyprint\">gh-pages<\/code> \u00a0\u5206\u652f\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u8981\u642d\u5efa\u81ea\u5df1\u7684\u535a\u5ba2\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u5efa\u7acb\u540d\u4e3a\u00a0 <code class=\"prettyprint\">username.github.io<\/code> \u7684\u9879\u76ee\uff0c \u5728 <code class=\"prettyprint\">master<\/code> \u5206\u652f\u4e0b\u5b58\u653e\u7f51\u7ad9\u6e90\u4ee3\u7801\uff0c\u4e5f\u53ef\u4ee5\u9009\u62e9\u5efa\u7acb\u540d\u4e3a\u00a0 <code class=\"prettyprint\">blog<\/code> \u00a0\u7684\u9879\u76ee\uff0c\u5728\u00a0 <code class=\"prettyprint\">gh-pages<\/code> \u5206\u652f\u4e0b\u5b58\u653e\u7f51\u7ad9\u6e90\u4ee3\u7801\u3002<\/p>\n<p>GitHub \u7684 Help \u6587\u6863\u4e2d\u7684\u00a0 <a href=\"https:\/\/help.github.com\/articles\/user-organization-and-project-pages\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">User, Organization and Project Pages<\/a> \u5bf9\u6b64\u6709 \u8be6\u7ec6\u7684\u63cf\u8ff0\u3002<\/p>\n<ul>\n<li>\u673a\u5236\u4e8c<\/li>\n<\/ul>\n<p>Jekyll \u63d0\u4f9b\u4e86\u63d2\u4ef6\u529f\u80fd\uff0c\u5728\u7f51\u7ad9\u6e90\u4ee3\u7801\u76ee\u5f55\u4e0b\uff0c\u6709\u4e00\u4e2a\u540d\u4e3a\u00a0 <code class=\"prettyprint\">_plugins<\/code> \u7684\u76ee\u5f55\uff0c \u4f60\u53ef\u4ee5\u5c06\u4e00\u4e9b\u63d2\u4ef6\u653e\u8fdb\u53bb\uff0c\u8fd9\u6837\uff0cJekyll\u5728\u89e3\u6790\u7f51\u7ad9\u6e90\u4ee3\u7801\u65f6\uff0c\u5c31\u4f1a\u8fd0\u884c\u4f60\u7684\u63d2\u4ef6\uff0c \u8fd9\u6837\u63d2\u4ef6\u662f Ruby \u5199\u6210\u7684\u3002\u53ef\u4ee5\u4e3aJekyll\u6dfb\u52a0\u529f\u80fd\uff0c\u4f8b\u5982\uff0cJekyll\u9ed8\u8ba4\u662f\u4e0d\u63d0\u4f9b\u5206\u7c7b \u9875\u9762\u7684\uff0c\u4f60\u53ef\u4ee5\u5199\u4e00\u4e2a\u63d2\u4ef6\uff0c\u6839\u636e\u6587\u7ae0\u5185\u5bb9\u751f\u6210\u5206\u7c7b\u9875\u9762\u3002\u5982\u679c\u6ca1\u6709\u63d2\u4ef6\uff0c\u4f60\u53ea\u80fd\u6bcf \u6b21\u5199\u6587\u7ae0\uff0c\u6dfb\u52a0\u5206\u7c7b\u65f6\uff0c\u4e3a\u6bcf\u4e2a\u5206\u7c7b\u624b\u52a8\u5199 HTML \u9875\u9762\u3002<\/p>\n<p>\u5728\u672c\u5730\u8fd0\u884c Jekyll \u65f6\uff0c\u8fd9\u4e9b\u63d2\u4ef6\u4f1a\u81ea\u52a8\u88ab\u8c03\u7528\uff0c\u4f46\u662fGitHub\u5728\u89e3\u6790\u7f51\u7ad9\u6e90\u4ee3\u7801\u65f6\uff0c \u51fa\u4e8e\u5b89\u5168\u8003\u8651\uff0c\u4f1a\u5f00\u542f\u5b89\u5168\u6a21\u5f0f\uff0c\u7981\u7528\u8fd9\u4e9b\u63d2\u4ef6\u3002\u6211\u4eec\u65e2\u60f3\u7528\u8fd9\u4e9b\u63d2\u4ef6\uff0c\u53c8\u60f3\u7528 GitHub\uff0c\u600e\u4e48\u529e\u5462\u600e\u4e48\u529e\u5462\uff1f<\/p>\n<p>GitHub\u8fd8\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u66f4\u4e00\u79cd\u89e3\u6790\u7f51\u7ad9\u7684\u65b9\u5f0f\uff0c\u90a3\u5c31\u662f\u76f4\u63a5\u4e0a\u4f20\u6700\u7ec8\u7684\u9759\u6001\u7f51\u9875\uff0c \u8fd9\u6837\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u672c\u5730\u4f7f\u7528 Jeklly \u628a\u7f51\u7ad9\u89e3\u6790\u51fa\u6765\uff0c\u7136\u540e\u518d\u4e0a\u4f20\u5230 GitHub\u4e0a\uff0c \u8fd9\u5c31\u4f7f\u5f97\u6211\u4eec\u65e2\u4f7f\u7528\u4e86\u63d2\u4ef6\uff0c\u53c8\u4f7f\u7528\u4e86 GitHub\u3002\u5728\u4e0a\u6587\u7684\u76ee\u5f55\u7ed3\u6784\u4e2d\uff0c\u6709\u4e00\u4e2a \u540d\u4e3a\u00a0 <code class=\"prettyprint\">_site<\/code>\u00a0\u7684\u76ee\u5f55\uff0c\u8fd9\u4e2a\u5c31\u662fJeklly\u5728\u672c\u5730\u89e3\u6790\u65f6\u6700\u7ec8\u751f\u6210\u7684\u9759\u6001\u7f51\u7ad9\uff0c\u6211\u4eec \u628a\u5176\u4e2d\u7684\u5185\u5bb9\u4e0a\u4f20\u5230 GitHub \u7684\u9879\u76ee\u4e2d\u5c31\u53ef\u4ee5\u4e86\u3002\u4f8b\u5982\uff0c\u6211\u5728GitHub\u4e0a\u7684\u7f51\u7ad9\uff0c \u65e2\u89e3\u6790\u540e\u7684\u00a0 <code class=\"prettyprint\">_site<\/code> \u00a0\u76ee\u5f55\uff0c\u5927\u6982\u662f\u8fd9\u6837\u7684:<\/p>\n<pre class=\"prettyprint perl\"><code>.\n\n\u251c\u2500\u2500 <span class=\"keyword\">index<\/span>.html\n\u251c\u2500\u2500 <span class=\"number\">2013<\/span>\n\u251c\u2500\u2500 <span class=\"number\">2014<\/span>\n\u251c\u2500\u2500 assets\n\u251c\u2500\u2500 categories\n\u251c\u2500\u2500 page2\n\u251c\u2500\u2500 page3\n\u251c\u2500\u2500 page4\n\u251c\u2500\u2500 \u5de5\u5177\n\u251c\u2500\u2500 \u601d\u60f3\n\u251c\u2500\u2500 \u6280\u672f\n\u2514\u2500\u2500 \u6e90\u4ee3\u7801\u9605\u8bfb\n<\/code><\/pre>\n<p>\u5176\u4e2d\u7684\u00a0 <code class=\"prettyprint\">categories<\/code> \uff0c <code class=\"prettyprint\">2013<\/code> ,\u00a0 <code class=\"prettyprint\">2014<\/code> \u00a0\u76ee\u5f55\u5c31\u662f\u5206\u7c7b\u63d2\u4ef6\u548c\u5f52\u6863\u63d2\u4ef6\u5e2e\u52a9\u6211\u751f\u6210\u7684\uff0c \u6211\u53ea\u8981\u628a\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u7684\u5185\u5bb9\u4e0a\u4f20\u5230 GitHub \u76f8\u5e94\u7684\u9879\u76ee\u5206\u652f\u4e2d\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u6837\uff0c\u4f60 \u8bbf\u95ee\u00a0 <code class=\"prettyprint\">username.github.io<\/code> \u65f6\uff0cGitHub\u5c31\u4e0d\u89e3\u6790\u4e86\uff0c\u76f4\u63a5\u628a <code class=\"prettyprint\">index.html<\/code> \u8fd4\u56de\u7ed9\u4f60\u4e86\u3002<\/p>\n<p>\u5173\u4e8e git \u548c jekyll \u7684\u5b89\u88c5\u4e0e\u57fa\u672c\u4f7f\u7528\uff0c\u8fd9\u91cc\u5c31\u4e0d\u591a\u8bf4\u4e86\u3002<\/p>\n<ul>\n<li>\u5de5\u4f5c\u6d41\u4e00<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u4e0d\u4f7f\u7528\u63d2\u4ef6\uff0c\u90a3\u4e48\u53ea\u9700\u8981\u7ef4\u62a4\u4e00\u4e2a\u5206\u652f\u5c31\u597d:<\/p>\n<pre class=\"prettyprint diff\"><code><span class=\"deletion\">- username\/username.github.io \u7684 master \u5206\u652f<\/span>\n<span class=\"deletion\">- username\/blog \u7684 gh-pages \u5206\u652f<\/span>\n<\/code><\/pre>\n<p>\u5176\u4e2d\u00a0 <code class=\"prettyprint\">username<\/code> \u00a0\u662f\u4f60\u7684 GitHub \u5e10\u53f7\u3002<\/p>\n<p>\u4f60\u9700\u8981\u5728\u672c\u5730\u7ef4\u62a4\u4e00\u4efd\u7f51\u7ad9\u6e90\u4ee3\u7801\uff0c\u6dfb\u52a0\u65b0\u6587\u7ae0\u540e\uff0c\u4f7f\u7528 jekyll \u5728\u672c\u5730\u6d4b\u8bd5\u4e00\u4e0b\uff0c \u6ca1\u6709\u95ee\u9898\u540e\uff0ccommit \u5230 GitHub \u4e0a\u7684\u76f8\u5e94\u5206\u652f\u4e2d\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<ul>\n<li>\u5de5\u4f5c\u6d41\u4e8c<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u9700\u8981\u4f7f\u7528\u63d2\u4ef6\uff0c\u90a3\u4e48\u9700\u8981\u7ef4\u62a4\u4e24\u4e2a\u5206\u652f\uff0c\u4e00\u4e2a\u662f\u7f51\u7ad9\u7684\u6e90\u4ee3\u7801\u5206\u652f\uff0c\u53e6\u4e00\u4e2a \u662f Jeklly \u89e3\u6790\u6e90\u4ee3\u7801\u540e\u751f\u6210\u7684\u9759\u6001\u7f51\u7ad9\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u6211\u7684\u6e90\u4ee3\u7801\u5206\u652f\u540d\u4e3a\u00a0 <code class=\"prettyprint\">master<\/code> \uff0c\u9759\u6001\u7f51\u7ad9\u5206\u652f\u540d\u4e3a\u00a0 <code class=\"prettyprint\">gh-pages<\/code> \u3002\u5e73\u65f6\u5199\u535a\u5ba2\u65f6\uff0c \u9996\u5148\u5728 master \u5206\u652f\u4e0b\uff0c\u6dfb\u52a0\u65b0\u6587\u7ae0\uff0c\u7136\u540e\u672c\u5730\u4f7f\u7528 jekyll build \u5c06\u6dfb\u52a0\u6587\u7ae0\u540e\u7684\u7f51\u7ad9 \u89e3\u6790\u4e00\u6b21\uff0c\u8fd9\u65f6\u00a0 <code class=\"prettyprint\">_site<\/code> \u00a0\u76ee\u5f55\u4e0b\u5c31\u6709\u65b0\u7f51\u7ad9\u7684\u9759\u6001\u4ee3\u7801\u4e86\u3002\u7136\u540e\u628a\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u5185\u5bb9 \u590d\u5236\u5230\u00a0 <code class=\"prettyprint\">gh-pages<\/code> \u00a0\u5206\u652f\u4e0b\u3002\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u53ef\u4ee5\u5199\u4e00\u4e2a Makefile\uff0c\u6bcf\u6b21\u6dfb\u52a0\u6587\u7ae0\u540e make \u4e00\u4e0b\uff0c \u5c31\u81ea\u52a8\u5c06\u6587\u7ae0\u53d1\u5e03\u5230 GitHub \u4e0a\u3002<\/p>\n<p>Makefile \u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre class=\"prettyprint sql\"><code>deploy:\n    git checkout master\n    git add -A\n    git <span class=\"operator\"><span class=\"keyword\">commit<\/span> -m <span class=\"string\">\"deploy blog\"<\/span>\n    cp -r _site\/ \/tmp\/\n    git checkout gh-pages\n    rm -r .\/*\n    cp -r \/tmp\/_site\/* .\/\n    git <span class=\"keyword\">add<\/span> -A\n    git <span class=\"keyword\">commit<\/span> -m <span class=\"string\">\"deploy blog\"<\/span>\n    git push origin gh-pages\n    git checkout master\n    echo <span class=\"string\">\"deploy succeed\"<\/span>\n<\/span><\/code><\/pre>\n<p>\u4e0b\u9762\u7684\u5185\u5bb9\u6d89\u53ca\u6e90\u4ee3\u7801\uff0c\u5982\u679c\u9700\u8981\u8fdb\u4e00\u6b65\u5b66\u4e60\uff0c\u6216\u8005\u6709\u95ee\u9898\uff0c\u53ef\u4ee5\u5728\u00a0 <a href=\"http:\/\/jekyllrb.com\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">Jeklly \u5b98\u7f51<\/a>\u4e0a\u627e\u5230\u66f4\u8be6\u7ec6\u7684\u89e3\u91ca\uff0c\u6216\u8005\u5728\u8bc4\u8bba\u4e2d\u7559\u8a00\u3002<\/p>\n<p>\u518d\u6765\u770b\u4e00\u4e0b\u8fd9\u4e2a\u76ee\u5f55\u7ed3\u6784\uff1a<\/p>\n<pre class=\"prettyprint perl\"><code>.\n\u251c\u2500\u2500 _config.yml\n\u251c\u2500\u2500 <span class=\"keyword\">index<\/span>.html\n\u251c\u2500\u2500 assets\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 blog-images\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 css\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 fonts\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 images\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 javascripts\n\u251c\u2500\u2500 _includes\n\u251c\u2500\u2500 _layouts\n\u251c\u2500\u2500 _plugins\n\u251c\u2500\u2500 _posts\n\u2514\u2500\u2500 _site\n<\/code><\/pre>\n<ul>\n<li>_config.yml<\/li>\n<\/ul>\n<p>\u8fd9\u662f\u9488\u5bf9 Jekyll \u7684 <a href=\"http:\/\/jekyllrb.com\/docs\/configuration\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">\u914d\u7f6e\u6587\u4ef6<\/a> \uff0c \u51b3\u5b9a\u4e86 Jekyll \u5982\u4f55\u89e3\u6790\u7f51\u7ad9\u7684\u6e90\u4ee3\u7801,\u4e0b\u9762\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<pre class=\"prettyprint http\"><code><span class=\"attribute\">baseurl<\/span>: <span class=\"string\">\/StrayBirds<\/span>\n<span class=\"attribute\">markdown<\/span>: <span class=\"string\">redcarpet<\/span>\n<span class=\"attribute\">safe<\/span>: <span class=\"string\">false<\/span>\n<span class=\"attribute\">pygments<\/span>: <span class=\"string\">true<\/span>\n<span class=\"attribute\">excerpt_separator<\/span>: <span class=\"string\">\"\\n\\n\\n\"<\/span>\n<span class=\"attribute\">paginate<\/span>: <span class=\"string\">5<\/span>\n<\/code><\/pre>\n<p>\u6211\u7684\u7f51\u7ad9\u5efa\u7acb\u5728\u00a0 <code class=\"prettyprint\">StrayBirds<\/code> \u00a0\u9879\u76ee\u4e2d\uff0c\u6240\u4ee5\u00a0 <code class=\"prettyprint\">baseurl<\/code> \u00a0\u8bbe\u7f6e\u6210\u00a0 <code class=\"prettyprint\">StrayBirds<\/code> \uff0c \u6211\u7684\u6587\u7ae0\u91c7\u7528 Markdown \u683c\u5f0f\u5199\u6210\uff0c\u53ef\u4ee5\u6307\u5b9a Markdown \u7684\u89e3\u6790\u5668\u00a0 <code class=\"prettyprint\">redcarpet<\/code> \u3002 \u53e6\u5916\uff0c\u5b89\u5168\u6a21\u5f0f\u9700\u8981\u5173\u95ed\uff0c\u4ee5\u4fbf Jekyll \u89e3\u6790\u65f6\u4f1a\u8fd0\u884c\u63d2\u4ef6\u3002\u00a0 <code class=\"prettyprint\">pygments<\/code> \u00a0\u53ef\u4ee5\u4f7f\u5f97Jekyll\u89e3\u6790\u6587\u7ae0\u4e2d\u6e90\u4ee3\u7801\u65f6\u52a0\u5165\u7279\u6b8a\u6807\u8bb0\uff0c\u4f8b\u5982\u6307\u5b9a\u4ee3\u7801\u7c7b\u578b\uff0c \u8fd9\u53ef\u4ee5\u88ab\u5f88\u591a javascript \u4ee3\u7801\u9ad8\u5ea6\u5e93\u4f7f\u7528\u3002\u00a0 <code class=\"prettyprint\">excerpt_separator<\/code> \u00a0\u6307\u5b9a\u4e86\u4e00\u4e2a\u6458\u8981\u5206\u5272\u7b26\u53f7\uff0c\u8fd9\u6837 Jekyll \u53ef\u4ee5\u5728\u89e3\u6790\u6587\u7ae0\u65f6\uff0c \u5c06\u6587\u7ae0\u7684\u63d0\u8981\u63d0\u53d6\u51fa\u6765\u3002 paginate \u6307\u5b9a\u4e86\u4e00\u9875\u6709\u51e0\u7bc7\u6587\u7ae0\uff0c\u9875\u6570\u592a\u591a\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u6587\u7ae0\u5217\u8868\u5206\u9875\uff0c\u6211\u4eec\u5728 \u540e\u6587\u8fd8\u4f1a\u63d0\u5230\u3002<\/p>\n<ul>\n<li>_layouts<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u76ee\u5f55\u5b58\u653e\u7740\u4e00\u4e9b\u7f51\u9875\u6a21\u677f\u6587\u4ef6\uff0c\u4e3a\u7f51\u7ad9\u6240\u6709\u7f51\u9875\u63d0\u4f9b\u4e00\u4e2a\u57fa\u672c\u6a21\u677f\uff0c\u8fd9\u6837 \u6bcf\u4e2a\u7f51\u9875\u53ea\u9700\u8981\u5173\u5fc3\u81ea\u5df1\u7684\u5185\u5bb9\u5c31\u597d\uff0c\u5176\u5b83\u7684\u90fd\u7531\u6a21\u677f\u51b3\u5b9a\u3002\u4f8b\u5982\uff0c\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u7684 default.html \u6587\u4ef6\uff1a<\/p>\n<div>\n<pre class=\"prettyprint xml\">{% raw %}\n<span class=\"cp\"><span class=\"doctype\">&lt;!DOCTYPE html&gt;<\/span><\/span>\n<span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">html<\/span>&gt;<\/span><\/span>\n  <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">head<\/span>&gt;<\/span><\/span>\n    <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">meta<\/span><\/span><\/span><span class=\"tag\"> <span class=\"na\"><span class=\"attribute\">charset<\/span>=<\/span><span class=\"s\"><span class=\"value\">'utf-8'<\/span><\/span><span class=\"nt\">&gt;<\/span><\/span>\n    <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">title<\/span>&gt;<\/span><\/span>{{ page.title }}<span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">title<\/span>&gt;<\/span><\/span>\n  <span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">head<\/span>&gt;<\/span><\/span>\n  <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">body<\/span>&gt;<\/span><\/span>\n    <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">header<\/span>&gt;<\/span><\/span>\n    <span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">header<\/span>&gt;<\/span><\/span>\n\n    <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">aside<\/span>&gt;<\/span><\/span>\n    <span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">aside<\/span>&gt;<\/span><\/span>\n\n    <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">article<\/span>&gt;<\/span><\/span>\n{{ content }}\n    <span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">article<\/span>&gt;<\/span><\/span>\n\n    <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">footer<\/span>&gt;<\/span><\/span>\n    <span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">footer<\/span>&gt;<\/span><\/span>\n  <span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">body<\/span>&gt;<\/span><\/span>\n<span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">html<\/span>&gt;<\/span><\/span>\n{% endraw %}<\/pre>\n<\/div>\n<p>\u53ef\u4ee5\u770b\u51fa\uff0c\u8fd9\u4e2a\u6587\u4ef6\u5c31\u662f\u6240\u6709\u9875\u9762\u5171\u6709\u7684\u4e1c\u897f\uff0c\u6bcf\u4e2a\u9875\u9762\u7684\u5177\u4f53\u5185\u5bb9\u4f1a\u88ab\u586b\u5145\u5728\u00a0<code class=\"prettyprint\">{{ content }}<\/code> \u00a0\u4e2d\uff0c\u6ce8\u610f\u8fd9\u4e2a content \u4e24\u8fb9\u7684\u6807\u8bb0\uff0c\u8fd9\u662f\u4e00\u79cd\u53eb\u00a0 <a href=\"https:\/\/github.com\/Shopify\/liquid\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">liquid<\/a> \u00a0\u7684\u6807\u8bb0\u8bed\u8a00\u3002 \u53e6\u5916\uff0c\u8fd8\u6709\u90a3\u4e2a\u00a0 <code class=\"prettyprint\">{{ page.title }}<\/code> \u00a0\uff0c\u5176\u4e2d\u00a0 <code class=\"prettyprint\">page<\/code> \u00a0\u8868\u793a\u5f15\u7528\u00a0<code class=\"prettyprint\">default.html<\/code> \u7684 \u90a3\u4e2a\u9875\u9762\uff0c\u8fd9\u4e2a\u9875\u9762\u7684\u00a0 <code class=\"prettyprint\">title<\/code> \u00a0\u503c\u4f1a\u5728\u00a0 <code class=\"prettyprint\">page<\/code> \u00a0\u76f8\u5e94\u9875\u9762\u4e2d\u88ab\u8bbe\u7f6e\uff0c\u4f8b\u5982 \u4e0b\u9762\u7684\u00a0 <code class=\"prettyprint\">index.html<\/code> \u00a0\u6587\u4ef6\uff0c\u5f00\u5934\u90e8\u5206\u5c31\u8bbe\u7f6e\u4e86\u00a0 <code class=\"prettyprint\">title<\/code> \u503c\u3002<\/p>\n<ul>\n<li>index.html<\/li>\n<\/ul>\n<p>\u8fd9\u662f\u7f51\u7ad9\u7684\u9996\u9875\uff0c\u8bbf\u95ee\u00a0 <code class=\"prettyprint\">http:\/\/username.github.io<\/code> \u00a0\u65f6\uff0c\u4f1a\u6307\u5411\u00a0<code class=\"prettyprint\">http:\/\/username.github.io\/index.html<\/code> \uff0c\u6211\u4eec\u770b\u4e00\u4e0b\u57fa\u672c\u5185\u5bb9\uff1a<\/p>\n<div>\n<pre class=\"prettyprint xml\">---\nlayout: default\ntitle: \u9996\u9875\n---\n\n{% raw %}\n<span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">ul<\/span><\/span><\/span><span class=\"tag\"> <span class=\"na\"><span class=\"attribute\">class<\/span>=<\/span><span class=\"s\"><span class=\"value\">\"post-list\"<\/span><\/span><span class=\"nt\">&gt;<\/span><\/span>\n    {% for post in site.posts %}\n        <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">a<\/span><\/span><\/span><span class=\"tag\"> <span class=\"na\"><span class=\"attribute\">href<\/span>=<\/span><span class=\"s\"><span class=\"value\">\"{{site.baseurl}}{{post.url}}\"<\/span><\/span><span class=\"nt\">&gt;<\/span><\/span> {{ post.title }}  <span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">a<\/span>&gt;<\/span><\/span> <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">br<\/span>&gt;<\/span><\/span>\n        {{ post.date | date: \"%F\" }} <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">br<\/span>&gt;<\/span><\/span>\n        {{ post.category }} <span class=\"nt\"><span class=\"tag\">&lt;<span class=\"title\">br<\/span>&gt;<\/span><\/span>\n        {{ post.excerpt }} \n    {% endfor %}\n{% endraw %}\n<span class=\"nt\"><span class=\"tag\">&lt;\/<span class=\"title\">ul<\/span>&gt;<\/span><\/span><\/pre>\n<\/div>\n<p>\u6ce8\u610f\uff0c\u6587\u4ef6\u5f00\u5934\u7684\u63cf\u8ff0\uff0c\u6211\u4eec\u79f0\u4e4b\u4e3a\u00a0 <a href=\"http:\/\/jekyllrb.com\/docs\/frontmatter\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">front-matter<\/a> \uff0c \u662f\u5bf9\u5f53\u524d\u6587\u4ef6\u7684\u4e00\u79cd\u63cf\u8ff0\uff0c\u8fd9\u91cc \u8bbe\u7f6e\u7684\u53d8\u91cf\u53ef\u4ee5\u5728\u89e3\u6790\u65f6\u88ab\u5f15\u7528\uff0c\u4f8b\u5982\u8fd9\u91cc\u7684\u00a0 <code class=\"prettyprint\">layout<\/code> \u5c31\u4f1a\u544a\u8bc9 Jekyll, \u751f\u6210\u00a0<code class=\"prettyprint\">index.html<\/code> \u00a0\u6587\u4ef6\u65f6\uff0c\u53bb\u00a0 <code class=\"prettyprint\">_layouts<\/code> \u00a0\u76ee\u5f55\u4e0b\u627e\u00a0 <code class=\"prettyprint\">default.html<\/code> \u00a0\u6587\u4ef6\uff0c\u7136\u540e\u628a\u5f53\u524d\u6587\u4ef6\u89e3\u6790\u540e\uff0c\u6dfb\u52a0\u5230\u00a0 <code class=\"prettyprint\">default.html<\/code> \u00a0\u7684\u00a0 <code class=\"prettyprint\">content<\/code> \u00a0\u90e8\u5206\uff0c\u7ec4\u6210\u6700\u7ec8\u7684\u00a0<code class=\"prettyprint\">index.html<\/code> \u00a0\u6587\u4ef6\u3002\u8fd8\u6709 <code class=\"prettyprint\">title<\/code> \u00a0\u8bbe\u7f6e\u597d\u7684 \u503c\uff0c\u4f1a\u5728\u00a0 <code class=\"prettyprint\">default.html<\/code> \u00a0\u4e2d\u901a\u8fc7\u00a0<code class=\"prettyprint\">page.title<\/code> \u00a0\u88ab\u5f15\u7528\u3002<\/p>\n<p>\u6587\u4ef6\u7684\u4e3b\u4f53\u90e8\u5206\u904d\u5386\u4e86\u7ad9\u70b9\u7684\u6240\u6709\u6587\u7ae0\uff0c\u5e76\u5c06\u4ed6\u4eec\u663e\u793a\u51fa\u6765\uff0c\u8fd9\u4e9b\u8bed\u6cd5\u90fd\u662f\u00a0<code class=\"prettyprint\">liquid<\/code> \u00a0\u8bed\u6cd5\uff0c \u5176\u4e2d\u7684\u53d8\u91cf\uff0c\u4f8b\u5982\u00a0 <code class=\"prettyprint\">site<\/code> , \u7531 Jekyll \u8bbe\u7f6e\u6211\u4eec\u53ea\u9700\u8981\u5f15\u7528\u5c31\u53ef\u4ee5\u4e86\u3002\u800c\u00a0 <code class=\"prettyprint\">post<\/code> \u00a0\u4e2d\u7684\u53d8\u91cf\uff0c \u5982\u00a0 <code class=\"prettyprint\">post.title<\/code> ,\u00a0 <code class=\"prettyprint\">post.category<\/code> \u00a0\u662f\u7531\u00a0 <code class=\"prettyprint\">post<\/code> \u00a0\u6587\u4ef6\u4e2d\u7684 front-matter \u51b3\u5b9a\uff0c\u540e\u9762\u9a6c\u4e0a\u5c31\u4f1a\u770b\u5230\u3002<\/p>\n<ul>\n<li>_posts<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u76ee\u5f55\u5b58\u653e\u6211\u4eec\u7684\u6240\u6709\u535a\u5ba2\u6587\u7ae0\uff0c\u4ed6\u4eec\u7684\u540d\u5b57\u6709\u7edf\u4e00\u7684\u683c\u5f0f\uff1a<\/p>\n<pre class=\"prettyprint undefined\"><code>YEAR-MONTH-DAY-title.MARKUP\n<\/code><\/pre>\n<p>\u4f8b\u5982\uff0c2014-02-15-github-jeklly.md\uff0c\u8fd9\u4e2a\u6587\u4ef6\u540d\u4f1a\u88ab\u89e3\u6790\uff0c\u524d\u9762\u7684\u00a0 <code class=\"prettyprint\">index.html<\/code>\u00a0\u4e2d\uff0c\u00a0 <code class=\"prettyprint\">post.date<\/code> \u00a0\u7684\u503c\u5c31\u7531\u8fd9\u91cc\u6587\u4ef6\u540d\u4e2d\u7684\u65e5\u671f\u800c\u6765\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u770b\u770b\u4e00\u7bc7\u6587\u7ae0\u7684\u5185\u5bb9\u793a\u4f8b\uff1a<\/p>\n<pre class=\"prettyprint cs\"><code>---\nlayout: <span class=\"keyword\">default<\/span>\ntitle: \u4f7f\u7528 Markdown\ncategory: \u5de5\u5177\ncomments: <span class=\"keyword\">true<\/span>\n---\n\n<span class=\"preprocessor\"># \u4e3a\u4ec0\u4e48\u4f7f\u7528 Markdown<\/span>\n\n* \u770b\u4e0a\u53bb\u4e0d\u9519  \n* \u65e2\u7136\u770b\u4e0a\u53bb\u4e0d\u9519\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u8bd5\u8bd5\u5462  \n\n<span class=\"preprocessor\"># \u5982\u4f55\u4f7f\u7528 Markdown<\/span>\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u51fa\uff0c\u6587\u7ae0\u7684 front-matter \u90e8\u5206\u8bbe\u7f6e\u4e86\u591a\u9879\u503c\uff0c\u4ee5\u540e\u53ef\u4ee5\u901a\u8fc7\u7c7b\u4f3c\u00a0<code class=\"prettyprint\">post.title<\/code> ,\u00a0 <code class=\"prettyprint\">post.category<\/code> \u00a0\u7684\u65b9\u5f0f\u5f15\u7528\u8fd9\u4e9b\u4e9b\uff0c\u53e6\u5916\uff0c <code class=\"prettyprint\">layout<\/code> \u90e8\u5206\u7684\u503c\u548c\u4e4b\u524d\u89e3\u91ca\u7684\u4e00\u6837\uff0c \u6587\u4ef6\u7684\u5185\u5bb9\u4f1a\u88ab\u586b\u5145\u5230\u00a0 <code class=\"prettyprint\">_layouts\/default.html<\/code> \u00a0\u6587\u4ef6\u7684\u00a0<code class=\"prettyprint\">content<\/code> \u00a0\u53d8\u91cf\u4e2d\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u6587\u7ae0\u4e2d\u00a0 <code class=\"prettyprint\">\u4e3a\u4ec0\u4e48\u4e0d\u8bd5\u8bd5\u5462<\/code> \u4e4b\u540e\u7684\u6709\u4e09\u4e2a\u4e0d\u53ef\u89c1\u7684\u00a0 <code class=\"prettyprint\">\\n<\/code> \uff0c\u5b83\u51b3\u5b9a\u4e86\u8fd9\u4e09\u4e2a\u00a0<code class=\"prettyprint\">\\n<\/code> \u00a0\u4e4b\u524d\u7684\u5185\u5bb9\u4f1a\u88ab\u653e\u5728\u00a0 <code class=\"prettyprint\">post.excerpt<\/code> \u00a0\u53d8\u91cf\u4e2d\uff0c\u4f9b\u5176\u5b83\u6587\u4ef6\u4f7f\u7528\u3002<\/p>\n<ul>\n<li>_includes<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u4e2d\uff0c\u5b58\u653e\u7740\u4e00\u4e9b\u6a21\u5757\u6587\u4ef6\uff0c\u4f8b\u5982\u00a0 <code class=\"prettyprint\">categories.ext<\/code> \uff0c\u5176\u5b83\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7<\/p>\n<pre class=\"prettyprint perl\"><code>{% raw <span class=\"variable\">%}<\/span>\n{% include categories.ext <span class=\"variable\">%}<\/span>\n{% endraw <span class=\"variable\">%}<\/span>\n<\/code><\/pre>\n<p>\u6765\u5f15\u7528\u8fd9\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u65b9\u4fbf\u4ee3\u7801\u6a21\u5757\u5316\u548c\u91cd\u7528\u3002\u6211\u7684\u535a\u5ba2\u00a0 <a href=\"http:\/\/minixalpha.github.io\/StrayBirds\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">\u4e3b\u9875<\/a> \u4e0a\u7684 \u5206\u7c7b\uff0c\u5f52\u6863\uff0c\u8fd9\u4e9b\u6a21\u5757\u7684\u4ee3\u7801\u90fd\u662f\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u5f15\u7528\u7684\u3002<\/p>\n<ul>\n<li>_plugins<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u5b58\u653e\u4e00\u4e9bRuby\u63d2\u4ef6, \u4f8b\u5982\u00a0 <code class=\"prettyprint\">gen_categories.rb<\/code> \uff0c\u8fd9\u4e9b\u6587\u4ef6\u4f1a\u5728 Jekyll \u89e3\u6790\u7f51\u7ad9\u6e90\u4ee3\u7801\u65f6\u88ab\u6267\u884c\u3002\u4e0b\u4e00\u8282\u8bb2\u8ff0\u7684\u5c31\u662f\u63d2\u4ef6\u3002<\/p>\n<ul>\n<li>_site<\/li>\n<\/ul>\n<p>Jekyll \u89e3\u6790\u6574\u4e2a\u7f51\u7ad9\u6e90\u4ee3\u7801\u540e\uff0c\u4f1a\u5c06\u6700\u7ec8\u7684\u9759\u6001\u7f51\u7ad9\u6e90\u4ee3\u7801\u653e\u5728\u8fd9\u91cc<\/p>\n<p>\u63d2\u4ef6\u4f7f\u7528 Ruby \u5199\u6210\uff0c\u653e\u5728 _plugins \u76ee\u5f55\u4e0b\uff0c\u6709\u4e9b Jekyll \u6ca1\u6709\u7684\u529f\u80fd\uff0c\u53c8\u4e0d\u80fd \u624b\u52a8\u6dfb\u52a0\uff0c\u56e0\u4e3a\u9875\u9762\u7684\u5185\u5bb9\u4f1a\u968f\u7740\u6587\u7ae0\u65e5\u671f\u7c7b\u522b\u7684\u4e0d\u540c\u800c\u4e0d\u540c\uff0c\u4f8b\u5982\u5206\u7c7b\u529f\u80fd\u548c\u5f52\u6863\u529f\u80fd\uff0c \u8fd9\u65f6\uff0c\u5c31\u9700\u8981\u4f7f\u7528\u63d2\u4ef6\u81ea\u52a8\u751f\u6210\u4e00\u4e9b\u9875\u9762\u548c\u76ee\u5f55\u3002<\/p>\n<ul>\n<li>\u5206\u7c7b \u6211\u7684\u5206\u7c7b\u63d2\u4ef6\u4f7f\u7528\u7684\u662f\u00a0 <a href=\"https:\/\/github.com\/shigeya\/jekyll-category-archive-plugin\/tree\/master\/_plugins\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">jekyll-category-archive-plugin<\/a> , \u5b83\u4f1a\u6839\u636e\u7f51\u7ad9\u6587\u7ae0\u7684\u5206\u7c7b\u4fe1\u606f\uff0c\u4e3a\u6bcf\u4e2a\u7c7b\u522b\u751f\u6210\u4e00\u4e2a\u9875\u9762\u3002<\/li>\n<\/ul>\n<p>\u4f7f\u7528\u65b9\u6cd5\u662f\uff0c\u628a\u00a0 plugins\/category archive_plugin.rb \u653e\u5728\u00a0 plugins \u76ee\u5f55\u4e0b\uff0c \u628a _layouts\/category archive.html \u653e\u5728\u00a0 layouts \u76ee\u5f55\u4e0b\uff0c \u8fd9\u6837\uff0c\u8fd9\u4e2a\u63d2\u4ef6\u4f1a\u5728Jekyll\u89e3\u6790\u7f51\u7ad9\u65f6\uff0c\u751f\u6210\u76f8\u5e94categories\u76ee\u5f55\uff0c\u76ee\u5f55\u4e0b\u662f\u5404\u4e2a\u5206\u7c7b\uff0c \u6bcf\u4e2a\u5206\u7c7b\u4e0b\u90fd\u6709\u4e00\u4e2a\u00a0<code class=\"prettyprint\">index.html<\/code> \u00a0\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u662f\u6839\u636e\u6a21\u677f\u6587\u4ef6 category archive.html \u751f\u6210\u7684\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre class=\"prettyprint perl\"><code>_site\/categories\/\n\u251c\u2500\u2500 \u5de5\u5177\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 <span class=\"keyword\">index<\/span>.html\n\u251c\u2500\u2500 \u601d\u60f3\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 <span class=\"keyword\">index<\/span>.html\n\u251c\u2500\u2500 \u6280\u672f\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 <span class=\"keyword\">index<\/span>.html\n\u2514\u2500\u2500 \u6e90\u4ee3\u7801\u9605\u8bfb\n    \u2514\u2500\u2500 <span class=\"keyword\">index<\/span>.html\n<\/code><\/pre>\n<p>\u7136\u540e\uff0c\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7\u00a0 <code class=\"prettyprint\">http:\/\/username.github.io\/blog\/categories\/\u5de5\u5177\/<\/code>\u00a0\u8bbf\u95ee\u00a0 <code class=\"prettyprint\">\u5de5\u5177<\/code> \u7c7b\u4e0b\u7684\u00a0 <code class=\"prettyprint\">index.html<\/code> \u00a0\u6587\u4ef6\u3002<\/p>\n<ul>\n<li>\u5f52\u6863 \u6211\u7684\u5f52\u6863\u63d2\u4ef6\u4f7f\u7528\u7684\u662f\u00a0 <a href=\"https:\/\/github.com\/shigeya\/jekyll-monthly-archive-plugin\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">jekyll-monthly-archive-plugin<\/a> ,\u5b83\u4f1a\u6839\u636e\u7f51\u7ad9 _posts\u76ee\u5f55\u4e0b\u7684\u6587\u7ae0\u65e5\u671f\uff0c\u4e3a\u6bcf\u4e2a\u6708\u751f\u6210\u4e00\u4e2a\u9875\u9762\u3002<\/li>\n<\/ul>\n<p>\u4f7f\u7528\u65b9\u6cd5\u540c\u4e0a\u3002\u6ce8\u610f\uff0c\u8fd9\u4e2a\u63d2\u4ef6\u5728 jekyll-1.4.2 \u4e2d\u53ef\u80fd\u4f1a\u51fa\u9519\uff0c\u5728 jekyll-1.2.0 \u4e2d\u6ca1\u6709\u9519\u8bef\u3002<\/p>\n<ul>\n<li>\u5206\u9875<\/li>\n<\/ul>\n<p>\u5f53\u6587\u7ae0\u5f88\u591a\u65f6\uff0c\u5c31\u9700\u8981\u4f7f\u7528\u5206\u9875\u529f\u80fd\uff0c\u5728 Jekyll \u5b98\u7f51\u4e0a\u63d0\u4f9b\u4e86\u4e00\u79cd\u00a0 <a href=\"http:\/\/jekyllrb.com\/docs\/pagination\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">\u5b9e\u73b0<\/a> \uff0c\u628a\u76f8\u5e94\u4ee3\u7801\u653e\u5728 \u4e3b\u9875\u4e0a\uff0c\u7136\u540e\u5728\u00a0 <code class=\"prettyprint\">_config.yml<\/code> \u00a0\u4e2d\u8bbe\u7f6e\u00a0 <code class=\"prettyprint\">paginate<\/code> \u00a0\u503c\u5c31\u884c\u4e86\u3002<\/p>\n<ul>\n<li>\u8bc4\u8bba<\/li>\n<\/ul>\n<p>\u8bc4\u8bba\u529f\u80fd\u9700\u8981\u4f7f\u7528\u5916\u6302\uff0c\u6211\u4f7f\u7528\u7684\u662f\u00a0 <a href=\"http:\/\/disqus.com\/\" target=\"_blank\" rel=\"nofollow,noindex noopener noreferrer\">DISQUS<\/a> , \u6ce8\u518c \u4e4b\u540e\uff0c\u5c06\u8bc4\u8bba\u533a\u7684\u4e00\u6bb5\u4ee3\u7801\u653e\u5728\u4f60\u9700\u8981\u4f7f\u7528\u8bc4\u8bba\u529f\u80fd\u7684\u9875\u9762\u4e0a, \u7136\u540e\uff0c\u901a\u8fc7\u5728\u9875\u9762\u7684 front-matter \u90e8\u5206\u4f7f\u7528<\/p>\n<pre class=\"prettyprint http\"><code><span class=\"attribute\">comments<\/span>: <span class=\"string\">true<\/span>\n<\/code><\/pre>\n<p>\u542f\u7528\u8bc4\u8bba\u3002<\/p>\n<p>\u8bc4\u8bba\u533a\u622a\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img0.tuicool.com\/EZbAny.jpg\" alt=\"\" \/><\/p>\n<p>\u57fa\u672c\u7684\u5185\u5bb9\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\uff0c\u4efb\u4f55\u95ee\u9898\uff0c\u6b22\u8fce\u7559\u8a00\u3002<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 GitHub, Jekyll \u6253\u9020&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[916,920,923],"tags":[963],"class_list":["post-2187","post","type-post","status-publish","format-standard","hentry","category-github","category-jekyll","category-923","tag-githubjekyllbolg"],"_links":{"self":[{"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/posts\/2187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/comments?post=2187"}],"version-history":[{"count":0,"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/posts\/2187\/revisions"}],"wp:attachment":[{"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/media?parent=2187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/categories?post=2187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/acevs.com\/wp-json\/wp\/v2\/tags?post=2187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}