ÔõôʹÓÃGitHub Pages½¨ÉèСÎÒ˽ÈËÍøÕ¾ºÍ²©¿Í
github pages ÊÇgithubÌṩµÄÒ»¸öÃâ·ÑµÄ¾²Ì¬ÍøÕ¾ÍйÜЧÀÍ£¬¿ÉÒÔ½«markdown¡¢html¡¢css¡¢javascript»òÕßÆäËû¾²Ì¬ÎļþÍйܵ½ÄúµÄgithub pagesÕË»§ÖС£ ËüÖ§³Ö¶àÖÖ×Ô½ç˵ÓòÃûºÍÖ÷Ì⣬¿ÉÒÔ¼æÈÝjekyll£¬²¢ÇÒ»¹¿ÉÒÔ×Ô½ç˵404Ò³ÃæµÈµÈ£¬ºÜÊÇÎÞаºÍÇ¿Ê¢¡£ÒÔÊÇ£¬Ê¹ÓÃgithub pages½¨ÉèСÎÒ˽ÈËÍøÕ¾ºÍ²©¿Í½ÏÁ¿Ê¢ÐС£
Ò»¡¢×¢²áGithubÕ˺Å
Ê×ÏÈÐèÒªÓµÓÐÒ»¸ögithubÕ˺ţ¬¿ÉÒÔͨ¹ýGithub¹ÙÍø https://github.com/ ¾ÙÐÐ×¢²á£¬×¢²áÀú³Ìδ¼¸×ö׸Êö¡£
¶þ¡¢½¨Éè¿ÍÕ»
ÒÔ¡°username.github.io¡±×÷Ϊ¿ÍÕ»Ãû½¨ÉèÒ»¸öеÄGitHub¿ÍÕ»¡£´Ëʱ£¬Õâ¸ö¿ÍÕ»Ãû±ØÐèΪusername.github.io£¬ÆäÖÐusernameÊÇÄúµÄGitHubÓû§Ãû¡£
ÈôÊÇÏëҪʹÓÃ×Ô½ç˵ÓòÃû£¬²»Òª½ÓÄÉ´ËÒªÁ콨Éè¿ÍÕ»£¬¿ÉÒÔͨ¹ýÔÚ¶àÒ»¸öº¬ÓÐ×Ô½ç˵ÓòÃûµÄ¿ÍÕ»À´ÊµÏÖ¡£
Èý¡¢ÉÏ´«ÍøÕ¾Îļþ
ʹÓÃgit¹¤¾ß¾ÙÐÐclone£¬È»ºóÔÚÍâµØ¿ÍÕ»Öн¨Éè²¢ÉÏ´«ÄúµÄ¾²Ì¬ÍøÕ¾¡£
ÔÚÍâµØĿ¼ÏÂн¨Ò»¸öÃûΪ¡°index.html¡±µÄÎļþ£¬ÎļþÖÐдÈëÄúµÄСÎÒ˽ÈËÍøÕ¾µÄHTML´úÂë¡£
¿ÉÒÔÊäÈëÒÔÏÂÏÂÁî³õʼ»¯¿ÍÕ»£º
$ cd /path/to/local/repo $ git init $ git add . $ git commit -m "first commit"
µÇ¼ºó¸´ÖÆ
½ÓÏÂÀ´Ö±½Ó½«¿ÍÕ»ÍÆË͵½GitHub¡£
$ git remote add origin https://github.com/username/username.github.io.git $ git push -u origin master
µÇ¼ºó¸´ÖÆ
ÉÏ´«Íê³Éºó£¬Äú¾Í¿ÉÒÔÔÚhttps://username.github.io/ÉÏÉó²éÄúµÄСÎÒ˽ÈËÍøÕ¾£¬´ËÍøÖ·Ò²ÊÇÄúÒÔºóÐû²¼ËùÓеÄСÎÒ˽ÈËÍøÕ¾µÄÐû²¼µØµã£¬µ±Äú¸üÐÂÍøÕ¾ºó£¬»á¼ûÕ߾ͻῴµ½ÍøÕ¾ÉÏ×îеÄÄÚÈÝ¡£
ÈôÊÇÄúÏëʹÓÃ×Ô½ç˵ÓòÃû£¬ÐèÒªÔÚGitHubµÄ¡°Settings¡±->¡°Custom domain¡±ÖÐÌîÈëÄú×¢²áµÄÓòÃû£¬È»ºóÔÚDNSÖÐÉèÖÃÓòÃûÆÊÎö¡£
ËÄ¡¢Ê¹ÓÃJekyllÖ÷Ìâ
JekyllÊÇGitHub PagesĬÈϵľ²Ì¬ÍøÕ¾ÌìÉúÆ÷£¬Ãâ·Ñ£¬¿ªÔ´ÇÒ¼æÈÝ´ó´ó¶¼Ö÷Ìâ¡£
Ê×ÏÈÐèÒªÔÚÍâµØµçÄÔÉÏ×°ÖÃRubyÓïÑÔ£¬È»ºóÔÚÏÂÁîÐÐÖÐÊäÈëÒÔÏÂÖ¸Á
$ gem install jekyll bundler
µÇ¼ºó¸´ÖÆ
½Ó×Å£¬¿Ë¡һ¸öJekyllÖ÷Ìâµ½ÍâµØ£¬È»ºóÌæ»»ÆäÖеÄÎļþÄÚÈÝ£¬½«ÆäÉÏ´«µ½GitHub Pages¿ÍÕ»ÖС£
$ git clone https://github.com/the-name-of-the-Jekyll-theme.git $ cd the-name-of-the-Jekyll-theme $ bundle install $ jekyll serve
µÇ¼ºó¸´ÖÆ
´Ëʱ£¬Äú¿ÉÒÔÔÚÍâµØµçÄÔµÄä¯ÀÀÆ÷ÖÐÉó²éÄúµÄСÎÒ˽ÈËÍøÕ¾£¬È»ºóÖ±½Ó½«¸ÃÖ÷ÌâÍÆË͵½GitHub£¬ÄúµÄÍøÕ¾ÉϾͻáʹÓøÃÖ÷ÌâÁË¡£
Îå¡¢×ܽá
ͨ¹ýGitHub Pages´î½¨Ð¡ÎÒ˽ÈËÍøÕ¾ºÍ²©¿Í¿ÉÒÔʹµÃÎÒÃǸüºÃµÄÕ¹ÏÖ×ÔÎÒ£¬Í¬Ê±Ò²ÎªÎÒÃÇÌṩÁËѧϰºÍ½»Á÷µÄƽ̨£¬¹ØÓÚСÎÒ˽È˵ÄÉú³¤ºÍÊÂÇ鶼ÓкܴóµÄ×ÊÖú¡£ÕâÀïÖ»ÊǼòÆÓµÄÏÈÈÝ£¬¸ü¶àµÄ¹¦Ð§¼°Ó÷¨ÐèÒª×ÔÐÐ̽Ë÷ºÍѧϰ¡£
ÒÔÉϾÍÊÇÔõôʹÓÃGitHub Pages½¨ÉèСÎÒ˽ÈËÍøÕ¾ºÍ²©¿ÍµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡