{"id":111494,"date":"2019-02-16T17:00:00","date_gmt":"2019-02-16T17:00:00","guid":{"rendered":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/"},"modified":"2026-04-08T09:03:33","modified_gmt":"2026-04-08T02:03:33","slug":"insert-a-layout-collection-and-blog-to-a-static-site","status":"publish","type":"post","link":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/","title":{"rendered":"Insert a Layout, Collection and Blog to a Static Site"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">There might be instances where you need to integrate elements like layouts, collections, and blogs&nbsp;into a static site within your Shopify environment. This could be for creating custom landing pages, unique content sections, or even integrating a blog within a specific page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide will convert a free HTML 5 template into a Jekyll site, offering a blend of customization and code editing techniques to solve your problems in a few minutes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s get started!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Related Posts:<\/em><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/avada.io\/blog\/how-add-select-conditions-for-automated-collection-shopify\">How to add selection conditions for an automated collection on Shopify<\/a><\/li>\n\n\n\n<li>How to insert Disqus to your blog in Shopify<\/li>\n\n\n\n<li><a href=\"https:\/\/avada.io\/blog\/insert-breadcrumb-navigation-to-your-store\">How to insert breadcrumb navigation to your store in Shopify<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-insert-a-layout-collection-and-blog-to-a-static-site\">How to insert a layout, collection, and blog to a static site<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#setup\"><strong>1. Setup<\/strong><\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#step-1-download-and-setup-your-theme\">Step 1: Download and setup your theme<\/a><\/li>\n\n\n\n<li><a href=\"#step-2-open-your-site\">Step 2: Open your site<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#layouts\"><strong>2. Layouts<\/strong><\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#step-1-create\">Step 1: Create <code class=\"language-plaintext highlighter-rouge\">\/_layouts\/default.html<\/code><\/a><\/li>\n\n\n\n<li><a href=\"#step-2-remove-html-content\">Step 2: Remove the HTML content<\/a><\/li>\n\n\n\n<li><a href=\"#step-3-fix-up-other-pages\">Step 3: Fix up the other pages<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#collection\"><strong>3. Collection<\/strong><\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#step-1-create-config\">Step 1: Create <code class=\"language-plaintext highlighter-rouge\">_config.yml<\/code> and set up a collection<\/a><\/li>\n\n\n\n<li><a href=\"#step-2-create-a-_portfolio-directory-and-add-portfolio-items\">Step 2: Create a <code class=\"language-plaintext highlighter-rouge\">_portfolio<\/code> directory and add portfolio items<\/a><\/li>\n\n\n\n<li><a href=\"#step-3-loop-over-collection-documents-and-output-item-details\">Step 3: Loop over collection documents and output item details<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#blogging\"><strong>4. Blogging<\/strong><\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#step-1-create-a-layout-for-the-posts\">Step 1: Create a layout for the posts<\/a><\/li>\n\n\n\n<li><a href=\"#step-2-create-the-post\">Step 2: Create the post<\/a><\/li>\n\n\n\n<li><a href=\"#step-3-create-blog.html\">Step 3: Create <code class=\"language-plaintext highlighter-rouge\">blog.html<\/code><\/a><\/li>\n\n\n\n<li><a href=\"#step-4-add-link-to-\/blog.html\">Step 4: Add link to <code class=\"language-plaintext highlighter-rouge\">\/blog.html<\/code><\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"setup\">1. Setup<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step1-download-and-setup-your-theme\">Step 1: Download and setup your theme<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In this instruction, we will be using the theme called Creative. After the <a href=\"https:\/\/github.com\/CloudCannon\/creative-jekyll-theme\/archive\/static-site.zip\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">theme Creative is downloaded<\/a>, you have to unzip it, navigate to the directory in the terminal then run <code class=\"language-plaintext highlighter-rouge\">jekyll serve<\/code>.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>$ cd ~\/Downloads\/creative # or wherever you've unzipped the template\n$ jekyll serve\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-2-open-your-site\">Step 2: Open your site<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To open and see your site, open your browser then navigate to http:\/\/localhost:4000 .<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn4.avada.io\/media\/shopify\/aJtWmiS.jpg\" alt=\"open your site\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"layouts\">2. Layouts<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since it\u2019s a four-page static site and the header, navigation, and footer of each page are repeated, we need to reduce this repetition with a <a href=\"https:\/\/learn.cloudcannon.com\/jekyll\/introduction-to-jekyll-layouts\/\" rel=\"nofollow\">layout<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-1-create\">Step 1: Create <code class=\"language-plaintext highlighter-rouge\">\/_layouts\/default.html<\/code><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In this step, the first thing to do is to create <code class=\"language-plaintext highlighter-rouge\">\/_layouts\/default.html<\/code> and copy the contents of <code class=\"language-plaintext highlighter-rouge\">index.html<\/code> into it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, replace the content in the layout that changes between pages with placeholder variable. You also need to replace all the contents of <code class=\"language-plaintext highlighter-rouge\">&lt;title&gt;<\/code> with <code class=\"language-plaintext highlighter-rouge\">{{ page.title }}<\/code>, which helps you to easily change it on each page.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"utf-8\"&gt;\n    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"&gt;\n    &lt;meta name=\"description\" content=\"\"&gt;\n    &lt;meta name=\"author\" content=\"\"&gt;\n    &lt;title&gt;Creative - {{ page.title }}&lt;\/title&gt;\n    &lt;!-- Bootstrap Core CSS --&gt;\n    &lt;link rel=\"stylesheet\" href=\"\/css\/bootstrap.min.css\" type=\"text\/css\"&gt;\n    &lt;!-- Custom Fonts --&gt;\n    &lt;link href='http:\/\/fonts.googleapis.com\/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text\/css'&gt;\n    &lt;link href='http:\/\/fonts.googleapis.com\/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text\/css'&gt;\n    &lt;link rel=\"stylesheet\" href=\"\/font-awesome\/css\/font-awesome.min.css\" type=\"text\/css\"&gt;\n    &lt;!-- Custom CSS --&gt;\n    &lt;link rel=\"stylesheet\" href=\"\/css\/creative.css\" type=\"text\/css\"&gt;\n    &lt;!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --&gt;\n    &lt;!--[if lt IE 9]&gt;\n    &lt;script src=\"https:\/\/oss.maxcdn.com\/libs\/html5shiv\/3.7.0\/html5shiv.js\"&gt;&lt;\/script&gt;\n    &lt;script src=\"https:\/\/oss.maxcdn.com\/libs\/respond.js\/1.4.2\/respond.min.js\"&gt;&lt;\/script&gt;\n    &lt;![endif]--&gt;\n  &lt;\/head&gt;\n  &lt;body id=\"page-top\"&gt;\n    &lt;nav id=\"mainNav\" class=\"navbar navbar-default navbar-fixed-top\"&gt;\n      &lt;div class=\"container-fluid\"&gt;\n        &lt;!-- Brand and toggle get grouped for better mobile display --&gt;\n        &lt;div class=\"navbar-header\"&gt;\n          &lt;button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\"&gt;\n          &lt;span class=\"sr-only\"&gt;Toggle navigation&lt;\/span&gt;\n          &lt;span class=\"icon-bar\"&gt;&lt;\/span&gt;\n          &lt;span class=\"icon-bar\"&gt;&lt;\/span&gt;\n          &lt;span class=\"icon-bar\"&gt;&lt;\/span&gt;\n          &lt;\/button&gt;\n          &lt;a class=\"navbar-brand page-scroll\" href=\"\/\"&gt;Start Bootstrap&lt;\/a&gt;\n        &lt;\/div&gt;\n        &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;\n        &lt;div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\"&gt;\n          &lt;ul class=\"nav navbar-nav navbar-right\"&gt;\n            &lt;li&gt;\n              &lt;a href=\"\/about.html\"&gt;About&lt;\/a&gt;\n            &lt;\/li&gt;\n            &lt;li&gt;\n              &lt;a href=\"\/services.html\"&gt;Services&lt;\/a&gt;\n            &lt;\/li&gt;\n            &lt;li&gt;\n              &lt;a href=\"\/portfolio.html\"&gt;Portfolio&lt;\/a&gt;\n            &lt;\/li&gt;\n          &lt;\/ul&gt;\n        &lt;\/div&gt;\n        &lt;!-- \/.navbar-collapse --&gt;\n      &lt;\/div&gt;\n      &lt;!-- \/.container-fluid --&gt;\n    &lt;\/nav&gt;\n    {{ content }}\n    &lt;section id=\"contact\"&gt;\n      &lt;div class=\"container\"&gt;\n        &lt;div class=\"row\"&gt;\n          &lt;div class=\"col-lg-8 col-lg-offset-2 text-center\"&gt;\n            &lt;h2 class=\"section-heading\"&gt;Let's Get In Touch!&lt;\/h2&gt;\n            &lt;hr class=\"primary\"&gt;\n            &lt;p&gt;Ready to start your next project with us? That's great! Give us a call or send us an email and we will get back to you as soon as possible!&lt;\/p&gt;\n          &lt;\/div&gt;\n          &lt;div class=\"col-lg-4 col-lg-offset-2 text-center\"&gt;\n            &lt;i class=\"fa fa-phone fa-3x wow bounceIn\"&gt;&lt;\/i&gt;\n            &lt;p&gt;123-456-6789&lt;\/p&gt;\n          &lt;\/div&gt;\n          &lt;div class=\"col-lg-4 text-center\"&gt;\n            &lt;i class=\"fa fa-envelope-o fa-3x wow bounceIn\" data-wow-delay=\".1s\"&gt;&lt;\/i&gt;\n            &lt;p&gt;&lt;a href=\"mailto:your-email@your-domain.com\"&gt;feedback@startbootstrap.com&lt;\/a&gt;&lt;\/p&gt;\n          &lt;\/div&gt;\n        &lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/section&gt;\n    &lt;!-- jQuery --&gt;\n    &lt;script src=\"\/js\/jquery.js\"&gt;&lt;\/script&gt;\n    &lt;!-- Bootstrap Core JavaScript --&gt;\n    &lt;script src=\"\/js\/bootstrap.min.js\"&gt;&lt;\/script&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-2-remove-html-content\">Step 2: Remove the HTML content<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you are now able to load the default layout on <code class=\"language-plaintext highlighter-rouge\">index.html<\/code> and set a title in the front matter. After that, you can remove the HTML content in the layout.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n---\nlayout: default\ntitle: A Bootstrap theme\n---\n&lt;header&gt;\n  &lt;div class=\"header-content\"&gt;\n    &lt;div class=\"header-content-inner\"&gt;\n      &lt;h1&gt;Your Favorite Source of Free Bootstrap Themes&lt;\/h1&gt;\n      &lt;hr&gt;\n      &lt;p&gt;Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!&lt;\/p&gt;\n      &lt;a href=\"\/about.html\" class=\"btn btn-primary btn-xl page-scroll\"&gt;Find Out More&lt;\/a&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/header&gt;\n&lt;aside class=\"bg-dark\"&gt;\n  &lt;div class=\"container text-center\"&gt;\n    &lt;div class=\"call-to-action\"&gt;\n      &lt;h2&gt;Free Download at Start Bootstrap!&lt;\/h2&gt;\n      &lt;a href=\"\/services.html\" class=\"btn btn-default btn-xl wow tada\"&gt;Download Now!&lt;\/a&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/aside&gt;\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-3-fix-up-other-pages\">Step 3: Fix up the other pages<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In this step, you have to fix up <code class=\"language-plaintext highlighter-rouge\">about.html<\/code>, <code class=\"language-plaintext highlighter-rouge\">services.html<\/code>, and <code class=\"language-plaintext highlighter-rouge\">portfolio.html<\/code> which all have a block of HTML for the heading.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n...\n&lt;section class=\"bg-dark\"&gt;\n  &lt;div class=\"text-center\"&gt;\n    &lt;h1&gt;About&lt;\/h1&gt;\n  &lt;\/div&gt;\n&lt;\/section&gt;\n...\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn4.avada.io\/media\/shopify\/Ot7vIV7.jpg\" alt=\"fix up other pages\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So as to reduce the repetition in the source code of every page, creating another layout that inherits from the <code class=\"language-plaintext highlighter-rouge\">_layouts\/default.html<\/code> is the next thing you should do.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Following the content below, let\u2019s create <code class=\"language-plaintext highlighter-rouge\">_layouts\/page.html<\/code>.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n---\nlayout: default\n---\n&lt;section class=\"bg-dark\"&gt;\n  &lt;div class=\"text-center\"&gt;\n    &lt;h1&gt;{{ page.title }}&lt;\/h1&gt;\n  &lt;\/div&gt;\n&lt;\/section&gt;\n\n{{ content }}\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">This layout can now be used in <code class=\"language-plaintext highlighter-rouge\">about.html<\/code>, <code class=\"language-plaintext highlighter-rouge\">services.html<\/code> and <code class=\"language-plaintext highlighter-rouge\">portfolio.html<\/code> without repeating source code. This is an example of how <code class=\"language-plaintext highlighter-rouge\">about.html<\/code> looks like:<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n---\nlayout: page\ntitle: About\n---\n&lt;section class=\"bg-primary\" id=\"about\"&gt;\n  &lt;div class=\"container\"&gt;\n    &lt;div class=\"row\"&gt;\n      &lt;div class=\"col-lg-8 col-lg-offset-2 text-center\"&gt;\n        &lt;h2 class=\"section-heading\"&gt;We've got what you need!&lt;\/h2&gt;\n        &lt;hr class=\"light\"&gt;\n        &lt;p class=\"text-faded\"&gt;Start Bootstrap has everything you need to get your new website up and running in no time! All of the templates and themes on Start Bootstrap are open source, free to download, and easy to use. No strings attached!&lt;\/p&gt;\n        &lt;a href=\"#\" class=\"btn btn-default btn-xl\"&gt;Get Started!&lt;\/a&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/section&gt;\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"collection\">3. Collection<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In <code class=\"language-plaintext highlighter-rouge\">portfolio.html<\/code>, each portfolio item has an image, category and project name, and the rest of the code is repeated. To avoid repeating the code, we use a <a href=\"https:\/\/learn.cloudcannon.com\/jekyll\/introduction-to-jekyll-collections\/\" rel=\"nofollow\">collection<\/a>.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>&lt;div class=\"col-lg-4 col-sm-6\"&gt;\n  &lt;a href=\"#\" class=\"portfolio-box\"&gt;\n    &lt;img src=\"\/img\/portfolio\/1.jpg\" class=\"img-responsive\" alt=\"\"&gt;\n    &lt;div class=\"portfolio-box-caption\"&gt;\n      &lt;div class=\"portfolio-box-caption-content\"&gt;\n        &lt;div class=\"project-category text-faded\"&gt;\n          Category\n        &lt;\/div&gt;\n        &lt;div class=\"project-name\"&gt;\n          Project Name\n        &lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/a&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-1-create-config\">Step 1: Create <code class=\"language-plaintext highlighter-rouge\">_config.yml<\/code> and set up a collection<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The first thing to do is to create <code class=\"language-plaintext highlighter-rouge\">_config.yml<\/code> and set up a collection.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>collections:\n  portfolio:\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Keep in mind that when updating <code class=\"language-plaintext highlighter-rouge\">_config.yml<\/code>, you have to restart Jekyll so that the changes take effect.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-2-create-a-portfolio-directory-and-add-portfolio-items\">Step 2: Create a <code class=\"language-plaintext highlighter-rouge\">_portfolio<\/code> directory and add portfolio items<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">After creating <code class=\"language-plaintext highlighter-rouge\">_config.yml<\/code> and setting up a collection, you can now create a <code class=\"language-plaintext highlighter-rouge\">_portfolio<\/code> directory and add six portfolio items. Each portfolio item includes <code class=\"language-plaintext highlighter-rouge\">image_path<\/code>, <code class=\"language-plaintext highlighter-rouge\">category<\/code>, <code class=\"language-plaintext highlighter-rouge\">link<\/code>, and <code class=\"language-plaintext highlighter-rouge\">project_name<\/code> in the front matter. This is an example of a portfolio item for work that we did for Google &#8211; <code class=\"language-plaintext highlighter-rouge\">_portfolio\/google.md<\/code>.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n---\nimage_path: \/img\/portfolio\/1.jpg\ncategory: Web Design\nproject_name: Google\nlink: https:\/\/google.com\n---\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-3-loop-over-collection-documents-and-output-item-details\">Step 3: Loop over collection documents and output item details<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To finish adding a collection, you need to iterate over the collection documents and output item details in <code class=\"language-plaintext highlighter-rouge\">\/portfolio.html<\/code>.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n---\nlayout: page\ntitle: Portfolio\n---\n&lt;section class=\"no-padding\" id=\"portfolio\"&gt;\n  &lt;div class=\"container-fluid\"&gt;\n    &lt;div class=\"row no-gutter\"&gt;\n      {% for item in site.portfolio %}\n        &lt;div class=\"col-lg-4 col-sm-6\"&gt;\n          &lt;a href=\"{{ item.link }}\" class=\"portfolio-box\"&gt;\n            &lt;img src=\"{{ item.image_path }}\" class=\"img-responsive\" alt=\"{{ item.project_name }}\"&gt;\n            &lt;div class=\"portfolio-box-caption\"&gt;\n              &lt;div class=\"portfolio-box-caption-content\"&gt;\n                &lt;div class=\"project-category text-faded\"&gt;\n                  {{ item.category }}\n                &lt;\/div&gt;\n                &lt;div class=\"project-name\"&gt;\n                  {{ item.project_name }}\n                &lt;\/div&gt;\n              &lt;\/div&gt;\n            &lt;\/div&gt;\n          &lt;\/a&gt;\n        &lt;\/div&gt;\n      {% endfor %}\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/section&gt;\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn4.avada.io\/media\/shopify\/nUUFnfq.jpg\" alt=\"collection\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"blogging\">4. Blogging<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This section is the instruction on how to insert a <a href=\"https:\/\/learn.cloudcannon.com\/jekyll\/introduction-to-jekyll-collections\/\">blog<\/a> to your website.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-1-create-a-layout-for-the-posts\">Step 1: Create a layout for the posts<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">First, you need to create <code class=\"language-plaintext highlighter-rouge\">\/_layouts\/post.htm<\/code> and insert some basic HTML, which helps you to format the content.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n---\nlayout: page\n---\n&lt;section id=\"contact\"&gt;\n  &lt;div class=\"container\"&gt;\n    &lt;div class=\"col-md-6 col-md-offset-3\"&gt;\n      {{ content }}\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/section&gt;\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-2-create-the-post\">Step 2: Create the post<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Next, create the first post <code class=\"language-plaintext highlighter-rouge\">\/_posts\/2016-06-01-first-post.md<\/code><\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n---\nlayout: post\ntitle: My First Post\n---\nYou'll find this post in your `_posts` directory. Go ahead and edit it and re-build\nthe site to see your changes. You can rebuild the site in many different ways, but\nthe most common way is to run `jekyll serve`, which launches a web server and\nauto-regenerates your site when a file is updated.\n\nTo add new posts, simply add a file in the `_posts` directory that follows the\nconvention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter.\nTake a look at the source for this post to get an idea about how it works.\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-3-create-blog.html\">Step 3: Create <code class=\"language-plaintext highlighter-rouge\">blog.html<\/code><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In order to list all your post, create <code class=\"language-plaintext highlighter-rouge\">blog.html<\/code><\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>\n---\nlayout: page\ntitle: Blog\n---\n&lt;section&gt;\n  &lt;div class=\"container\"&gt;\n    &lt;div class=\"row\"&gt;\n      &lt;div class=\"text-center\"&gt;\n        &lt;ul style=\"list-style-position: inside\"&gt;\n           {% for post in site.posts %}\n             &lt;li&gt;\n               &lt;a href=\"{{ post.url }}\"&gt;{{ post.title }}&lt;\/a&gt;\n               - {{ post.date | date: \"%d %B %Y\" }}\n             &lt;\/li&gt;\n           {% endfor %}\n        &lt;\/ul&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/section&gt;\n\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"step-4-add-link-to-bloghtml-step-4-add-link-to-bloghtml\">Step 4: Add link to <code class=\"language-plaintext highlighter-rouge\">\/blog.html<\/code> {#step-4-add-link-to-\/blog.html}<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In the navigation on <code class=\"language-plaintext highlighter-rouge\">\/_layouts\/default.html<\/code>, insert link to <code class=\"language-plaintext highlighter-rouge\">\/blog.html<\/code> and your work are done.<\/p>\n\n\n\n<div class=\"language-plaintext highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>...\n&lt;li&gt;\n  &lt;a href=\"\/blog.html\"&gt;Blog&lt;\/a&gt;\n&lt;\/li&gt;\n...\n<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">All the posts are listed on blog page.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn4.avada.io\/media\/shopify\/chHqP1b.jpg\" alt=\"post\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To see the entire post, please click on a link.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn4.avada.io\/media\/shopify\/MhxgUA4.jpg\" alt=\"entire post\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now&nbsp;<span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">that you know&nbsp;<strong>how to insert a layout, collection, and blog to a static site<\/strong>, we hope that you can easily manipulate those above steps and make your site significantly more maintainable with Jekyll. If you want to improve your site even further, here are some recommendations: improving the navigation,&nbsp;inserting an RSS feed,&nbsp;<a href=\"https:\/\/avada.io\/blog\/insert-the-search-box-on-your-jekyll-site-using-lunr-js\" target=\"_blank\" rel=\"noopener\">inserting search<\/a>,&nbsp;and<\/span>inserting an estimated read time to posts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There might be instances where you need to integrate elements like layouts, collections, and blogs&nbsp;into a static site within your Shopify environment. This could be for creating custom landing pages, unique content sections, or even integrating a blog within a specific page. This guide will convert a free HTML 5 template into a Jekyll site, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[356,383],"tags":[],"class_list":["post-111494","post","type-post","status-publish","format-standard","hentry","category-shopify","category-shopify-devdocs"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Insert a Layout, Collection and Blog to a Static Site in Shopify<\/title>\n<meta name=\"description\" content=\"Learn how to insert a layout, collection, and blog to a static site on Shopify, creating a more dynamic and engaging experience for your visitors.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Insert a Layout, Collection and Blog to a Static Site in Shopify\" \/>\n<meta property=\"og:description\" content=\"Learn how to insert a layout, collection, and blog to a static site on Shopify, creating a more dynamic and engaging experience for your visitors.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/\" \/>\n<meta property=\"og:site_name\" content=\"Avada Commerce\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/avada.io\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-16T17:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-08T02:03:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn4.avada.io\/media\/shopify\/aJtWmiS.jpg\" \/>\n<meta name=\"author\" content=\"Sam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@avadaio\" \/>\n<meta name=\"twitter:site\" content=\"@avadaio\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Insert a Layout, Collection and Blog to a Static Site in Shopify","description":"Learn how to insert a layout, collection, and blog to a static site on Shopify, creating a more dynamic and engaging experience for your visitors.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/","og_locale":"en_US","og_type":"article","og_title":"How to Insert a Layout, Collection and Blog to a Static Site in Shopify","og_description":"Learn how to insert a layout, collection, and blog to a static site on Shopify, creating a more dynamic and engaging experience for your visitors.","og_url":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/","og_site_name":"Avada Commerce","article_publisher":"https:\/\/www.facebook.com\/avada.io\/","article_published_time":"2019-02-16T17:00:00+00:00","article_modified_time":"2026-04-08T02:03:33+00:00","og_image":[{"url":"https:\/\/cdn4.avada.io\/media\/shopify\/aJtWmiS.jpg","type":"","width":"","height":""}],"author":"Sam","twitter_card":"summary_large_image","twitter_creator":"@avadaio","twitter_site":"@avadaio","twitter_misc":{"Written by":"Sam","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/#article","isPartOf":{"@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/"},"author":{"name":"Sam","@id":"https:\/\/avada.io\/#\/schema\/person\/cc9c647e3ec94d00dc61ae2e653cafb7"},"headline":"Insert a Layout, Collection and Blog to a Static Site","datePublished":"2019-02-16T17:00:00+00:00","dateModified":"2026-04-08T02:03:33+00:00","mainEntityOfPage":{"@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/"},"wordCount":761,"publisher":{"@id":"https:\/\/avada.io\/#organization"},"image":{"@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn4.avada.io\/media\/shopify\/aJtWmiS.jpg","articleSection":["Shopify","Shopify Devdocs"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/","url":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/","name":"How to Insert a Layout, Collection and Blog to a Static Site in Shopify","isPartOf":{"@id":"https:\/\/avada.io\/#website"},"primaryImageOfPage":{"@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/#primaryimage"},"image":{"@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn4.avada.io\/media\/shopify\/aJtWmiS.jpg","datePublished":"2019-02-16T17:00:00+00:00","dateModified":"2026-04-08T02:03:33+00:00","description":"Learn how to insert a layout, collection, and blog to a static site on Shopify, creating a more dynamic and engaging experience for your visitors.","breadcrumb":{"@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/#primaryimage","url":"https:\/\/cdn4.avada.io\/media\/shopify\/aJtWmiS.jpg","contentUrl":"https:\/\/cdn4.avada.io\/media\/shopify\/aJtWmiS.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/avada.io\/blog\/insert-a-layout-collection-and-blog-to-a-static-site\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/avada.io\/"},{"@type":"ListItem","position":2,"name":"Shopify","item":"https:\/\/avada.io\/category\/shopify"},{"@type":"ListItem","position":3,"name":"Shopify Devdocs","item":"https:\/\/avada.io\/category\/shopify-devdocs\/"},{"@type":"ListItem","position":4,"name":"Insert a Layout, Collection and Blog to a Static Site"}]},{"@type":"WebSite","@id":"https:\/\/avada.io\/#website","url":"https:\/\/avada.io\/","name":"Avada Commerce","description":"Blog","publisher":{"@id":"https:\/\/avada.io\/#organization"},"alternateName":"Avada Commerce","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/avada.io\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/avada.io\/#organization","name":"Avada Commerce","alternateName":"Avada Commerce","url":"https:\/\/avada.io\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/avada.io\/#\/schema\/logo\/image\/","url":"https:\/\/avada.io\/wp-content\/uploads\/2023\/06\/Avada-logo.jpeg","contentUrl":"https:\/\/avada.io\/wp-content\/uploads\/2023\/06\/Avada-logo.jpeg","width":1200,"height":1200,"caption":"Avada Commerce"},"image":{"@id":"https:\/\/avada.io\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/avada.io\/","https:\/\/x.com\/avadaio","https:\/\/www.youtube.com\/@avadaio","https:\/\/www.linkedin.com\/company\/avadacommerce"]},{"@type":"Person","@id":"https:\/\/avada.io\/#\/schema\/person\/cc9c647e3ec94d00dc61ae2e653cafb7","name":"Sam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/fdce01bbdb8b8eaa162f8ed372062707058abcd85e8b233af7cb4e01191c75f4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/fdce01bbdb8b8eaa162f8ed372062707058abcd85e8b233af7cb4e01191c75f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fdce01bbdb8b8eaa162f8ed372062707058abcd85e8b233af7cb4e01191c75f4?s=96&d=mm&r=g","caption":"Sam"},"description":"Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Vietnam. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.","sameAs":["https:\/\/wordpress-466542-3512282.cloudwaysapps.com","https:\/\/vn.linkedin.com\/in\/samng80"],"url":"https:\/\/avada.io\/authors\/sam\/"}]}},"meta_title":"How to Insert a Layout, Collection and Blog to a Static Site in Shopify","meta_description":"Learn how to insert a layout, collection, and blog to a static site on Shopify, creating a more dynamic and engaging experience for your visitors.","meta_keywords":"Insert a Layout, Collection and Blog to a Static Site Shopify","feature_image_custom":"","updated_at_migrate":"2019-02-17T00:00:00+07:00","_links":{"self":[{"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/posts\/111494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/comments?post=111494"}],"version-history":[{"count":5,"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/posts\/111494\/revisions"}],"predecessor-version":[{"id":158981,"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/posts\/111494\/revisions\/158981"}],"wp:attachment":[{"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/media?parent=111494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/categories?post=111494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avada.io\/wp-json\/wp\/v2\/tags?post=111494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}