[{"data":1,"prerenderedAt":83},["ShallowReactive",2],{"legacy-question-9ff2c480424d00c97b9044846bca5e03":3,"legacy-question-author-koji-kadoma":56,"legacy-question-category-website-building":72},{"id":4,"title":5,"author":6,"body":7,"category":42,"date":43,"description":44,"extension":45,"locale":46,"meta":47,"navigation":48,"path":49,"seo":50,"slug":51,"stem":52,"tag":53,"updated":43,"__hash__":55},"legacyQuestions\u002F20210402000000-Gridsomeでmetaの内容を動的に変更するには？.md","Gridsomeでtitleやmetaの内容を動的に変更するには？","koji-kadoma",{"type":8,"value":9,"toc":38},"minimark",[10,14,18,29,32,35],[11,12,13],"h2",{"id":13},"専用のフックが用意されています",[15,16,17],"p",{},"Gridsomeには、HTMLヘッダーの中身を動的に変更するために「metaInfo」という専用のフックが用意されています。",[19,20,25],"pre",{"className":21,"code":23,"language":24},[22],"language-text","\u003Cscript>\nexport default {\n  name: 'Blog',\n  metaInfo: {\n    title: this.$page.blog.title,\n    meta: [\n      {\n        name: 'author',\n        content: this.$page.blog.author.title\n      }\n    ],\n    link: [\n      {\n        rel: 'stylesheet',\n        href: '\u002Fcss\u002Findex.css'\n      }\n    ]\n    \u002F\u002F etc...\n  }\n}\n\u003C\u002Fscript>\n","text",[26,27,23],"code",{"__ignoreMap":28},"",[15,30,31],{},"metaInfoの中身はただのハッシュなので、サンプルを見ながらやればすぐに理解できます。ちなみに、metaInfoという名前ですが、meta以外のHTMLヘッダも変更可能です。",[15,33,34],{},"Gridsomeのtemplateとpageでは、処理設定内で「this」でGridsomeのデータにアクセスが出来るので、GraphQLで取得してきたデータは全て利用可能です。",[15,36,37],{},"動的に変更されたmetaなどのHTMLヘッダの中身は、ビルド時にしっかりとHTMLに記述されるので、SEO的にも安心です。",{"title":28,"searchDepth":39,"depth":39,"links":40},2,[41],{"id":13,"depth":39,"text":13},"website-building","2021-04-02T07:00:00.000Z","Gridsomeでmetaの内容を動的に変更するにはどうやる？","md","ja",{},true,"\u002F20210402000000-gridsomemeta",{"title":5,"description":44},"9ff2c480424d00c97b9044846bca5e03","20210402000000-Gridsomeでmetaの内容を動的に変更するには？",[54],"gridsome","DClNdl5lcKPdifkovknMb-DBWpr0M3Pz-LfXtYZHhk8",{"id":57,"title":58,"body":59,"date":63,"description":64,"extension":45,"locale":46,"meta":65,"name":68,"navigation":48,"path":69,"seo":70,"slug":6,"stem":6,"updated":63,"__hash__":71},"legacyAuthors\u002Fkoji-kadoma.md","Koji Kadoma",{"type":8,"value":60,"toc":61},[],{"title":28,"searchDepth":39,"depth":39,"links":62},[],"2021-04-01T00:00:00.000Z","Webエンジニアです。Javascript、PHP、Ruby、Dockerなどをメインで使っています。",{"image":66,"url":67},"https:\u002F\u002Fwww.codit.work\u002Fimgs\u002Favatar\u002Fkoji-kadoma.png","https:\u002F\u002Fkoji.pages.dev\u002F",null,"\u002Fkoji-kadoma",{"title":58,"description":64},"H1yaGicrsv1CzYTbFeEXQosuYx93lIutD3_XwXMhAFk",{"id":73,"title":74,"body":75,"date":63,"description":74,"extension":45,"locale":46,"meta":79,"navigation":48,"path":80,"seo":81,"slug":42,"stem":42,"updated":63,"__hash__":82},"legacyCategories\u002Fwebsite-building.md","Webサイト構築",{"type":8,"value":76,"toc":77},[],{"title":28,"searchDepth":39,"depth":39,"links":78},[],{},"\u002Fwebsite-building",{"title":74,"description":74},"h9jPLD2mzMm3L4sFN5qWSiSirySQQLdnxLhQcvw8VlQ",1783320301515]