{"componentChunkName":"component---src-templates-blog-post-js","path":"/2019-08-22-gridsome/","webpackCompilationHash":"da658d138a5c02dfedf3","result":{"data":{"site":{"siteMetadata":{"title":"八王子わんにゃんクラブ","author":"technology unit of JOHAQ.COM.","siteUrl":"https://svc-802-wannyan-club.johaq.com","keywords":["八王子わんにゃんクラブ"],"disqusShortname":"johaq-com"}},"markdownRemark":{"id":"6f54c3ad-6ea3-528a-ab5a-bc8bde051055","excerpt":"Gridsomeはvue.jsベースのサイト生成ツールです。コンテンツのソースはHeadless CMSやAPIを使用したり、Markdown形式のファイルを使用することもできます。また、生成自体はNetlifyなどが提供するCIを活用し、github…","timeToRead":2,"html":"<blockquote>\n<p> Gridsomeはvue.jsベースのサイト生成ツールです。コンテンツのソースはHeadless CMSやAPIを使用したり、Markdown形式のファイルを使用することもできます。また、生成自体はNetlifyなどが提供するCIを活用し、github等で管理しているドキュメントの更新をトリガーに自動で更新する仕組みも実現しています。</p>\n</blockquote>\n<h3 id=\"why-gridsome\"><a href=\"#why-gridsome\" aria-label=\"why gridsome permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Gridsome?</h3>\n<ul>\n<li><strong>Local development with hot-reloading</strong> - See code changes in real-time.</li>\n<li><strong>Data source plugins</strong> - Use it for any popular Headless CMSs, APIs or Markdown-files.</li>\n<li><strong>File-based page routing</strong> - Quickly create and manage routes with files.</li>\n<li><strong>Centralized data managment</strong> - Pull data into a local, unified GraphQL data layer.</li>\n<li><strong>Vue.js for frontend</strong> - A lightweight and approachable front-end framework.</li>\n<li><strong>Auto-optimized code</strong> - Get code-splitting and asset optimization out-of-the-box.</li>\n<li><strong>Static files generation</strong> - Deploy securely to any CDN or static web host.</li>\n</ul>\n<p><a href=\"/docs/how-it-works\">Learn more about how Gridsome works</a></p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-js line-numbers\"><code class=\"language-js\"><span class=\"token operator\">&lt;</span>template<span class=\"token operator\">></span>\n  <span class=\"token operator\">&lt;</span>Layout<span class=\"token operator\">></span>\n    <span class=\"token operator\">&lt;</span>div <span class=\"token keyword\">class</span><span class=\"token operator\">=</span><span class=\"token string\">\"container-inner mx-auto my-16\"</span><span class=\"token operator\">></span>\n      <span class=\"token operator\">&lt;</span>h1 <span class=\"token keyword\">class</span><span class=\"token operator\">=</span><span class=\"token string\">\"text-4xl font-bold leading-tight\"</span><span class=\"token operator\">></span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span> $page<span class=\"token punctuation\">.</span>post<span class=\"token punctuation\">.</span>title <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span><span class=\"token operator\">&lt;</span><span class=\"token operator\">/</span>h1<span class=\"token operator\">></span>\n      <span class=\"token operator\">&lt;</span>div <span class=\"token keyword\">class</span><span class=\"token operator\">=</span><span class=\"token string\">\"text-xl text-gray-600 mb-8\"</span><span class=\"token operator\">></span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span> $page<span class=\"token punctuation\">.</span>post<span class=\"token punctuation\">.</span>date <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span><span class=\"token operator\">&lt;</span><span class=\"token operator\">/</span>div<span class=\"token operator\">></span>\n      <span class=\"token operator\">&lt;</span>div <span class=\"token keyword\">class</span><span class=\"token operator\">=</span><span class=\"token string\">\"markdown-body\"</span> v<span class=\"token operator\">-</span>html<span class=\"token operator\">=</span><span class=\"token string\">\"$page.post.content\"</span> <span class=\"token operator\">/</span><span class=\"token operator\">></span>\n    <span class=\"token operator\">&lt;</span><span class=\"token operator\">/</span>div<span class=\"token operator\">></span>\n  <span class=\"token operator\">&lt;</span><span class=\"token operator\">/</span>Layout<span class=\"token operator\">></span>\n<span class=\"token operator\">&lt;</span><span class=\"token operator\">/</span>template<span class=\"token operator\">></span></code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></pre></div>\n<h3 id=\"prerequisites\"><a href=\"#prerequisites\" aria-label=\"prerequisites permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Prerequisites</h3>\n<p>You should have basic knowledge about HTML, CSS, <a href=\"https://vuejs.org\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Vue.js</a> and how to use the <a href=\"https://www.linode.com/docs/tools-reference/tools/using-the-terminal/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Terminal</a>. Knowing how <a href=\"https://vuejs.org/v2/guide/single-file-components.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Vue Single File components</a> &#x26; <a href=\"https://www.graphql.com/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">GraphQL</a> works is a plus, but not required. Gridsome is a great way to learn both.</p>\n<p>Gridsome requires <strong>Node.js</strong> and recommends <strong>Yarn</strong>. <a href=\"/docs/prerequisites\">How to setup</a></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; flex:2; max-width: 1280px;\"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 56.25%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAIGBAX/xAAVAQEBAAAAAAAAAAAAAAAAAAABAv/aAAwDAQACEAMQAAABTVwnShJkK//EABoQAAICAwAAAAAAAAAAAAAAAAABAgMEERP/2gAIAQEAAQUChkCvidahDb0f/8QAFxEAAwEAAAAAAAAAAAAAAAAAAAEREv/aAAgBAwEBPwGs0z//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAaEAACAgMAAAAAAAAAAAAAAAAAAQIgITEy/9oACAEBAAY/AuEZizdP/8QAHBAAAgICAwAAAAAAAAAAAAAAAAERIRAxUYGx/9oACAEBAAE/IUxfUx/xHJEYSq94/9oADAMBAAIAAwAAABDXD//EABcRAQADAAAAAAAAAAAAAAAAAAARQWH/2gAIAQMBAT8Qitu//8QAFhEAAwAAAAAAAAAAAAAAAAAAAAER/9oACAECAQE/EIiI/8QAHRABAAICAgMAAAAAAAAAAAAAAQARIUFRYaGxwf/aAAgBAQABPxAwGvLniYw3av7CoyXS0+4huExS1NRy25XbP//Z'); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n        <source\n          srcset=\"/static/9623040e05af8072592f22db9a52345a/0b867/background.webp 350w,\n/static/9623040e05af8072592f22db9a52345a/eb16a/background.webp 700w,\n/static/9623040e05af8072592f22db9a52345a/3ea92/background.webp 1280w\"\n          sizes=\"(max-width: 1280px) 100vw, 1280px\"\n          type=\"image/webp\"\n        />\n        <source\n          srcset=\"/static/9623040e05af8072592f22db9a52345a/3a2a3/background.jpg 350w,\n/static/9623040e05af8072592f22db9a52345a/67d4f/background.jpg 700w,\n/static/9623040e05af8072592f22db9a52345a/6c315/background.jpg 1280w\"\n          sizes=\"(max-width: 1280px) 100vw, 1280px\"\n          type=\"image/jpeg\"\n        />\n        <img\n          class=\"gatsby-resp-image-image\"\n          src=\"/static/9623040e05af8072592f22db9a52345a/6c315/background.jpg\"\n          alt=\"background\"\n          title=\"background\"\n        />\n      </picture>\n    </span></p>\n<h3 id=\"1-install-gridsome-cli-tool\"><a href=\"#1-install-gridsome-cli-tool\" aria-label=\"1 install gridsome cli tool permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Install Gridsome CLI tool</h3>\n<p>Using yarn:\n<code>yarn global add @gridsome/cli</code></p>\n<p>Using npm:\n<code>npm install --global @gridsome/cli</code></p>\n<h3 id=\"2-create-a-gridsome-project\"><a href=\"#2-create-a-gridsome-project\" aria-label=\"2 create a gridsome project permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Create a Gridsome project</h3>\n<ol>\n<li><code>gridsome create my-gridsome-site</code> to create a new project </li></li>\n<li><code>cd my-gridsome-site</code> to open folder</li>\n<li><code>gridsome develop</code> to start local dev server at <code>http://localhost:8080</code></li>\n<li>Happy coding <span role=\"img\" aria-labelledby=\"party popper\">🎉</span><span role=\"img\" aria-labelledby=\"raising hands\">🙌</span></li>\n</ol>\n<h3 id=\"3-next-steps\"><a href=\"#3-next-steps\" aria-label=\"3 next steps permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>3. Next steps</h3>\n<ol>\n<li>Create <code>.vue</code> components in the <code>/pages</code> directory to create page routes.</li>\n<li>Use <code>gridsome build</code> to generate static files in a <code>/dist</code> folder</li>\n<li><a href=\"/docs/how-it-works\">How it works</a></li>\n<li><a href=\"/docs/pages\">How Pages work</a></li>\n<li><a href=\"/docs/deployment\">How to deploy</a></li>\n</ol>","fields":{"slug":"/2019-08-22-gridsome/"},"frontmatter":{"title":"Introduction to Gridsome","date":"August 22, 2019","published_time":"2019-08-22","description":"Gridsomeはvue.jsベースのサイト生成ツールです。コンテンツのソースはHeadless CMSやAPIを使用したり、Markdown形式のファイルを使用することもできます。また、生成自体はNetlifyなどが提供するCIを活用し、github等で管理しているドキュメントの更新をトリガーに自動で更新する仕組みも実現しています。","tags":["software","product","vue","markdown","gridsome"],"cover":{"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAQBAgX/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAgP/2gAMAwEAAhADEAAAAcy6U1m2JB//xAAZEAADAAMAAAAAAAAAAAAAAAAAAQIQERL/2gAIAQEAAQUC6kVQOozs/8QAFxEBAQEBAAAAAAAAAAAAAAAAAQACEv/aAAgBAwEBPwFwXBf/xAAWEQEBAQAAAAAAAAAAAAAAAAAAERL/2gAIAQIBAT8BrT//xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAY/Al//xAAbEAACAgMBAAAAAAAAAAAAAAAAARGBECExUf/aAAgBAQABPyFeg11xRI026zI//9oADAMBAAIAAwAAABDL3//EABURAQEAAAAAAAAAAAAAAAAAAAEQ/9oACAEDAQE/EFS//8QAFhEBAQEAAAAAAAAAAAAAAAAAAQAR/9oACAECAQE/EBlq/8QAGxAAAwADAQEAAAAAAAAAAAAAAAERITFBUXH/2gAIAQEAAT8Q7TeTct0IOknvQ9wiz9IJRn//2Q==","aspectRatio":2.3333333333333335,"src":"/static/7132e1ecaa29dd534fc8dc790ef09f53/d0c15/blog_bg_1.jpg","srcSet":"/static/7132e1ecaa29dd534fc8dc790ef09f53/74a6a/blog_bg_1.jpg 350w,\n/static/7132e1ecaa29dd534fc8dc790ef09f53/047db/blog_bg_1.jpg 700w,\n/static/7132e1ecaa29dd534fc8dc790ef09f53/d0c15/blog_bg_1.jpg 1024w","srcWebp":"/static/7132e1ecaa29dd534fc8dc790ef09f53/22384/blog_bg_1.webp","srcSetWebp":"/static/7132e1ecaa29dd534fc8dc790ef09f53/e5785/blog_bg_1.webp 350w,\n/static/7132e1ecaa29dd534fc8dc790ef09f53/1b440/blog_bg_1.webp 700w,\n/static/7132e1ecaa29dd534fc8dc790ef09f53/22384/blog_bg_1.webp 1024w","sizes":"(max-width: 1024px) 100vw, 1024px","presentationWidth":1024,"originalImg":"/static/7132e1ecaa29dd534fc8dc790ef09f53/d0c15/blog_bg_1.jpg"}}}}}},"pageContext":{"isCreatedByStatefulCreatePages":false,"slug":"/2019-08-22-gridsome/","previous":{"fields":{"slug":"/you-will-stop-using-localstorage/"},"frontmatter":{"title":"You Will Stop Using LocalStorage"}},"next":{"fields":{"slug":"/2019-08-23-gridsome-graphql/"},"frontmatter":{"title":"[gridsome] Graph QLで複数の問い合わせをページで行うには"}}}}}