̽ÌÖÔõÑùÔÚGitHubÉϴHexo²©¿Í
githubÊÇÒ»¸öÈ«Çò¿ª·ÅµÄ´úÂëÍйÜƽ̨£¬Îª¿ª·¢ÕßÌṩÁËÒ»¸öÀû±ãÐ×÷ºÍ·ÖÏí´úÂëµÄƽ̨¡£¶øhexoÊÇÒ»¸ö¿ìËÙ¡¢¾«Á·ÇÒ¸ßЧµÄ²©¿Í¿ò¼Ü£¬»ùÓÚnode.js¿ª·¢¡£ÔÚÕâƪÎÄÕÂÖУ¬ÎÒÃǽ«Ì½ÌÖÔõÑùÔÚgithubÉϴhexo²©¿Í¡£
½¨ÉèGitHub¿ÍÕ»
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÔÚGitHubÉϽ¨ÉèÒ»¸ö¿ÍÕ»¡£ÔÚGitHubÖ÷Ò³Éϵã»÷New repository£¬Ìîд¿ÍÕ»Ãû³Æ£¬Ñ¡ÔñPublic»òPrivate£¬È»ºóµã»÷Create repository¡£½ÓÏÂÀ´£¬ÎÒÃÇÐèҪװÖÃGit£¬ÓÃËüÀ´½«ÍâµØÎļþÍÆËÍÖÁGitHub¿ÍÕ»ÖС£
×°ÖÃHexo
ÎÒÃÇÐèÒªÔÚÍâµØ×°ÖÃNode.jsºÍGit£¬ÒÔ±ãºóÐø¾ÙÐвÙ×÷¡£È»ºó·¿ªÏÂÁîÐд°¿Ú£¬ÊäÈëÒÔÏÂÏÂÁîÀ´×°ÖÃHexo¡£
npm install -g hexo-cli
µÇ¼ºó¸´ÖÆ
ÌìÉúHexo²©¿ÍÎļþ
½ÓÏÂÀ´£¬ÎÒÃÇʹÓÃHexo½¨ÉèÒ»¸öеIJ©¿Í¡£ÔÚÏÂÁîÐÐÖÐÊäÈëÒÔÏÂÏÂÁ
hexo init myblog cd myblog npm install
µÇ¼ºó¸´ÖÆ
Õâ¸öÏÂÁî»áÔÚÄ¿½ñĿ¼Ï½¨ÉèÒ»¸ömyblogÎļþ¼Ð£¬²¢ÔÚÄÚÀï×°ÖÃHexo¡£
ÉèÖÃHexo²©¿Í
½ÓÏÂÀ´£¬ÎÒÃÇÐèÒª¶ÔHexo¾ÙÐÐһЩÉèÖá£ÔÚHexoµÄ¸ùĿ¼Ï£¬·¿ª_config.ymlÎļþ£¬ÕâÊÇHexo²©¿ÍµÄÉèÖÃÎļþ£¬ÄÚÀï°üÀ¨ÁËËùÓеÄHexoÉèÖá£ÎÒÃÇÐèÒª¶ÔÕâ¸öÎļþ¾ÙÐÐÉèÖã¬ÒÔ±ã×Ô¼ºµÄСÎÒ˽È˲©¿Í²©¿Íµ÷½â¡£
°²Åŵ½GitHub Pages
Hexo×Ô¶¯ÎªÎÒÃÇÌìÉú¾²Ì¬HTMLÎļþ£¬ÎÒÃÇÐèÒª½«Æä°²Åŵ½GitHub PagesÉÏ¡£ÔÚÏÂÁîÐÐÖÐÊäÈëÒÔÏÂÏÂÁ
npm install hexo-deployer-git --save
µÇ¼ºó¸´ÖÆ
Õâ¸öÏÂÁhexo-deployer-git²å¼þ×°Öõ½ÎÒÃǵIJ©¿ÍÖС£È»ºó£¬ÔÚ_config.ymlÎļþÖÐÌí¼ÓÒÔÏÂÉèÖãº
deploy: type: git repository: git@github.com:username/username.github.io.git branch: master
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬usernameÊÇÎÒÃǵÄGitHubÓû§Ãû¡£È»ºó£¬ÔËÐÐÒÔÏÂÏÂÁ²©¿Í°²Åŵ½GitHub PagesÉÏ¡£
hexo clean && hexo g && hexo d
µÇ¼ºó¸´ÖÆ
Hexo½«×Ô¶¯°Ñ²©¿ÍÎļþÍÆË͵½ÎÒÃǵÄGitHub PagesÒ³Ã棬ÎÒÃÇ¿ÉÒÔͨ¹ý»á¼ûhttps://username.github.ioÀ´Éó²é×Ô¼ºµÄ²©¿Í¡£
Ðû²¼ÎÄÕÂ
×îºó£¬ÎÒÃǾͿÉÒÔ×îÏÈÐû²¼×Ô¼ºµÄ²©¿ÍÎÄÕÂÁË¡£ÔÚHexo¸ùĿ¼Ï£¬ÔËÐÐÒÔÏÂÏÂÁÉèһƪеÄÎÄÕ£º
hexo new post "ÎÄÕÂÃû³Æ"
µÇ¼ºó¸´ÖÆ
Õâ¸öÏÂÁî»áÔÚsource/_postsĿ¼Ï½¨ÉèÒ»¸öеÄMarkdownÎļþ£¬ÆäÖС°ÎÄÕÂÃû³Æ¡±ÊÇÄãÒªÐû²¼µÄÎÄÕÂÎÊÌâ¡£
ÔËÐÐÒÔÉÏÏÂÁîºó£¬ÐÞ¸Äsource/_posts/ϵÄ*.mdÎļþ£¬Ð´Èë×Ô¼ºµÄÎÄÕÂÄÚÈÝ¡£
HexoÖ÷Ìâ
ÈôÊÇÄãÏëÈÃÄãµÄ²©¿ÍÔ½·¢ÑŹۺ͸öÐÔ»¯£¬¿ÉÒÔͨ¹ý×°ÖÃHexoÖ÷ÌâÀ´¸Ä±ä²©¿ÍµÄÑùʽ¡£Ö»ÐèÔÚHexoµÄ¸ùĿ¼Ï£¬ÔËÐÐÒÔÏÂÏÂÁîÀ´×°ÖÃÖ÷Ì⣺
git clone https://github.com/author/author.github.io.git themes/theme-name
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬authorÊÇÖ÷Ìâ×÷ÕßµÄGitHubÓû§Ãû£¬theme-nameÊÇÖ÷ÌâµÄÃû³Æ¡£
È»ºó£¬ÔÚHexoµÄ¸ùĿ¼Ï£¬·¿ª_config.ymlÎļþ£¬ÐÞ¸ÄthemeΪÄã×°ÖõÄÖ÷ÌâÃû³Æ¡£ÀýÈ磺
theme: theme-name
µÇ¼ºó¸´ÖÆ
ÕâÑù¾Í´î½¨ºÃÁË×Ô¼ºµÄHexo²©¿Í£¬¿ÉÒÔÓä¿ìµÄд×÷ºÍ·ÖÏíÁË¡£
ÒÔÉϾÍÊÇ̽ÌÖÔõÑùÔÚGitHubÉϴHexo²©¿ÍµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡