<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amie Chen</title>
    <description>The latest articles on DEV Community by Amie Chen (@hyper_yolo).</description>
    <link>https://dev.to/hyper_yolo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F72718%2Fcbee70e7-8266-48e0-bf52-de433461e68d.jpg</url>
      <title>DEV Community: Amie Chen</title>
      <link>https://dev.to/hyper_yolo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hyper_yolo"/>
    <language>en</language>
    <item>
      <title>[Intro] Build a blog with Vuepress, Tailwind and Netlify</title>
      <dc:creator>Amie Chen</dc:creator>
      <pubDate>Tue, 12 Feb 2019 03:43:48 +0000</pubDate>
      <link>https://dev.to/hyper_yolo/intro-build-a-blog-with-vuepress-tailwind-and-netlify-3jlp</link>
      <guid>https://dev.to/hyper_yolo/intro-build-a-blog-with-vuepress-tailwind-and-netlify-3jlp</guid>
      <description>&lt;p&gt;Recently I launched a newer version of my personal website, which uses &lt;a href="https://vuepress.vuejs.org/"&gt;Vuepress&lt;/a&gt; behind the scene. Being a new Vue.js adopter, I thought Vuepress --- a static site generator built on vue.js --- was a natural choice for websites: it's intuitive, performant and flexible with markdown.&lt;/p&gt;

&lt;p&gt;The project is still young(v.1x-alpha as of writing) so there's not a lot of resources beyond the default setup yet. I hope this 3 part walkthrough can help those who are thinking to use Vuepress for their personal websites or blogs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we are going to make
&lt;/h2&gt;

&lt;p&gt;We are going to make a blog with a custom Vuepress theme. You will also learn how to apply some basic Vue.js-fu, incorporate functional css library like tailwind.css and eventually, deploy it to netlify.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/hyper_yolo/part-1-setup-a-working-vuepress-blog-with-tailwindcss-1594"&gt;Part 1: Setup a working Vuepress blog with Tailwind.css&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/hyper_yolo/part-2-write-and-apply-a-custom-vuepress-theme-4n3a"&gt;Part 2: Write and apply a custom Vuepress theme.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/hyper_yolo/part-3-final-wrap-up-and-deploy-to-netlify-2362"&gt;Part 3: Final wrap-up and deploy to netlify.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Vuepress the static site generator
&lt;/h2&gt;

&lt;p&gt;Vuepress is designed to generate documentations, but also works great for personal websites and blogs. It comes with a default "hidden" responsive theme and recommends a specific file structure. However, you can certainly roll your own.&lt;/p&gt;

&lt;h3&gt;
  
  
  v0 v.s v1
&lt;/h3&gt;

&lt;p&gt;There is a big difference between vuepress v.0 and v.1-alpha. The few main updates that I love are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://vuepress.vuejs.org/guide/markdown-slot.html#markdown-slot"&gt;Markdown slot mechnisim.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vuepress.vuejs.org/guide/global-computed.html#global-computed"&gt;Access to global computed properties.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vuepress.vuejs.org/plugin/"&gt;Usage of plugins.&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this whole series we are going to use &lt;strong&gt;the latest v.1x-alpha&lt;/strong&gt;. If you are interested in knowing what's been added to v.1, read more about &lt;a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md"&gt;the changelog here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you are ready, let's start with &lt;a href="https://dev.to/hyper_yolo/part-1-setup-a-working-vuepress-blog-with-tailwindcss-1594"&gt;Part 1: Setup a working Vuepress blog with Tailwind.css&lt;/a&gt; →
&lt;/h2&gt;

&lt;p&gt;This is a cross-post from &lt;a href="https://www.amie-chen.com/blog"&gt;my website&lt;/a&gt;. Check out the original and more there!&lt;/p&gt;

</description>
      <category>vuepress</category>
      <category>vue</category>
      <category>tailwindcss</category>
      <category>netlify</category>
    </item>
    <item>
      <title>[Part 3] Final wrap-up and deploy to netlify</title>
      <dc:creator>Amie Chen</dc:creator>
      <pubDate>Tue, 12 Feb 2019 03:42:07 +0000</pubDate>
      <link>https://dev.to/hyper_yolo/part-3-final-wrap-up-and-deploy-to-netlify-2362</link>
      <guid>https://dev.to/hyper_yolo/part-3-final-wrap-up-and-deploy-to-netlify-2362</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fd63hpoll0toxrq5kqfke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fd63hpoll0toxrq5kqfke.png" alt="hero-image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this last post of the series, we will deploy our Vuepress blog to &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;. I've spruced up the template a little bit by adding more tailwind classes, you can &lt;a href="https://github.com/amiechen/vuepress-blog" rel="noopener noreferrer"&gt;check out the repo on Github&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Local Repository and Netlify Account
&lt;/h2&gt;

&lt;p&gt;Sign up Netlify (if you haven't yet) and link it to your github/gitlab account.&lt;/p&gt;

&lt;p&gt;Then we have to install a local Vuepress as a dependency. &lt;strong&gt;This is important!&lt;/strong&gt; Since the whole tutorial is built with 1x-alpha, we are going to install the latest.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;vuepress@next //mine is on 1.0.0-alpha.37
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add a &lt;code&gt;npm script&lt;/code&gt; to your &lt;strong&gt;package.json&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scripts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vuepress build&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I personally like to test the build before pushing everything to netlify. In your project root directory, run the build command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it builds successfully, we are safe to deploy everything to netlify.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment setup
&lt;/h2&gt;

&lt;p&gt;From your netlify dashboard, click the &lt;strong&gt;New Site from Git&lt;/strong&gt; button on the top right. Select your repo and you should see the a screen for deployment setting. Add some configurations like the screenshot below:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw7wsgj578j3490tpd2tl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw7wsgj578j3490tpd2tl.png" alt="netlify-deployment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Basically, we are telling Netlify to use the alpha vuepress version we installed along with the repo to run the build command, then output to a generated &lt;strong&gt;.dist&lt;/strong&gt; folder. If you have put everything under a &lt;strong&gt;docs&lt;/strong&gt; folder like the documentation did, your build command should be &lt;code&gt;vuepress build dev&lt;/code&gt; and destination folder should be &lt;code&gt;docs/.vuepress/dist&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Hit the deploy button and you should see your site building! Mine is deployed on &lt;a href="https://stupefied-mcclintock-f9c943.netlify.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's it! If you have any question please feel free to drop me a line :D Thanks for following along.&lt;/p&gt;




&lt;p&gt;This is a cross-post from &lt;a href="https://www.amie-chen.com/blog" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. Check out the original and more there!&lt;/p&gt;

</description>
      <category>vuepress</category>
      <category>vue</category>
      <category>tailwindcss</category>
      <category>netlify</category>
    </item>
    <item>
      <title>[Part 2] Write and apply a custom Vuepress theme</title>
      <dc:creator>Amie Chen</dc:creator>
      <pubDate>Tue, 12 Feb 2019 03:41:38 +0000</pubDate>
      <link>https://dev.to/hyper_yolo/part-2-write-and-apply-a-custom-vuepress-theme-4n3a</link>
      <guid>https://dev.to/hyper_yolo/part-2-write-and-apply-a-custom-vuepress-theme-4n3a</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fd63hpoll0toxrq5kqfke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fd63hpoll0toxrq5kqfke.png" alt="hero-image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this part, we are going to write some components for your theme with vue.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  0. Setup some dummy blog posts
&lt;/h2&gt;

&lt;p&gt;Let's add a few sample markdown files first. I have made some for you to &lt;a href="https://www.dropbox.com/s/e17miagemc43c2d/blog.zip?dl=0" rel="noopener noreferrer"&gt;download&lt;/a&gt;. Unzip it and put the &lt;strong&gt;blog&lt;/strong&gt; folder under the root. Like the &lt;strong&gt;README.md&lt;/strong&gt; you create in the last article, Vuepress will use the &lt;strong&gt;README.md&lt;/strong&gt; as the default index.html of your &lt;strong&gt;blog&lt;/strong&gt; folder. We will use it to display a list of blog posts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcrj82i27e4khjxqe9pqy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcrj82i27e4khjxqe9pqy.png" alt="directory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create the theme's layouts
&lt;/h2&gt;

&lt;p&gt;There are 3 layouts in the theme we are going to create:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;page (e.g. Homepage)&lt;/li&gt;
&lt;li&gt;List of posts (e.g. Blog index page)&lt;/li&gt;
&lt;li&gt;post detail (e.g. A Blog post)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you worked with wordpress/jekyll before, you're probably familiar with the idea of page v.s post. A &lt;strong&gt;page&lt;/strong&gt; is a static page without published date, it usually contains timeless content like the homepage; whereas a &lt;strong&gt;post&lt;/strong&gt; is a timely blogpost.&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;layouts&lt;/strong&gt; folder, in addition to the &lt;strong&gt;Layout.vue&lt;/strong&gt; we created in the previous article, create 2 more files: &lt;strong&gt;PostsLayout.vue&lt;/strong&gt;, &lt;strong&gt;PostLayout.vue&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8jj85ru14bm68k06wc56.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8jj85ru14bm68k06wc56.png" alt="layout directory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's give each of them some minimum template. Add this to &lt;strong&gt;PostsLayout.vue&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div&amp;gt;
    &amp;lt;h1&amp;gt;list of posts&amp;lt;/h1&amp;gt;
    &amp;lt;Content/&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add similar thing to &lt;strong&gt;PostLayout.vue&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div&amp;gt;
    &amp;lt;h1&amp;gt;post detail&amp;lt;/h1&amp;gt;
    &amp;lt;Content/&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;&amp;lt;Content /&amp;gt;&lt;/code&gt; is a Vuepress component that loads slot-free content from your markdown file. Anything that's not wrapped in-between &lt;code&gt;::: slot-key&lt;/code&gt; would be loaded.&lt;/p&gt;

&lt;p&gt;In case you are not aware, it's important to know that you can only have 1 child under &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; for Vue.js to work correctly. If you have multiple children directly &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; you will get an error like &lt;strong&gt;Error compiling template .... Component template should contain exactly one root element.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Also, notice that in each markdown file in &lt;strong&gt;/blog&lt;/strong&gt;, I've already indicated in the &lt;code&gt;frontmatter&lt;/code&gt; that which layouts to use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
layout: PostLayout
---
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if you head to &lt;a href="http://localhost:8080/blog/post-1.html" rel="noopener noreferrer"&gt;http://localhost:8080/blog/post-1.html&lt;/a&gt; you should see a page like below... which means you've binded each layout to the post correctly! Yay!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F16x44nicakxkpe653jl7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F16x44nicakxkpe653jl7.png" alt="post detail"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Create shared components
&lt;/h2&gt;

&lt;p&gt;Now we are ready to add shared components like the global nav and footer. In the &lt;strong&gt;theme&lt;/strong&gt; folder, create a &lt;strong&gt;components&lt;/strong&gt; folder with 2 files inside: &lt;strong&gt;Nav.vue&lt;/strong&gt; and &lt;strong&gt;Footer.vue&lt;/strong&gt;. Notice it's a vue convention that components files are capitalized.&lt;/p&gt;
&lt;h3&gt;
  
  
  Nav
&lt;/h3&gt;

&lt;p&gt;Simple thing first: let's add some template to the &lt;strong&gt;Nav.vue&lt;/strong&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;header&amp;gt;
    &amp;lt;nav
      class="font-sans bg-white text-center flex justify-between my-4 mx-auto container overflow-hidden"
    &amp;gt;
      &amp;lt;a
        href="/"
        class="block text-left no-underline font-bold text-black uppercase"
      &amp;gt;{{$site.title}}&amp;lt;/a&amp;gt;
      &amp;lt;ul class="text-sm text-grey-dark list-reset flex items-center"&amp;gt;
        &amp;lt;li&amp;gt;
          &amp;lt;a
            class="inline-block py-2 px-3 text-grey-darkest hover:text-grey-dark no-underline"
          &amp;gt;menu&amp;lt;/a&amp;gt;
        &amp;lt;/li&amp;gt;
      &amp;lt;/ul&amp;gt;
    &amp;lt;/nav&amp;gt;
  &amp;lt;/header&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, our Nav consists of a &lt;strong&gt;\$site title&lt;/strong&gt; and some menu items. To programatically generate menu items, we first need to add a &lt;code&gt;themeConfig&lt;/code&gt; object to our &lt;strong&gt;config.js&lt;/strong&gt;. This is where we are going to site menu data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  title: "Vuepress Blog Example",
  description: "just another blog",
  themeConfig: {
    nav: [{ text: "Blog", link: "/blog/" }, { text: "About", link: "/" }],
  },
  postcss: {
    plugins: [
      require("tailwindcss")("./tailwind.config.js"),
      require("autoprefixer"),
    ],
  },
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now &lt;code&gt;themeConfig&lt;/code&gt; will be available under the global computed &lt;code&gt;$site&lt;/code&gt;. Did you notice we have already used it to render the &lt;strong&gt;\$site.title&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;To programatically generate each menu item, we can utilize &lt;code&gt;v-for&lt;/code&gt; to access the &lt;code&gt;$site.themeConfig.nav&lt;/code&gt; that we just added to the &lt;strong&gt;config.js&lt;/strong&gt;. Also, the link of each would be available to us. We can add to each item with &lt;code&gt;:href&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;li v-for="item in $site.themeConfig.nav"&amp;gt;
  &amp;lt;a
    :href="item.link"
    class="inline-block py-2 px-3 text-grey-darkest hover:text-grey-dark no-underline"
  &amp;gt;{{item.text}}&amp;lt;/a&amp;gt;
&amp;lt;/li&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;v-for&lt;/code&gt; and &lt;code&gt;:href&lt;/code&gt; are both Vue directives, where &lt;code&gt;:href&lt;/code&gt; is a shorthand of &lt;code&gt;v-bind:href&lt;/code&gt;. The first one simply means: for every item in &lt;code&gt;$site.themeConfig.nav&lt;/code&gt; object, render this &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; block; and the later one is binding &lt;code&gt;item.link&lt;/code&gt; to a vue rendered href. You could also use the plain old &lt;code&gt;href&lt;/code&gt; but then you'd not be able to access to what's inside of &lt;code&gt;item&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now your &lt;strong&gt;Nav.vue&lt;/strong&gt; should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;nav&lt;/span&gt;
      &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;font-sans bg-white text-center flex justify-between my-4 mx-auto container overflow-hidden&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;
        &lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;block text-left no-underline font-bold text-black uppercase&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;$site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-sm text-grey-dark list-reset flex items-center&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;item in $site.themeConfig.nav&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;
            &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;item.link&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;inline-block py-2 px-3 text-grey-darkest hover:text-grey-dark no-underline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/a&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/nav&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/header&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vuepress utilizes vue-router's &lt;code&gt;router-link&lt;/code&gt;, which is preferred than a hard-coded &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;. When in HTML5's history mode, &lt;code&gt;router-link&lt;/code&gt; won't refresh the page on clicking links and it also progressively supports IE 9's hash-mode. For all these good reasons, we are going to replace all the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;router-link&amp;gt;&lt;/code&gt;, and all &lt;code&gt;href&lt;/code&gt; to be &lt;code&gt;:to&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;header&amp;gt;
    &amp;lt;nav
      class="font-sans bg-white text-center flex justify-between my-4 mx-auto container overflow-hidden"
    &amp;gt;
      &amp;lt;router-link
        :to="'/'"
        class="block text-left no-underline font-bold text-black uppercase"
      &amp;gt;{{$site.title}}&amp;lt;/router-link&amp;gt;
      &amp;lt;ul class="text-sm text-grey-dark list-reset flex items-center"&amp;gt;
        &amp;lt;li v-for="item in $site.themeConfig.nav"&amp;gt;
          &amp;lt;router-link
            :to="item.link"
            class="inline-block py-2 px-3 text-grey-darkest hover:text-grey-dark no-underline"
          &amp;gt;{{item.text}}&amp;lt;/router-link&amp;gt;
        &amp;lt;/li&amp;gt;
      &amp;lt;/ul&amp;gt;
    &amp;lt;/nav&amp;gt;
  &amp;lt;/header&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Footer
&lt;/h3&gt;

&lt;p&gt;Not much magic is going on in the footer. Just add this template to &lt;strong&gt;Footer.vue&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;footer class="font-sans bg-black text-white py-8 px-4"&amp;gt;
    &amp;lt;div class="text-grey-darker text-center"&amp;gt;©2019 Yours truely. All rights reserved.&amp;lt;/div&amp;gt;
  &amp;lt;/footer&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Putting everything together
&lt;/h3&gt;

&lt;p&gt;Because we want every single page to have the Nav and the Footer, we have to tell our layouts where to find them. Update the &lt;strong&gt;all layout files&lt;/strong&gt; with the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex flex-col h-full&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Nav&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Content&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-1 max-w-xl mx-auto leading-normal&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Footer&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pin-b&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Nav&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@theme/components/Nav&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Footer&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@theme/components/Footer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Nav&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Footer&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Layout&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stylus&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../styles/theme.styl&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/style&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since tailwind is not the main focuse of this tutorial, I already included some tailwind classes in the templates to make everything looked decent. Update the &lt;strong&gt;theme.styl&lt;/strong&gt; with these css, under &lt;code&gt;@tailwind components;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body, html, #app {
  height: 100%; /* makes the footer sticked to bottom */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By now, you should have pages look like this. Both menu items (&lt;strong&gt;Blog&lt;/strong&gt; and &lt;strong&gt;About&lt;/strong&gt;) are generated from our config!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:8080/" rel="noopener noreferrer"&gt;localhost:8080&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F4cqtqocag61l3sg0l0w1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F4cqtqocag61l3sg0l0w1.png" alt="homepage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:8080/blog/" rel="noopener noreferrer"&gt;localhost:8080/blog/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg4f3os3d1esa63xijj63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fg4f3os3d1esa63xijj63.png" alt="homepage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:8080/blog/post-1.html" rel="noopener noreferrer"&gt;localhost:8080/blog/post-1.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff4y7tdv71fb3hn1lfxvj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff4y7tdv71fb3hn1lfxvj.png" alt="homepage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Starting to look better, right?&lt;/p&gt;
&lt;h2&gt;
  
  
  3. List of posts page
&lt;/h2&gt;

&lt;p&gt;To show a list of blog posts, we can create a globally computed properties &lt;code&gt;posts&lt;/code&gt;. Update the &lt;code&gt;export&lt;/code&gt; of &lt;strong&gt;PostsLayout.vue&lt;/strong&gt; with the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default {
  components: { Nav, Footer },
  name: "Layout",
  computed: {
    posts() {
      return this.$site.pages
        .filter(x =&amp;gt; x.path.startsWith("/blog/"))
        .sort(
          (a, b) =&amp;gt; new Date(b.frontmatter.date) - new Date(a.frontmatter.date)
        )
    },
  },
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;computed&lt;/code&gt; are values that will be computed when Vue starts and it will update itself when the data changes. Which means, you don't need to do extra work to get the new value ... How great is that! Inside we are saving the value of computed to the name &lt;strong&gt;posts&lt;/strong&gt;.&lt;code&gt;$site.pages&lt;/code&gt; is one of the Vuepress globals that gives you all the pages in the site, including the non-blog ones. To get a list of posts, I only want the pages under &lt;code&gt;/blog&lt;/code&gt;. Therefore in the code above I filtered out the pages I don't need then sort the result by date before returning the value.&lt;/p&gt;

&lt;p&gt;Now we can utilize the computed properties &lt;code&gt;posts&lt;/code&gt; in our template. Replace &lt;code&gt;&amp;lt;Content /&amp;gt;&lt;/code&gt; with this snippet&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-1 max-w-xl mx-auto leading-normal&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;post in posts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;link&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;post.path&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/router-link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, add the missing date into each blog post's frontmatter. Simply fake some date for the purpose of this tutorial.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;date: 2019-02-11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you go to &lt;a href="http://localhost:8080/blog/" rel="noopener noreferrer"&gt;localhost:8080/blog/&lt;/a&gt; now, you should see our list of posts showing!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Foaytz34yifhs7y4r1wxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Foaytz34yifhs7y4r1wxq.png" alt="list of posts"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wait, how come there's an empty list item on top? Right, because we forgot to filter out the &lt;strong&gt;README.md&lt;/strong&gt; in &lt;strong&gt;/blog&lt;/strong&gt;, which is not a blog post.&lt;/p&gt;

&lt;p&gt;Let's add some logic to filter it out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;computed: {
  posts() {
    return this.$site.pages
      .filter(x =&amp;gt; x.path.startsWith("/blog/") &amp;amp;&amp;amp; !x.frontmatter.blog_index)
      .sort(
        (a, b) =&amp;gt; new Date(b.frontmatter.date) - new Date(a.frontmatter.date)
      );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;strong&gt;README.md&lt;/strong&gt;(the one under the &lt;strong&gt;blog&lt;/strong&gt; folder), add &lt;code&gt;blog_index: true&lt;/code&gt; to the frontmatter&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
layout: PostsLayout
blog_index: true
---
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if you check &lt;a href="http://localhost:8080/blog/" rel="noopener noreferrer"&gt;localhost:8080/blog/&lt;/a&gt; again, the empty list item should be gone. Try click on every post link and see if it shows the correct post!&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Use Vuepress plugins
&lt;/h2&gt;

&lt;p&gt;I've always find reading-time info on Medium.com very useful, so let's add similar functionality. Luckily there's already a &lt;a href="https://github.com/darrenjennings/vuepress-plugin-reading-time" rel="noopener noreferrer"&gt;vuepress plugin&lt;/a&gt; exists so we don't have to write our own.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; vuepress-plugin-reading-time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add &lt;code&gt;plugins: ['vuepress-plugin-reading-time']&lt;/code&gt; into your &lt;strong&gt;config.js&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Replace the &lt;code&gt;&amp;lt;Content/&amp;gt;&lt;/code&gt; in your &lt;strong&gt;PostLayout.vue&lt;/strong&gt; with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex-1 mx-auto leading-normal container&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-grey-dark&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;$page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readingTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/article&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! Refresh any of your blog detail page, you should see the grey reading time on top:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc8qaev7jnjqkl4ymwbzn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc8qaev7jnjqkl4ymwbzn.png" alt="reading-time image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, adding/using plugins in Vuepress is super easy and powerful. There aren't many plugins available yet so it's likely that you have to write your own.&lt;/p&gt;
&lt;h3&gt;
  
  
  Work with external node packages
&lt;/h3&gt;

&lt;p&gt;Usually there's a published date on each post and we can easily accompolish that by adding a &lt;code&gt;date&lt;/code&gt; in the frontmatter. But the output still has to be parsed it to be a human readable format, which Vuepress doesn't have support for it yet.&lt;/p&gt;

&lt;p&gt;We can use extra tool like &lt;a href="https://momentjs.com/" rel="noopener noreferrer"&gt;moment.js&lt;/a&gt; to help:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;moment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;strong&gt;PostLayout.vue&lt;/strong&gt;, add the template to render your date, it'd render something like &lt;strong&gt;2019-02-13T00:00:00.000Z&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-grey-dark&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;$page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;frontmatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To fix this, let's load &lt;code&gt;moment&lt;/code&gt; package to our layout. Update the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; with these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import moment from "moment"
import Nav from "@theme/components/Nav"
import Footer from "@theme/components/Footer"
export default {
  components: { Nav, Footer },
  name: "Layout",
  methods: {
    formateDate(date) {
      return moment(date).format("MMM Do YYYY")
    },
  },
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then apply it onto the template&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-grey-dark&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nf"&gt;formateDate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;frontmatter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;)}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should see a human-readable date format like &lt;code&gt;Feb 13th 2019&lt;/code&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Wrapping up
&lt;/h2&gt;

&lt;p&gt;Phew You did it! This is a long tutorial I know, but if you followed through, you'd learn many concepts including&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to create a custom theme for Vuepress&lt;/li&gt;
&lt;li&gt;How to use basic Vue directives in your theme&lt;/li&gt;
&lt;li&gt;How to work with external node modules&lt;/li&gt;
&lt;li&gt;How to use Vuepress plugins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, we are going to learn how to deploy it on Netlify. It's a short simple one, I promise! &lt;a href="https://dev.to/hyper_yolo/part-3-final-wrap-up-and-deploy-to-netlify-2362"&gt;Let's go, Part 3&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;This is a cross-post from &lt;a href="https://www.amie-chen.com/blog" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. Check out the original and more there!&lt;/p&gt;

</description>
      <category>vuepress</category>
      <category>vue</category>
      <category>tailwindcss</category>
      <category>netlify</category>
    </item>
    <item>
      <title>[Part 1] Setup a working Vuepress blog with Tailwind.css</title>
      <dc:creator>Amie Chen</dc:creator>
      <pubDate>Tue, 12 Feb 2019 03:40:57 +0000</pubDate>
      <link>https://dev.to/hyper_yolo/part-1-setup-a-working-vuepress-blog-with-tailwindcss-1594</link>
      <guid>https://dev.to/hyper_yolo/part-1-setup-a-working-vuepress-blog-with-tailwindcss-1594</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fd63hpoll0toxrq5kqfke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fd63hpoll0toxrq5kqfke.png" alt="hero-image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this part, we will setup a working Vuepress blog with Tailwind.css.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Getting Started
&lt;/h2&gt;

&lt;p&gt;Let's create a folder called &lt;strong&gt;vuepress-blog&lt;/strong&gt; then run these commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# cd into the folder&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;vuepress-blog

&lt;span class="c"&gt;# install the latest vuepress alpha globally on your computer&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; vuepress@next

&lt;span class="c"&gt;# create the first markdown file&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'# Hello VuePress'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; README.md

&lt;span class="c"&gt;# start the site locally&lt;/span&gt;
vuepress dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run &lt;code&gt;vuepress build&lt;/code&gt;, the &lt;strong&gt;README.md&lt;/strong&gt; at the root level will be generated into &lt;strong&gt;index.html&lt;/strong&gt;. Now head to &lt;code&gt;localhost:8080&lt;/code&gt;, you should see a default site like this. Horay!!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa7netunfmoc9gib7ecmc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa7netunfmoc9gib7ecmc.png" alt="screenshot for default site"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that some css already been applied to the page without any work (What's this magic ?! 😱). It's coming straight from the default theme packed in Vuepress. To alter it, run &lt;code&gt;vuepress eject&lt;/code&gt; and a generated &lt;strong&gt;.vuepress&lt;/strong&gt; folder will show up in your directory tree. It contains all the code for the default theme. We will go over this later when we start making a custom theme.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. The correct directory structure
&lt;/h2&gt;

&lt;p&gt;On the documentation, Vuepress recommends putting everything under a &lt;strong&gt;docs&lt;/strong&gt; folder. You can name it with anything, but the important thing is that when running Vuepress commands, you'd need to run &lt;code&gt;vuepress dev [folder name, i.e. docs]&lt;/code&gt; or you will see a 404 page.&lt;/p&gt;

&lt;p&gt;On the other hand, you could simply leave everything at the root level under &lt;strong&gt;vuepress-blog&lt;/strong&gt;. In this case, you just have to run &lt;code&gt;vuepress dev&lt;/code&gt; like before.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Add tailwind.css
&lt;/h2&gt;

&lt;p&gt;Since we don't have package.json yet, let's &lt;code&gt;npm init&lt;/code&gt; the project first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install tailwind&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install tailwindcss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we are ready to generate the tailwind config&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx tailwind init tailwind.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By now, your directory structure should look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vuepress-blog
├── node_modules
├── README.md
├── package-lock.json
├── package.json
└── tailwind.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we are going to create a custom theme that utilize tailwind.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Create a Custom Vuepress theme
&lt;/h2&gt;

&lt;p&gt;At the root level of your project, create a &lt;strong&gt;.vuepress&lt;/strong&gt; folder with a &lt;strong&gt;theme&lt;/strong&gt; folder inside. Then inside of &lt;strong&gt;theme&lt;/strong&gt;, create a &lt;strong&gt;styles&lt;/strong&gt; folder. &lt;strong&gt;.vuepress&lt;/strong&gt; houses everything, including your current theme and the vuepress config; the &lt;strong&gt;theme&lt;/strong&gt; and &lt;strong&gt;styles&lt;/strong&gt; folder is to override the default theme.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; .vuepress/theme/styles
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now add a &lt;strong&gt;theme.styl&lt;/strong&gt; in the &lt;strong&gt;styles&lt;/strong&gt; folder to serve as the entry point of all css. Your directory tree should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vuepress-blog
├── .vuepress
│   └── theme
│       └── styles
│           └── theme.styl
├── node_modules
├── README.md
├── package-lock.json
├── package.json
└── tailwind.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add these lines to &lt;strong&gt;theme.styl&lt;/strong&gt; to load all of our tailwind's styles.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@tailwind preflight;
@tailwind components;
@tailwind utilities;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nice -- We are almost done!&lt;br&gt;
Now we are going to tell Vuepress to connect to our tailwind. Create a file called &lt;strong&gt;config.js&lt;/strong&gt; in &lt;strong&gt;.vuepress&lt;/strong&gt; and put in these settings&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Vuepress Blog Example&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;just another blog&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;postcss&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tailwindcss&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./tailwind.config.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;autoprefixer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lastly, we are going to add our theme index file. Create another folder named &lt;strong&gt;layouts&lt;/strong&gt; in &lt;strong&gt;theme&lt;/strong&gt; with a &lt;strong&gt;Layout.vue&lt;/strong&gt; inside.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Layout.vue&lt;/strong&gt; let's add the very basic template for now&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;font-sans text-teal&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;hello&lt;/span&gt; &lt;span class="nx"&gt;world&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;stylus&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../styles/theme.styl&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/style&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This &lt;strong&gt;Layout.vue&lt;/strong&gt; will serve as the base layout of all your pages. If there is no &lt;code&gt;layout&lt;/code&gt; specified in the frontmatter of a page, Vuepress will default to this &lt;strong&gt;layouts/Layout.vue&lt;/strong&gt;. It's a required file for any vuepress theme.&lt;/p&gt;

&lt;p&gt;Note: If your theme is super simple and doesn't have a &lt;strong&gt;layouts&lt;/strong&gt; folder, you can leave the &lt;strong&gt;Layout.vue&lt;/strong&gt; file directely under the &lt;strong&gt;theme&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Your final directory structure should look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vuepress-blog
├── .vuepress
│   ├── theme
│   │   └── layouts
│   │       └── Layout.vue
│   │   └── styles
│   │       └── theme.styl
│   └── config.js
├── node_modules
├── README.md
├── package-lock.json
├── package.json
└── tailwind.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart your server now and run &lt;code&gt;vuepress dev&lt;/code&gt;, you should see a page like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Furu5h55v3fx1k9xqgbuk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Furu5h55v3fx1k9xqgbuk.png" alt="screenshot for hello world"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure the tailwind classes are working (i.e. you should see the text being green instead of black.)&lt;/p&gt;

&lt;p&gt;Nice job! By now, we have created a custom Vuepress theme that utilizes tailwind.css. In the next part, we are going to learn how to write your own theme and make your blog look awesome! &lt;a href="https://dev.to/hyper_yolo/part-2-write-and-apply-a-custom-vuepress-theme-4n3a"&gt;Part 2 is here&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;This is a cross-post from &lt;a href="https://www.amie-chen.com/blog" rel="noopener noreferrer"&gt;my website&lt;/a&gt;. Check out the original and more there!&lt;/p&gt;

</description>
      <category>vuepress</category>
      <category>vue</category>
      <category>tailwindcss</category>
      <category>netlify</category>
    </item>
  </channel>
</rss>
