ÔõÑùʹÓÃHexoºÍGithub PagesÀ´°²ÅŲ©¿ÍÍøÕ¾
hexoÊÇÒ»¸ö»ùÓÚnode.jsµÄ¾²Ì¬ÍøÕ¾ÌìÉúÆ÷£¬Ëü¿ÉÒÔ×ÊÖúÄã¿ìËٴ×Ô¼ºµÄ²©¿ÍÍøÕ¾¡£¶øgithub pagesÔòÊÇÒ»¸öÓÉgithubÌṩµÄ¾²Ì¬ÍøÕ¾ÍйÜЧÀÍ£¬ÈÃÄã¿ÉÒÔ½«×Ô¼ºµÄÍøÕ¾°²Åŵ½githubÉÏ¡£
ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«ÌÖÂÛÔõÑùʹÓÃHexoºÍGithub PagesÀ´°²ÅÅ×Ô¼ºµÄ²©¿ÍÍøÕ¾¡£
Ê×ÏÈ£¬È·±£ÄãÒѾװÖÃÁËNode.jsºÍGit¡£ÈôÊÇÄ㻹ûÓÐ×°Ö㬿ÉÒÔÇ°Íù¹ÙÍø¾ÙÐÐÏÂÔØ×°Öá£
½ÓÏÂÀ´£¬ÎÒÃÇÐèҪװÖÃHexoµÄÏÂÁîÐй¤¾ß¡£·¿ªÖնˣ¬ÔËÐÐÒÔÏÂÏÂÁ
npm install hexo-cli -g
µÇ¼ºó¸´ÖÆ
Õ⽫ÔÚÈ«¾ÖÖÐ×°ÖÃHexoÏÂÁîÐй¤¾ß¡£
½Ó×Å£¬ÔÚÖÕ¶ËÖн¨ÉèÒ»¸öеÄHexoÕ¾µã£¬ÔËÐÐÒÔÏÂÏÂÁ
hexo init myblog cd myblog npm install
µÇ¼ºó¸´ÖÆ
Õ⽫½¨ÉèÒ»¸öÃûΪmyblogµÄÐÂÕ¾µã£¬²¢×°ÖÃËùÓеÄÒÀÀµÏî¡£
ÏÖÔÚ£¬ÎÒÃÇÐèÒª½«ÎÒÃǵÄHexoÕ¾µã°²Åŵ½Github PagesÉÏ¡£Ê×ÏÈ£¬ÔÚGithubÉϽ¨ÉèÒ»¸öÃûΪusername.github.ioµÄпÍÕ»£¬ÆäÖÐusernameΪÄãµÄGithubÓû§Ãû¡£
È»ºó£¬ÔÚÖÕ¶ËÖÐÖ´ÐÐÒÔÏÂÏÂÁÒÔ½«ÎÒÃǵÄÕ¾µã°²Åŵ½Github PagesÉÏ£º
npm install hexo-deployer-git --save
µÇ¼ºó¸´ÖÆ
Õ⽫װÖÃHexoµÄGit°²ÅÅÆ÷²å¼þ¡£½Ó×Å£¬ÎÒÃÇÐèÒª½«°²ÅÅÉèÖÃÉèÖÃΪÎÒÃÇн¨µÄ¿ÍÕ»¡£
·¿ªÎÒÃǵÄHexoÕ¾µãµÄ_config.ymlÎļþ£¬½«deploy¶ÎÂäÐÞ¸ÄΪÒÔÏÂÄÚÈÝ£º
deploy: type: git repo: git@github.com:username/username.github.io.git branch: master
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬usernameÒªÌ滻ΪÄãµÄGithubÓû§Ãû¡£ÕâÀïµÄbranchĬÈÏÊÇmaster·ÖÖ§£¬Ò²¿ÉÒÔ×Ô¼ºÐÞ¸ÄΪÆäËû·ÖÖ§¡£
½ÓÏÂÀ´£¬ÔÚÖÕ¶ËÖÐÔËÐÐÒÔÏÂÏÂÁÐû²¼ÎÒÃǵIJ©¿Í£º
hexo clean hexo generate hexo deploy
µÇ¼ºó¸´ÖÆ
Õ⽫ɨ³ý¾ÉµÄÌìÉúÎļþ£¬ÖØÐÂÌìÉúеľ²Ì¬Îļþ£¬²¢½«ËüÃÇÍÆË͵½ÎÒÃǵÄGithub Pages¿ÍÕ»ÖС£
ÏÖÔÚÎÒÃǵIJ©¿Í¾ÍÒѾ°²Åŵ½ÁËGithub PagesÉÏ£¡·¿ªÒ»¸öä¯ÀÀÆ÷£¬ÔڵصãÀ¸ÖÐÊäÈëhttps://username.github.io¼´¿É»á¼ûÎÒÃǵIJ©¿Í¡£
×ܽáһϣ¬Ê¹ÓÃHexoºÍGithub PagesÀ´°²ÅÅ×Ô¼ºµÄ²©¿ÍÍøÕ¾ºÜÊÇÀû±ã£¬Ö»ÐèÒª¼òÆӵļ¸¸ö°ì·¨¾Í¿ÉÒÔÍê³É¡£Ï£ÍûÕâƪÎÄÕÂÄܹ»×ÊÖúµ½Äã¿ìËٴ×Ô¼ºµÄ²©¿ÍÍøÕ¾¡£
ÒÔÉϾÍÊÇÔõÑùʹÓÃHexoºÍGithub PagesÀ´°²ÅŲ©¿ÍÍøÕ¾µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡