ã¹ã¯ãªãããã¡ã¤ã«ã¯GitHubä¸ã§æä¾ãã¦ããã¾ãã®ã§ãå¼ãç¶ããå©ç¨ãããæ¹ã¯ããã¾ã§ã®è¨å®é¨åãä¿®æ£ãã¦ãã ããã 詳細ã¯å½è¨äºå ã®æé 4,æé 5ãåç §ãã¦ãã ããã
ã¿ãªããã¯ã«ãã´ãªã¼ãâé層åâãã¦ããã§ããããã
ã«ãã´ãªã¼ã®é層åã¨ã¯ãè¨äºã®ã«ãã´ãªã¼ã«è¦ªåé¢ä¿ãä»ãããã®ã§ãã
ãããè¡ã£ãä¸ã§âãã³ãããªã¹ãâãä½æããã¨ãSEOã«å¼·ããªããããã§ãã
ã¯ã¦ãªããã°ã«ããã¦ã¯å°ãåãå
¬å¼ãªãã³ãããªã¹ãæ©è½ã追å ããã¾ããã
staff.hatenablog.com
ããããªããå ¬å¼ãã³ãããªã¹ãã¯âã«ãã´ãªã¼é層åâã«ã¯å¯¾å¿ãã¦ããããããã©ã«ãã§ä¸ã¤ç®ã®ã«ãã´ãªã ãã表示ããã¾ãã
ããã§å
¬å¼ãã³ãããªã¹ãç»å ´ä»¥åãããç¬èªã«ãã³ãããªã¹ããä½æããããã°ãã¼ããæä¾ããã¦ãã¾ãã
http://bulldra.hatenablog.com/entry/category-breadcrumb-updatebulldra.hatenablog.com
ç§ã¯ãããã®ããã¨ãåããç®æãããå
¬å¼ãã³ãããªã¹ãã®é層åãããã³ããµã¤ããã¼ã®ã«ãã´ãªã¼ã®ã¢ã¼ã«ã¤ã表示ããå®ç¾ããããã°ãã¼ããä½æãã¾ããï¼
- ããã°ãã¼ãã§ã§ãããã¨
- è¨å®æé
- ã«ã¹ã¿ãã¤ãºã®ç¶ç¶çãªæä¾ã®ããæãéãåãä»ãã¾ãï¼ï¼
- 注æ
ããã°ãã¼ãã§ã§ãããã¨
å ¬å¼ãã³ãããªã¹ããé層åãã
ã«ãã´ãªã¼ãæ¬ä¼¼çã«é層åãã¦ç»é²ãããã¨ã§ãã¯ã¦ãªå
¬å¼ã®ãã³ãããªã¹ããé層表示ã§ãã¾ãã
ãµã¤ããã¼ã®ã«ãã´ãªã¼ãé層表示ãã
ãæå¥ã¢ã¼ã«ã¤ããã¨åãå½¢å¼ã§ãåæ表示ã«ã¯ç¬¬ï¼é層ã®ã«ãã´ãªã¼ã®ã¿ã表示ãââ¶ï¼â¼âãã¿ã³ãæ¼ããã¨ã§åã«ãã´ãªã¼ä»¥ä¸ã®è¡¨ç¤ºã»é表示ãåãæ¿ãããã¨ãã§ãã¾ãã
æåã®è¡¨ç¤ºç¶æ
ã
ââ¶âãã¿ã³ãæ¼ãã¨åã«ãã´ãªã¼ãå±éã§ãã¾ãã
ãªã2é層ç®ä»¥ä¸ãã¾ã¨ãã¦è¡¨ç¤ºã»é表示ãåãæ¿ãã¾ãã3層ç®ä»¥ä¸ã®ã«ãã´ãªã¼ã¯ãã®ã¾ã¾é層表示ãããæãããããã¨ã¯ã§ãã¾ããã
è¨å®æé
è¨å®ã¯æ¬¡ã®4ã¹ãããã§ãã
- å ¬å¼ãã³ãããªã¹ãã®æå¹å
- ã«ãã´ãªã¼ã®é層å
- ã¹ã¯ãªããã®è¨å®
- ã¹ã¿ã¤ã«ã®è¨å®
â»éå»ã«ãã¡ãã®è¨äºã§ç´¹ä»ããã¹ã¯ãªãããè¨å®ããã¦ããæ¹ã¯å
¨ã¦åé¤ããä¸ã§è¨å®ããé¡ããã¾ãã
quotto.hatenablog.com
1. å ¬å¼ãã³ãããªã¹ãã®æå¹å
â»ãã®æé ã¯å¿ é ã§ã¯ããã¾ãããããã³ãããªã¹ãã¯è¡¨ç¤ºããªãããå ¬å¼å¤ã®ãã³ãããªã¹ãã使ã£ã¦ãããã¨ããæ¹ã¯æ¬¡ã«é²ãã§ä¸ããã
ã¯ã¦ãªããã°ã®ç®¡çãã¼ã¸ããããã¶ã¤ã³ãâãã«ã¹ã¿ãã¤ãºãâãè¨äºãã¨é²ã¿ãâè¨äºãã¼ã¸ã«ãã³ãããªã¹ãã表示ããâã«ãã§ãã¯ãå
¥ãã¦ä¸ããã
2. ã«ãã´ãªã¼ã®é層å
è¨äºã®ã«ãã´ãªã¼ã以ä¸ã®ã«ã¼ã«ã«å¾ãç»é²ã¾ãã¯ä¿®æ£ãã¾ãã
- ã親ã«ãã³ãª-åã«ãã´ãªãã¨ããå½åè¦åã§ãæ¬ä¼¼çãªé層ã表ãã«ãã´ãªãç»é²ããã
- ã親ã«ãã´ãªã ããã®ã«ãã´ãªãå¿ ãç»é²ããã
- ã«ãã³ãªã®ä¸¦ã³é ãã親ã«ãã´ãªãâã親ã«ãã´ãª-åã«ãã´ãªãã¨ãªãããã«ç»é²ããã
ä¾ãã°ãé£äº > ä»å°ãã¨ãããã³ããã«ãããå ´åã¯ãè¨äºã®ã«ãã´ãªããé£äºããé£äº-ä»å°ãã¨ããé ã§ç»é²ãã¾ãã
ãé£äº > ä»å° > éèåºãã®ããã«3é層ã¨ããå ´åã«ã¯ãé£äºããé£äº-ä»å°ããé£äº-ä»å°-éèåºãã®é ã«ã«ãã´ãªãç»é²ãã¾ãã
注æç¹
è¤æ°ã®é層ã®ã«ãã´ãªãç»é²ãããã¨ã¯ã§ãã¾ããããã³ã¯ãºãªã¹ãã«è¡¨ç¤ºãããã®ã¯æåã«é層åãããã«ãã³ãªã®ã¿ã§ãã
ä¾ãã°ãæãåºããé£äºããé£äº-ä»å°ãã®é ã§ç»é²ããå ´åã¯ãæåã®ãæãåºãã1é層ã®ã«ãã´ãªã¨ãã¦ãã³ãããªã¹ãã«è¡¨ç¤ºãã¾ãã
ãé£äº-ä»å°ããæãåº-ä»å°ãã¨ããé ã§ã«ãã´ãªãç»é²ããå ´åã«è¡¨ç¤ºããããã³ãããªã¹ãã¯ãæåã«é層åãã¦ãããé£äº > ä»å°ãã®ã¿ã§ãã
ã¾ããã®å ´åãè¨äºã®ã«ãã´ãªã¼é¨åã¯ãé£äºããä»å°ããæãåºããä»å°ãã¨ãªã£ã¦ãã¾ãã¾ãã®ã§ã注æãã ããã
(ãµãã¤ã®ãä»å°ãã¯ããããã®ãé£äº-ä»å°ããæãåº-ä»å°ãã¨ããé層æ
å ±ã¯ä¿æãã¦ãã¾ã)
3. ã«ãã´ãªã¼ã®è¡¨ç¤ºè¨å®
é層表示ããå ´åã¯ã«ãã´ãªã¼ã®è¡¨ç¤ºé ããã¢ã«ãã¡ãããé ãã«ãªã£ã¦ããå¿
è¦ãããã¾ãã
ããã¶ã¤ã³ãããµã¤ããã¼ãã¨é²ã¿ãè¨å®ãè¡ãã¾ãã
4. ã¹ã¯ãªããã®è¨å®
ã¯ã¦ãªããã°ã®ç®¡çãã¼ã¸ããããã¶ã¤ã³ãâãã«ã¹ã¿ãã¤ãºãâãããã¿ãã¨é²ã¿ãã¹ã¯ãªãããè¨å®ãã¾ãã
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <script>GitHubããã³ãã¼ããbreadcrumb.min.jsã®å 容ãè²¼ãä»ã</script> <script>GitHubããã³ãã¼ããcategory_archive.min.jsã®å 容ãè²¼ãä»ã</script>
2è¡ç®ã®ã¿ã°ã®å 容ã¯breadcrumb.min.js ã3è¡ç®ã®ã¿ã°ã®å 容ã¯category_archive.min.jsããã³ãã¼ãã¦è²¼ãä»ãã¦ãã ããã
5. ã¹ã¿ã¤ã«ã·ã¼ãã®è¨å®
ã¯ã¦ãªããã°ã®ç®¡çãã¼ã¸ããããã¶ã¤ã³ãâãã«ã¹ã¿ãã¤ãºãâãããããã¨é²ã¿ã以ä¸ã®ã¹ã¯ãªãããè¨å®ãã¾ãã
<style>GitHubããã³ãã¼ããfulldisplay.min.cssã®å 容ãè²¼ãä»ã</style>
ã¿ã°ã®å
容ã¯fulldisplay.min.cssããã³ãã¼ãã¦è²¼ãä»ãã¦ãã ããã
ã«ã¹ã¿ãã¤ãºã®ç¶ç¶çãªæä¾ã®ããæãéãåãä»ãã¾ãï¼ï¼
å½ã«ã¹ã¿ãã¤ãºãä½æãã¦ããããªãã®å¹´æ°ãçµã¡ãããããããã¨ã«ããããã®ã¯ã¦ãªããã°ã§ãå©ç¨ããã ãã¦ããã¾ããç´è¿ã§ã¯ã«ã¹ã¿ãã¤ãã¡ã¤ã«ã«å¯¾ãã¦ï¼æ¥ããã100ä¸å以ä¸ã®ãªã¯ã¨ã¹ããçºçãã¦ãã¾ãã
ä¸æ¹ã§ã«ã¹ã¿ãã¤ãºã®æä¾ã«ã¯ãã¡ã¤ã³ãé ä¿¡ãµã¼ãã¼ãå¿ è¦ã¨ãªããç§ã®èªè²»ã§éç¨ãã¦ãã¾ãã大ããéé¡ã§ã¯ããã¾ããããæ¯ææ°ç¾åã®è²»ç¨ãå¿ è¦ãªç¶æ³ã§ãã
ããã§ä»å¾ãå½ã«ã¹ã¿ãã¤ãºãæä¾ããããã®è²»ç¨æ»åºããã³ç§ã®ã¢ããã¼ã·ã§ã³ç¶æã®ãããæ°ãåãããã§ãã¾ãã¾ãããæãéããé¡ããã¾ãï¼
ãã¡ãããæãéç¡ãã§ãå©ç¨ããã ãã¦åé¡ããã¾ããããããéãããªãã®ã«ä½¿ã£ã¦ãï¼ãã¿ãããªèª¿æ»ã¯ãã¾ããã
ãããã«ã¹ã¿ãã¤ãºãæ°ã«å ¥ã£ã¦ããã ããæ°ãåãããã§çµæ§ã§ãã50åã§ã100åã§ããæ¯æ´ããã ããã¨æ¯æ´ããã ããã¨å¤§å¤å¬ããã§ãã
ãªããããã¾ã§ãåæã¨ãã¦åãä»ãã¾ãã®ã§ããéãããã ããããã¨è¨ã£ã¦ãµã¼ãã¹ã¬ãã«ãåä¸ããããã§ã¯ããã¾ããããäºæ¿ãã ããã
åé ã«è¨è¼ã®ã¨ãããé ä¿¡ã¯åæ¢ãã¾ããã
æ¢ã«æãéããã ãã¦ããã¦ã¼ã¶ã¼æ§ã«ã¯ç³ã訳ãããã¾ãããããç解ã®ç¨ãããããé¡ããããã¾ãã
注æ
ããã°ãã¼ãï¼ã¹ã¯ãªãããCSSãã¡ã¤ã«ï¼ã¯ãèªåã®ã¬ã³ã¿ã«ãµã¼ãããæä¾ãã¦ããããäºåãªãæ©è½ãåæ¢ããå ´åãããã¾ãã
ãäºæ¿ä¸ããã