ã¦ã§ããµã¼ãã¹ã®AMP対å¿ããã¨ãã«å½¹ç«ã¤ï¼sitemap.xmlãã¯ãã¼ã«ãã¦ãµã¤ãå
ã®å
¨ãã¼ã¸ã®AMPã®ããªãã¼ã·ã§ã³ããã¦ãããã³ãã³ãã©ã¤ã³ãã¼ã«ãä½ã£ãï¼
GitHubã«ãç½®ãã¦ããã®ã§ãç´¹ä»ãã¾ãï¼
ã¯ããã«ï¼AMPã®ããªãã¼ã·ã§ã³ã«ã¤ãã¦
AMPï¼Accelerated Mobile Pagesï¼ã¯HTMLã®ãµãã»ãããªã®ã ãã©ï¼ãµã¤ãã®HTMLã¨ã¡ãã£ã¦ï¼ããªãã¼ã·ã§ã³ã«éããªãã¨AMPã®ãã¼ã¸ã¨ã¯èªãã¦ããããï¼ã¨ã©ã¼ãåºã¦ãã¨æ¤ç´¢çµæãªã©ã«åºãã¦ããããªãã®ã§ï¼ããã°ã£ã¦ç´ãå¿
è¦ãããï¼
ããªãã¼ã·ã§ã³ã®ä¸»ãªããæ¹ã«ã¯ï¼
- ã¯ãã¼ã«ãããã®ãå¾ ã£ã¦Search Consoleã§è¦ã
- AMPããªãã¼ã¿ã使ã
ã®2ã¤ãããï¼é çªã«èª¬æãã¾ãï¼
ã¯ãã¼ã«ãããã®ãå¾ ã£ã¦Search Consoleã§è¦ã
Search ConsoleããAMPã®ã¯ãã¼ã«ç¶æ³ãè¦ãã¦ï¼ã¨ã©ã¼ãåºã¦ããæãã¦ãããï¼
AMPã®ãã¼ã¸ããªãªã¼ã¹æ¸ã§ï¼ã¯ãã¼ã«ãéå§ãã¦ããå ´åã¯ï¼ã¤ã³ããã¯ã¹ãããé²æã¨ãããã¦è¦ããã®ã§è¯ããã©ï¼æ¬çªç°å¢ã«ãããã¤ããªãã¨ã¯ãã¼ã«ãããªãã®ã§ï¼éçºä¸ã«ã¯ä½¿ãã«ããï¼
AMPããªãã¼ã¿ã使ã
AMPã¯ããªãã¼ã¿ãå ¬å¼ã§æä¾ããã¦ãã¦ï¼ã¨ã©ã¼ãããã調ã¹ããã¨ãã§ããï¼å®è¡æ¹æ³ãããã¤ããã(å®è¡æ¹æ³ãããããããã ãã§ï¼å®ä½ã¯åã)ï¼
AMPã®ãã¼ã¸ã®URLã®æ«å°¾ã«#development=1ãã¤ããã¨ï¼ã¨ã©ã¼ãconsoleã«åºã¦ããï¼localhostã§éçºãã¦ããã¨ããªã©ã¯ï¼ã¡ãã£ã¨å¤ãã¦ã¯ãªãã¼ããã¦ã¨ã©ã¼ãè¦ãï¼ã¨ããã¹ã¿ã¤ã«ã§éçºã§ããï¼
Adding "#development=1" to the URL of the page instructs the AMP Runtime to run a series of assertions confirming the page's markup meets the AMP HTML Specification.
GitHub - ampproject/amphtml: AMP HTML source code, samples, and documentation. See below for more info.
Chromeæ¡å¼µããã£ã¦ï¼ãã®ãã¼ã¸ã«ã¯AMPçãããã¾ããï¼ã¨ãï¼ã¨ã©ã¼ãããã¾ããï¼ã¨ããã¿ã³ãåºãï¼ãã®æ¡å¼µãå
¥ãã¦ææ¥æ°èã®ãµã¤ãã¨ãè¦ãã¨ï¼1ã¯ãªãã¯ã§AMPçã«é£ã¹ããããï¼
chrome.google.com
ãã©ã¦ã¶ããå®è¡ã§ãããã¤ããã£ã¦ï¼URLãå ¥ããã¨ããªãã¼ã·ã§ã³ãã¦ãããï¼
ããªãã¼ã¿ãæå
ã§ãã«ããã¦ï¼ã³ãã³ãã©ã¤ã³ããå®è¡ãããã¨ãã§ããï¼Protocol Buffersã¨ãè¦ãã®ã§ã¡ãã£ã¨ããã©ãï¼
github.com
npmã®amp-validatorï¼Zombieã¨ãããããã¬ã¹ãã©ã¦ã¶ã§#development=1ã¤ãã§ãã¼ã¸ãéãã¦ï¼ã³ã³ã½ã¼ã«ã«åºã¦ããçµæãæãåºãã¦ãããï¼ã¨ããä»çµã¿ï¼ãã«ãããªãã¦ããã®ã§ æ軽ã«ä½¿ããï¼
www.npmjs.com
ãã¼ã¸ãããããããã¨å ¨é¨è¦ãã®ã¯ããã¸ã
対象ã®ãã¼ã¸ãææã¡ã§ä½ã£ã¦ããå ´åã¯ããªãã¼ã¿ãå®è¡ããã°ãããã©ï¼å¯¾è±¡ã®ãã¼ã¸ãããããããã¨ï¼å
¨é¨è¦ã¦åãã®ã¯ããã¸ãï¼ãã¨ãã°ï¼ããã°ã®ã·ã¹ãã ãä½ã£ã¦ãã¦ï¼ãã®ããã°ãæ°ãã«AMPãé
ä¿¡ããã¨ããªã©ã¯ï¼AMPãé
ä¿¡ãããã¼ã¸ãä¸æ°ã«å¢ããã®ã§ï¼å
¨é¨æåã§è¦ã¦åãã®ã¯å°é£ï¼
ããããªãã¼ã¸ãç¡ç§©åºã«é çªã«è¦ã¦ããã®ã¯å¹çãæªãã®ã§ï¼ãããããã¨ã¯èªååããã»ããããï¼
ã¾ãï¼æ¢åã®AMPã®ã¨ã©ã¼ãç´ãã¾ããï¼ã¨ããã¨ãã«ï¼å¥ã®ãã¼ã¸ã§å¥ã®ã¨ã©ã¼ãåºã¦ããå¯è½æ§ãããã®ã§ï¼ã¨ã©ã¼åºã¦ãªããç£è¦ãããï¼ã¨ãã話ããã£ã¦ï¼ããèããã¨èªåã§ãã§ãã¯ã§ããã»ããè¯ãï¼
æ©æ¢°çã«å ¨ãã¼ã¸ãã§ãã¯ããã
amp-error-collectorã¨ããã³ãã³ãã©ã¤ã³ã®ãã¼ã«ãä½ã£ãï¼sitemap.xmlã®URLã渡ãã¨ï¼ããã«æ¸ããã¦ããã¼ã¸ãå
¨é¨è¦ã¦ï¼AMPã®ããªãã¼ã·ã§ã³ãéãã¦ï¼ã¨ã©ã¼ãã©ããããåºã¦ããæãã¦ãããï¼
github.com
ãããªæãã§ã»ããã¢ãããã¦å®è¡ããï¼Rubyã¨Nodeãå¿ è¦ï¼つくりおきã¨ããããã°ãAMP対å¿ãã¦ãã¦ï¼è¨äºãããããããã®ã§ï¼ããªãã¼ã·ã§ã³ããã¦ã¿ã¾ãããï¼
% ./setup.sh % bundle exec -- ruby collect-errors.rb http://tsukurioki.hatenablog.com/sitemap.xml | tee a.md
ãã°ãã°ãã°ãåºãã®ã§ï¼æ¨æºåºåãteeã¨ãã§å¥ã®ãã¡ã¤ã«ã«åããã®ãããããï¼
% bundle exec -- ruby collect-errors.rb http://tsukurioki.hatenablog.com/sitemap.xml Error Report of http://tsukurioki.hatenablog.com/sitemap.xml I, [2016-06-23T15:10:27.721369 #79725] INFO -- : validate http://tsukurioki.hatenablog.com/entry/2016/06/20/090000?amp=1 I, [2016-06-23T15:10:27.924578 #79725] INFO -- : validate http://tsukurioki.hatenablog.com/entry/2016/06/20/033324?amp=1 I, [2016-06-23T15:10:27.934522 #79725] INFO -- : validate http://tsukurioki.hatenablog.com/entry/2016/06/22/092016?amp=1 I, [2016-06-23T15:10:28.086394 #79725] INFO -- : validate http://tsukurioki.hatenablog.com/entry/2016/06/19/095649?amp=1 I, [2016-06-23T15:10:30.955057 #79725] INFO -- : success I, [2016-06-23T15:10:31.060164 #79725] INFO -- : validate http://tsukurioki.hatenablog.com/entry/2016/06/19/005512?amp=1 I, [2016-06-23T15:10:33.135304 #79725] INFO -- : success I, [2016-06-23T15:10:33.227255 #79725] INFO -- : success I, [2016-06-23T15:10:33.247395 #79725] INFO -- : validate http://tsukurioki.hatenablog.com/entry/2016/06/18/213528?amp=1 I, [2016-06-23T15:10:33.287214 #79725] INFO -- : success I, [2016-06-23T15:10:33.352698 #79725] INFO -- : validate http://tsukurioki.hatenablog.com/entry/2016/06/17/082458?amp=1 I, [2016-06-23T15:10:33.406264 #79725] INFO -- : validate http://tsukurioki.hatenablog.com/entry/2016/06/13/234510?amp=1
ãã°ããå¾ ã¤ã¨ããªãã¼ã·ã§ã³çµæã®ç´ æ´ãªã¬ãã¼ããã§ããï¼çµæã®markdownã¯ãã¡ãï¼
309è¨äºä¸308è¨äº(99%)ã¯validã§ï¼1è¨äºã ãå¤ãªã®ãããï¼ã¨ããã¬ãã¼ããåºã¦ããï¼
http://tsukurioki.hatenablog.com/entry/2016/05/16/010134?amp=1 94:4 Invalid URL protocol 'chrome:' for attribute 'href' in tag 'a'.
該å½ã®ãã¼ã¸ãè¦ãã¨ï¼ãããã«ï¼è¨äºä¸ãããªããGoogle Chromeã®è¨å®ç»é¢ã«èªå°ãã¦ããï¼
AMPã§ã¯aã¿ã°ã®hrefã¯httpãhttpsã«éããã¦ããã®ã§ï¼ãããã«invalidã§ããï¼
ä»åã¯ï¼chrome://settingsã¸ã®ãªã³ã¯ãæ¶ãããªã«ããã¦è¨äºãç·¨éãã¦ç´ãããã©ï¼ã·ã¹ãã ã®ä¸å
·åãªãï¼ã·ã¹ãã å´ã®ã³ã¼ããæ¹ä¿®ãã¦ç´ããã¨ã«ãªãï¼
tsukurioki.hatenablog.com
ãã®ãã¼ã«ããã£ã¦ãããã¨ã¯ï¼
- æå®ãããsitemap.xmlã解æãã¦HTMLã®ãªã¹ããæãåºã
- HTMLã«åã¾ã£ã¦ãlinkã¿ã°ãè¦ã¦AMPçã®ãã¼ã¸ãæ¢ã
- é çªã«npmã®amp-validatorãå¼åºãã¦ããªãã¼ã·ã§ã³ãã
- ããªãã¼ã·ã§ã³çµæãJSONã§åå¾ãã¦ï¼ã¨ã©ã¼ããã£ããã¬ãã¼ãã«æ¸ãåºã
ã¨ãããã¨ã§ï¼ç¹å®ã®ã¦ã§ããµã¼ãã¹ã«ç¹åããä½ãããã¦ããªãï¼
ä¸ã®ä¾ã§ã¯ã¤ããããã¨ããã¯ã¦ãªããã°ãã¯ãã¼ã«ãã¦ãããã©ï¼ä¸è¬çãªsitemap.xmlãç½®ãã¦ããã¦ã§ããµã¼ãã¹ãªãåæ§ã«ã¯ãã¼ã«ãããã¨ãã§ããï¼
注æãã¹ããã¨ã¨ãã¦ã¯ï¼éçºä¸ã«ä½¿ãç¨éã®ãã®ãªã®ã§ï¼ã¹ãªã¼ãã¨ãå
¥ããï¼æ°åããã¯ãã¼ã«ãã¾ããã®ã§ï¼ä»ç¤¾ã®ãµã¤ããªã©ã«å¯¾ãã¦ä½¿ãã¨è¡åã®æªããã¨ã«ãªãã¨æãï¼éçºä¸ã«ä½¿ãããã¨ãã¯ï¼localhostã§èµ·åãã¦ï¼æå
ã«åãã¦å®è¡ãã¾ãããï¼
ã¾ã¨ã
ã¦ã§ããµã¼ãã¹ã®AMP対å¿ãå®è£
ããããã«å½¹ç«ã¤ã³ãã³ãã©ã¤ã³ãã¼ã«ãä½ã£ãã®ã§ãç´¹ä»ãã¾ããï¼
ã¯ã¦ãªããã°ã®AMP対å¿(ãã¼ã¿ç)ãé²ããããã«ãï¼éçºä¸ã«ãã®ãã¼ã«ã使ã£ã¦ã¨ã©ã¼çãè¨æ¸¬ããªããä½ã£ã¦ãã¦ï¼å¹ççã«é²ãããã¨ãã§ãã¾ããï¼
staff.hatenablog.com
æ¥é±æ«ã®ã¤ããã¼ã§ãAMPã®è©±ããã¾ãï¼30åãããããã¹ãã®ã§æ¥ã¦ãã ããï¼ãã±ããã¯ãã§ã«åçé«ããããããªãï¼
yapcasia8oji-2016mid.hachiojipm.org
ãã¨ï¼ä»åä½ã£ããããªãã¼ã«ããªãã¨ä¸ä¾¿ã ã¨æãã®ã ãã©ï¼ã¿ããªã©ããã£ã¦ãã£ã¦ãã®ãï¼ç¥è¦ãã£ããæãã¦ãã ããï¼
ã¤ã©ã¹ã: 冬季オリンピックのイラスト「スピードスケート」 | かわいいフリー素材集 いらすとや, 忙しく仕事をしている女性会社員のイラスト | かわいいフリー素材集 いらすとや
追è¨
sitemap.xmlãã¯ãã¼ã«ãã¦ãµã¤ãå ã®å ¨ãã¼ã¸ã®AMPã®ããªãã¼ã·ã§ã³ããã¦ãããã³ãã³ãã©ã¤ã³ãã¼ã«ãä½ã£ã - hitode909ã®æ¥è¨b.hatena.ne.jp
- [amp]
便å©ããããã RSS ããã ãããªï¼
2016/06/23 17:28
ãããã«ãã£ã¼ãèªãã¦ãããããï¼ãã¼ã¸ãã¼ã·ã§ã³ã«å¯¾å¿ããAtomã¨ããªãå ¨è¨äºãã©ã£ã¦ããããï¼
ã²ã¨ã§ããããã®ãã¼ã«ãå¤ããã¼ã¸ã§ã³ã®AMP validator (dorightdigital/amp-validator) 使ã£ã¦ããã§ãã¡ãã£ã¨ããããåºæ¥ãªãå¯è½æ§ããã
— Yoshifumi YAMAGUCHI (@ymotongpoo) 2016å¹´6æ23æ¥
@ymotongpoo nodeã ãã§åãã¦ç°¡åã ã£ãã®ã§ãã£ã¡ã使ã£ã¦ãã®ã§ããï¼ã¡ããã¨ã»ããã¢ããã§ããã°ï¼ampproject/amphtmlã«å ¥ã£ã¦ããã¤ä½¿ããã»ããããããã§ãã å¤ããã¼ã¸ã§ã³ã¨ããé¢ä¿ãªã®ç¥ãã¾ããã§ãã
— 趣å³ã¯ããªã³ã¹ãã¼ãã§ã (@hitode909) 2016å¹´6æ23æ¥
@hitode909 ampproject/amphtmlå ã®ãã¤ãç°¡åã«ä½¿ããã°ãããã ãã©ãnpmåããã¦ãªãã®ã§ãããã¯æ¬ä½å´ã§å¤æ´ã®ä½å°ããããªãã¨ã¯æãã¾ããå¤ããã¼ã¸ã§ã³ãã¨ããã®ã¯åã«ã¬ãã¸ããªã®æçµæ´æ°ã3ã¶æåã ã£ãããã§ãã
— Yoshifumi YAMAGUCHI (@ymotongpoo) 2016å¹´6æ23æ¥
@ymotongpoo ãªãã»ã©åãã£ã¦ãã¾ããï¼dorightdigital/amp-validatorèªä½ã¯ããªãã¼ã¿ãæã£ã¦ãªãã¦ï¼#development=1ãã¤ãã¦ã¢ã¯ã»ã¹ãã¦ã³ã³ã½ã¼ã«ã®åºåãæ¾ã£ã¦ãã¦ããã ããªã®ã§ï¼ããªãã¼ã·ã§ã³çµæã¯åãããªã¨æã£ã¦ã¾ãã
— 趣å³ã¯ããªã³ã¹ãã¼ãã§ã (@hitode909) 2016å¹´6æ23æ¥
@hitode909 ãªãã»ã©ãããã¾ã§è¦ã¦ã¾ããã§ããããããã¨ããããã¾ããããã¡ãã£ã¨ä¸èº«è¦ãã»ããè¯ãããã§ããã
— Yoshifumi YAMAGUCHI (@ymotongpoo) 2016å¹´6æ23æ¥
@ymotongpoo ãããããããã¨ããããã¾ãï¼validator/index.jsã§åããããªãã¨ã§ãããã ã£ãã®ã§ããã¡ãã£ã¨è¦ã¦ã¿ã¾ã
— 趣å³ã¯ããªã³ã¹ãã¼ãã§ã (@hitode909) 2016å¹´6æ23æ¥
ãããã話ããã£ã¦ï¼AMPæ¬ä½ã®ãªãã¸ããªã«å ¥ã£ã¦ãããªãã¼ã¿ã使ãçãä½ããã¨ãã¦ãã¾ãï¼
追è¨(2)
AMPæ¬ä½ã®ãªãã¸ããªã«å ¥ã£ã¦ãããªãã¼ã¿ã使ãããã«ãªãã¾ããï¼amphtml/validator/index.jsã使ã£ã¦ãã¾ãï¼