[{"data":1,"prerenderedAt":108},["ShallowReactive",2],{"legacy-question-6220d38fd4d82f9e82507d1dd95d591c":3,"legacy-question-author-koji-kadoma":81,"legacy-question-category-website-building":97},{"id":4,"title":5,"author":6,"body":7,"category":68,"date":69,"description":5,"extension":70,"locale":71,"meta":72,"navigation":73,"path":74,"seo":75,"slug":76,"stem":77,"tag":78,"updated":69,"__hash__":80},"legacyQuestions\u002F20210406000000-Gridsomeでデフォルトのindex.htmlを変更するには？.md","Gridsomeでデフォルトのindex.htmlを変更するには？","koji-kadoma",{"type":8,"value":9,"toc":64},"minimark",[10,15,19,22,25,44,47,50,61],[11,12,14],"h2",{"id":13},"srcindexhtmlを作ればオーバーライドされます","src\u002Findex.htmlを作ればオーバーライドされます",[16,17,18],"p",{},"Gridsomeでは、srcディレクトリ直下においたindex.htmlファイルがデフォルトのindex.htmlをオーバーライドする仕様になっています。",[16,20,21],{},"index.htmlの中身を変更するのではなく、完全に置き換えてしまうので、必要な変数をindex.htmlに仕込んでおく必要があります。",[16,23,24],{},"変数は、",[26,27,28,32,35,38,41],"ul",{},[29,30,31],"li",{},"htmlAttrs",[29,33,34],{},"head",[29,36,37],{},"bodyAttrs",[29,39,40],{},"app",[29,42,43],{},"scripts",[16,45,46],{},"です。",[16,48,49],{},"公式ドキュメントのサンプルは下記のようになっています。",[51,52,57],"pre",{"className":53,"code":55,"language":56},[54],"language-text","\u003C!DOCTYPE html>\n\u003Chtml ${htmlAttrs}>\n  \u003Chead>\n    ${head}\n  \u003C\u002Fhead>\n  \u003Cbody ${bodyAttrs}>\n    ${app}\n    ${scripts}\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n","text",[58,59,55],"code",{"__ignoreMap":60},"",[16,62,63],{},"ここは、普通のHTMLとして動くので、独自にJavascript処理を入れることも可能です。",{"title":60,"searchDepth":65,"depth":65,"links":66},2,[67],{"id":13,"depth":65,"text":14},"website-building","2021-04-06T02:00:00.000Z","md","ja",{},true,"\u002F20210406000000-gridsomeindex.html",{"title":5,"description":5},"6220d38fd4d82f9e82507d1dd95d591c","20210406000000-Gridsomeでデフォルトのindex.htmlを変更するには？",[79],"gridsome","iX1qI1hRMJRZXxNFGlgZaU58_Sm2ssZQZs0ybDTOic4",{"id":82,"title":83,"body":84,"date":88,"description":89,"extension":70,"locale":71,"meta":90,"name":93,"navigation":73,"path":94,"seo":95,"slug":6,"stem":6,"updated":88,"__hash__":96},"legacyAuthors\u002Fkoji-kadoma.md","Koji Kadoma",{"type":8,"value":85,"toc":86},[],{"title":60,"searchDepth":65,"depth":65,"links":87},[],"2021-04-01T00:00:00.000Z","Webエンジニアです。Javascript、PHP、Ruby、Dockerなどをメインで使っています。",{"image":91,"url":92},"https:\u002F\u002Fwww.codit.work\u002Fimgs\u002Favatar\u002Fkoji-kadoma.png","https:\u002F\u002Fkoji.pages.dev\u002F",null,"\u002Fkoji-kadoma",{"title":83,"description":89},"H1yaGicrsv1CzYTbFeEXQosuYx93lIutD3_XwXMhAFk",{"id":98,"title":99,"body":100,"date":88,"description":99,"extension":70,"locale":71,"meta":104,"navigation":73,"path":105,"seo":106,"slug":68,"stem":68,"updated":88,"__hash__":107},"legacyCategories\u002Fwebsite-building.md","Webサイト構築",{"type":8,"value":101,"toc":102},[],{"title":60,"searchDepth":65,"depth":65,"links":103},[],{},"\u002Fwebsite-building",{"title":99,"description":99},"h9jPLD2mzMm3L4sFN5qWSiSirySQQLdnxLhQcvw8VlQ",1783320301149]