<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nikola Cvetkovski on Medium]]></title>
        <description><![CDATA[Stories by Nikola Cvetkovski on Medium]]></description>
        <link>https://medium.com/@nik_cv?source=rss-c93a94c28ee7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*55TjneH1GmB-17Vm</url>
            <title>Stories by Nikola Cvetkovski on Medium</title>
            <link>https://medium.com/@nik_cv?source=rss-c93a94c28ee7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 09:36:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nik_cv/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Making a simple note app using Svelte and Vite]]></title>
            <link>https://medium.com/the-web-tub/making-a-simple-note-app-using-svelte-and-vite-27edfa91a591?source=rss-c93a94c28ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/27edfa91a591</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[svelte]]></category>
            <dc:creator><![CDATA[Nikola Cvetkovski]]></dc:creator>
            <pubDate>Fri, 13 Aug 2021 02:44:53 GMT</pubDate>
            <atom:updated>2021-08-13T02:44:53.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*sclaei0LbNcb0Y0l7p-tNQ.png" /></figure><p>In the web world, technology constantly evolves, paving the way for new tools and development methods that we can use to create even better products. Two such tools that I have often come across in recent days are Svelte and Vite. As a curious person, I was intrigued and decided to make a simple app to experience a glance of the development experience using these tools.</p><p>In this article, I will explain how to create a simple note app using Svelte and Vite for those interested in trying them out. This post is written with the assumption that the reader has at least basic knowledge in Svelte, HTML, CSS, and JavaScript. Otherwise, I advise you to continue reading after you become familiar with them.</p><blockquote><strong>Disclaimer</strong></blockquote><blockquote>As the focus of this article is trying out Svelte and Vite, the sample app was made with just simple styling for desktop screens.</blockquote><h3>What is Svelte?</h3><p>Svelte is a framework used for developing web applications similar to other popular frameworks such as React and Vue. Unlike the before-mentioned frameworks that have most of their work done in the user’s browser, Svelte includes a compile step that produces an optimized vanilla version Javascript app when you build your app, reducing performance costs and bundle sizes.</p><p><a href="https://svelte.dev/">Svelte</a></p><h3>What is Vite?</h3><p>Vite is a no-bundle JavaScript development build tool that has attracted traction due to how fast and easy it is to use. As quoted from Vite’s website:</p><blockquote>Vite (French word for “fast”, pronounced /vit/) is a build tool that aims to provide a faster and leaner development experience for modern web projects. It consists of two major parts:</blockquote><blockquote>- A dev server that provides <a href="https://vitejs.dev/guide/features.html">rich feature enhancements</a> over <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules">native ES modules</a>, for example extremely fast <a href="https://vitejs.dev/guide/features.html#hot-module-replacement">Hot Module Replacement (HMR)</a>.</blockquote><blockquote>- A build command that bundles your code with <a href="https://rollupjs.org/">Rollup</a>, pre-configured to output highly optimized static assets for production.</blockquote><p>Although initially intended to be used with Vue, Vite has grown to support other frameworks, including Svelte, making it a perfect candidate for this article.</p><p><a href="https://vitejs.dev/">Vite</a></p><h3>Let’s get started!</h3><p>The first step into making our app is setting the environment. Unlike other tools and CLI’s that require installation beforehand, with Vite, you can set up your environment pretty fast with just a simple command.</p><blockquote><strong>Note:</strong></blockquote><blockquote>For this article, we shall use NPM, but all steps of this tutorial can be done using Yarn as well.</blockquote><pre>$ npm init vite@latest</pre><p>When running the above command, Vite will guide you with three simple steps where we need to input the name of your project and select the framework we will use in your project. To make things interesting, we decided to add Typescript into the mix and, therefore, we set up the environment as listed below:</p><pre>$ npm init vite@latest<br>✔ Project name: … svelte-notes-sample-app-ts<br>✔ Select a framework: › svelte<br>✔ Select a variant: › svelte-ts</pre><p>If we enter inside the newly created folder, we can see that Vite has created a template app that we can run using the following commands as suggested by Vite itself:</p><pre>$ cd svelte-notes-sample-app-ts<br>$ npm install<br>$ npm run dev</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4cfASWyO41NMoNf1Wbplg.png" /><figcaption>First view after running the “npm run dev” command</figcaption></figure><p>We can already sense how fast Vite is, requiring just a few moments to set up our environment. Furthermore, due to its fast hot reload feature, we can immediately see the changes made to the pre-created files. With this, we have finished with the basic setup of our environment.</p><p>For a bit more quality of life during the development, we decided to use SASS, a style pre-processor, as well as use an alias in our import paths. Note that these are just modifications that we believe will improve the development experience, but the tutorial can be done without them.</p><p>To be able to use Sass in the .svelte files, we need to install the sass package and add the following content in svelte.config.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7be39af6ab8688bf25254c38aef34830/href">https://medium.com/media/7be39af6ab8688bf25254c38aef34830/href</a></iframe><p>For using an alias in the import paths, we also need to modify the vite.config.js and tsconfig.json files displayed below. We decided to use the @ sign as a reference to the ./src folder from the project root.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89f957f2f84b753fe34659d13136d65f/href">https://medium.com/media/89f957f2f84b753fe34659d13136d65f/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f88930c797fc39ce6064d48f8e6869fe/href">https://medium.com/media/f88930c797fc39ce6064d48f8e6869fe/href</a></iframe><h3>Creating the Notes App</h3><p>Now that our environment is ready, we can finally start to create our Notes app. Our app will consist of a single Home page where the user can see his notes add new ones, and edit or delete existing ones.</p><p>If we look in the generated src folder, we can see a file called App.svelte that is the entry point to our app. Similar to other frameworks, Svelte uses the files with the .svelte extension to allow users to make Single File Components. That means that all the HTML, CSS, and JavaScript needed for a single component will be in the same file, making components easy to develop and maintain.</p><p>Currently, App.svelte already has some template content that we, unfortunately, won’t use but instead replace with our own. For those reasons, we can delete the content of App.svelte and the generated Counter.svelte file in the lib folder. Replace the content of App.svelte with the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/392e9e71a58dcb1ae60a43b64fdb77f2/href">https://medium.com/media/392e9e71a58dcb1ae60a43b64fdb77f2/href</a></iframe><p>As seen above, App.svelte now consists of just two components; a header and the Home page. Since these two files don’t exist, we need to create them and their respective folders, as seen from their import paths. We also added some style to the &lt;html&gt; and &lt;body&gt; tags.</p><h4>Making the header</h4><p>Like most apps, we want to display a header that will be shared between the pages. Although our application will consist of only one page, we can later expand on it while still using the same header. To make the header component shared, we add it to App.svelte instead of adding it on each page. The content of the Header.svelte component should be as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9228294b17ea3ae2eb1a71c2b169b103/href">https://medium.com/media/9228294b17ea3ae2eb1a71c2b169b103/href</a></iframe><p>With this the header should look similar to the picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*3B_77vXggr5h90XeiyW8tw.png" /></figure><h4>The Note component</h4><p>Our Home page will contain all of the functionality of our app. However, because some parts need to be reused, we need to segment some of the code into several components to make the Home page easier to read, reuse and maintain. One such part is the way we display notes on our Home screen so we can make a separate Note component first that will hold all the logic for displaying a note. Create a Note.svelte in the same components folder where we placed the Header component and add the following content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff2f7923dcdbd754297cd2bab1500f35/href">https://medium.com/media/ff2f7923dcdbd754297cd2bab1500f35/href</a></iframe><p>As we can see from the code, our notes contain an id, a title, content that has the details of the note, a list of tags, the date it was last modified, and an isFavorite flag, indicating if the note has been added to favorites or not. Most of the display is straightforward, with a few exceptions.</p><ul><li>In order to display the isFavorite flag, we display a star icon using the svelte-fa and @fortawesome/free-solid-svg-icons packages. We change the color of the star from grey to yellow, depending on the value of the isFavorite flag. Clicking the star does not automatically change the flag as we just dispatch an event that has to be handled by the parent component.</li><li>Since this is a preview of the note on the Home screen, we don’t want to display all of the content of the note. If the content exceeds 100 characters, we show only the first 100 characters and add ellipsis at the end.</li><li>In order to display the modified date in a more humanized way, such as displaying a few seconds ago if the note was recently updated we make use of the moment library to easily do this. As we’ll see later, we will reuse this function, therefore the implementation of it has been added to the libs/utils.js file as follows.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b71aa6f2d8283be3aa1deb89e4c7c0af/href">https://medium.com/media/b71aa6f2d8283be3aa1deb89e4c7c0af/href</a></iframe><p>In the code above, we can see that we use the YYYYMMDDHHmmss format to save the date of the notes where:</p><ul><li>YYYY is the year</li><li>MM is the number of the month</li><li>DD is the day of the month</li><li>HH is the hour in 24h format</li><li>mm is the minutes</li><li>ss is the seconds</li></ul><p>For more details, check the <a href="https://momentjs.com/docs/">moment.js</a> library documentation.</p><p>If you import and use the Note component directly with static props, the note should look like the picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*2bcZn8Hcl4AKantQjPgyWg.png" /></figure><p>To install the packages used in the Note component, run the following commands:</p><pre>// For displaying icons<br>npm install -D @fortawesome/free-solid-svg-icons svelte-fa</pre><pre>// For time formating<br>npm install moment</pre><p>Sample code for static use:</p><pre>&lt;script lang=&quot;ts&quot;&gt;<br>  import Note from &#39;@/components/Note.svelte&#39;<br>&lt;/script&gt;</pre><pre>&lt;Note<br>  id={1234}<br>  title={&#39;Some Note&#39;}<br>  content={&#39;This note is about this and that&#39;}<br>  tags={[&#39;test&#39;,&#39;text&#39;]}<br>  date={&#39;20210806120000&#39;}<br>  isFavorite={false}<br>/&gt;</pre><h4>Editing Notes</h4><p>Since the Note component is just a preview of the note, we need to find a way for the user to view and edit the contents of a note. Usually, we display the details of a note, and the user can choose whether to edit the content or not. However, for simplicity reasons, we will directly make the contents editable.</p><p>To achieve this, we shall display the content of the note in a modal component, called EditNoteModal, that will appear when the user clicks on a note. For those reasons in the above code for the Note component, we added on:click on the parent enclosing element to forward the click event from the Note component to the parent, in our case, the Home page that we will implement later.</p><pre>&lt;div class=&quot;note-card&quot; on:click &gt;</pre><p>Before implementing the EditNoteModal, however, we shall make a common Modal component that will let us reuse most of the structure of a modal and allow us to only edit the title in the header, the body, and footer of the modal, using named slots. This will prove helpful later if we want to make other specific modals. We shall create a Modal.svelte file in the components folder with the following contents:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26504d84c66caa3aa94633c78cfe3e7f/href">https://medium.com/media/26504d84c66caa3aa94633c78cfe3e7f/href</a></iframe><p>As we can see, we’re only adding the styles for the overlay and the header, while the body and footer will be added by the parent component. We’re also dispatching a closeModal custom event, allowing the parent component to execute additional computing if needed.</p><p>With this, we can now create the EditNoteModal component:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ee8d02665266a7ca81aa8a45a7d2c3c/href">https://medium.com/media/3ee8d02665266a7ca81aa8a45a7d2c3c/href</a></iframe><p>The EditNoteModal contains:</p><ul><li>Text input field for the title</li><li>Text input field for the tags field where the user can input tags separated by comma</li><li>An auto resizable textarea for the content field.</li><li>A Delete, Cancel, and a Save button which is disabled if there are no value in the input fields.</li></ul><p>This component can further be enhanced by adding more validation, however for simplicity reasons, we will leave it as it is. Furthermore, as the reader might have already noticed, we are also reusing this component for creating a new note as well, depending on whether the id prop has a value or not. We display the Delete button only for already created notes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*0HOXcd19072NKUTprpfZBg.png" /><figcaption>The EditNoteModal when an existing note is clicked</figcaption></figure><p>Since we added a Delete button, we don’t want the user to delete a note by accidentally pressing the button. Therefore, we will add a Delete Confirmation dialog as well.</p><blockquote><strong>Note:</strong></blockquote><blockquote>Notice that we won’t use this dialog directly from the EditNoteModal. Instead, we shall call it from the parent element by dispatching a delete custom event and sending the note’s id. That is because we want all the logic that manipulates the notes to be in one place for easy management in case of changes.</blockquote><p>We shall call this new dialog component DeleteNoteModal.svelte :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/570640476069b8d605c552aa57a73521/href">https://medium.com/media/570640476069b8d605c552aa57a73521/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*amzrQ_FazVJ_rm8onPQodw.png" /><figcaption>The DeleteNoteModal component</figcaption></figure><h4>The Home Page</h4><p>Now that we made all of the other components, we can finally implement the Home page. Add the following content to the pages/Home.svelte file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6cea7108d704dcec5abba98b6ea5fd9f/href">https://medium.com/media/6cea7108d704dcec5abba98b6ea5fd9f/href</a></iframe><p>If we analyze the Home page, we can see that it contains all the code that is crucial to our app that consists of multiple parts:</p><ul><li>The initialization of the notes where we read them from localStorage or initialize them with some default code</li><li>The Edit and Delete modal logic, where we toggle a flag used to show/hide the respective modals</li><li>The note manipulation methods such as editing, deleting or saving notes in memory</li></ul><p>And the HTML consists of:</p><ul><li>A card like button for adding new notes</li><li>The list of existing notes</li><li>The Edit Modal</li><li>The Delete Modal</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WPtOSYIQfuXaHg9qIjEqMg.png" /><figcaption>The final look of the Home page</figcaption></figure><p>As many would notice, several things could be improved on the Home page. Despite segmenting the view into several components, the component is still a bit bulky. We can further optimize this by:</p><ul><li>Moving the notes modification methods into a separate file and importing them in the Home component.</li><li>The Home page also has some code for default values for the notes, in case there is nothing in memory. This code can be removed.</li><li>The button for new notes could also be made into a separate component to reduce the HTML and CSS in the Home component.</li></ul><p>However, as this is just a tutorial, we shall leave any further improvements to the reader if they want to continue working on the project to practice their skills.</p><p>After making the Home page, our sample app is complete with a simple design that allows the user to add, remove and edit notes as well as mark notes as their favorite.</p><p>You can view the whole project on <a href="https://github.com/cvetkovskin/svelte-notes-sample-app-ts">GitHub</a>.</p><h3>Conclusion</h3><p>In this blog post, I’ve aimed to illustrate how simple and easy it is to set up a development environment using Vite and tried to give a brief overview of what is possible with Svelte.</p><p>Those who wish to go one step further and continue learning and developing with Svelte and Vite are welcomed to enhance the app even further. Here are just some of the many ways you can extend this project:</p><ul><li>The app saves the notes in the localStorage of the browser which can be replaced with API calls that will save the notes in a database on a server.</li><li>Thorough validation can be implemented in the EditNoteModal modal.</li><li>Implementing a NoteDetail component that will display the full content of a note without directly editing it.</li><li>Using separate pages instead of using modals.</li><li>Adding filter options, so the user can easily find specific notes.</li></ul><p>And if any of you find Svelte and Vite as intriguing as we did and would like to contribute to it, make sure to check out their websites that are linked above or their respective Github repositories; <a href="https://github.com/sveltejs/svelte">Svelte</a>, <a href="https://github.com/vitejs/vite">Vite</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27edfa91a591" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/making-a-simple-note-app-using-svelte-and-vite-27edfa91a591">Making a simple note app using Svelte and Vite</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making a website with Nuxt (Vue) and AMP]]></title>
            <link>https://medium.com/the-web-tub/making-a-website-with-nuxt-vue-and-amp-3ef904819de6?source=rss-c93a94c28ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ef904819de6</guid>
            <category><![CDATA[amp]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[omdb]]></category>
            <category><![CDATA[nuxt]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nikola Cvetkovski]]></dc:creator>
            <pubDate>Wed, 18 Sep 2019 01:50:47 GMT</pubDate>
            <atom:updated>2019-09-18T01:50:47.845Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wbyVHG6DTZxIXYf_BiiaQ.png" /><figcaption>Banner background image by <a href="https://pixabay.com/users/BUMIPUTRA-731298/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2926963"><strong>BUMIPUTRA </strong></a>from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2926963"><strong>Pixabay</strong></a></figcaption></figure><p>Developers often receive requests from clients that are not always logical or promote best practices; but even so, they often present an interesting chance to challenge ourselves. As we try to meet the requirements, we often face the challenge straight on without hesitation for completion.</p><p>Not long ago, I found myself in a similar situation with a client that requested for the AMP framework to be used halfway through a project. This decision might have been influenced by AMP’s benefits but was a major blow in the at-the-time ongoing development. Initially, the Vue.js framework, which heavily uses JavaScript was requested while AMP limits the use of CSS and forbids JavaScript in the project. Knowing that starting from scratch or changing to another SSR framework would put us at risk of not finishing the project on time, our team decided to go for <a href="https://nuxtjs.org/">Nuxt.js</a>.Therefore we could use all of the already created components, views and logic while adding an SSR that will enable the usage of AMP.</p><p>In this article, we shall cover the challenges that I faced while building a website using AMP and Nuxt.js. This post is written assuming the reader already has knowledge of HTML, CSS, JavaScript, Vue.js and possibly Nuxt.js.</p><blockquote><strong>Disclaimer</strong></blockquote><blockquote>This post is by no means a detailed tutorial nor promoting the best practice of how to combine these two frameworks. It was written as just a case study, to be used as an example or reference by others that might find themselves in similar circumstances, due to the lack of other examples when attempting the above.</blockquote><h3>What is Nuxt.js?</h3><p>Nuxt.js is an open-source framework based on Vue.js. As described on the <a href="https://nuxtjs.org/">official website</a>:</p><blockquote>Its main scope is UI rendering while abstracting away the client/server distribution.</blockquote><blockquote>Our goal is to create a framework flexible enough that you can use it as a main project base or in addition to your current project based on Node.js.</blockquote><blockquote>Nuxt.js presets all the configuration needed to make your development of a server-rendered Vue.js Application more enjoyable.</blockquote><p>In this article, Nuxt is used specifically due to its efficiency in developing an SSR Vue.js website.</p><h3>What is Amp?</h3><p>Accelerated Mobile Pages or AMP is an open-source framework backed by Google with a purpose to speed up how fast webpage content is displayed to mobile users, due to the increasing number people who browse the internet through their smartphones. Or as the <a href="https://amp.dev/">official AMP website</a> would say:</p><blockquote>AMP is a simple and robust format to ensure your website is fast, user-first, and makes money. AMP provides long-term success for your web strategy with distribution across popular platforms and reduced operating and development costs.</blockquote><p>In summary, AMP should increase the loading speed of your pages, help you attract and retain mobile traffic by improving your SEO ranking at the cost of having to abide by the strict rules of its implementations, such as:</p><ul><li>no in-house or third-party Javascript</li><li>HTML tags restrictions</li><li>only inline custom style limited to 50KB and some additional CSS regulations</li></ul><p>At first sight, AMP doesn’t look like an intuitive approach a developer would take. However, since there is a promise of an increased SEO ranking and especially since that promise comes from none other than Google itself, it is not unusual that AMP attracts the attention of clients who want nothing else but for their product to be discovered.</p><h3>Let’s get started!</h3><p>As showing parts of the actual project is, of course, off-limits, we decided to demonstrate some of the hurdles we encountered by creating a demo containing the landing page of a video streaming site (called Home Theater) as well as a listing page, that implements pagination.</p><blockquote><strong>Note:</strong></blockquote><blockquote>For the creation of this demo, we made use of the <a href="http://www.omdbapi.com/">OMDb’s (Open Movie Database) API</a>, which is a RESTful web service to obtain movie information. To use this API, you need to create an account, after which you acquire an API key needed to obtain the information.</blockquote><p><a href="http://www.omdbapi.com/">OMDb API</a></p><p>We started by initializing a default Nuxt.js project as stated in their <a href="https://nuxtjs.org/guide/installation">guide</a>, by running one of the following commands:</p><pre>npx create-nuxt-app &lt;project-name&gt;</pre><p>or</p><pre>yarn create nuxt-app &lt;project-name&gt;</pre><p>We decided to name our project nuxt-amp-home-theather and used the following options :</p><pre>? Project name <strong>&lt;project-name&gt;</strong><br>? Project description <strong>&lt;project-description&gt;</strong><br>? Author name <strong>&lt;your name&gt;</strong><br>? Choose the package manager <strong>&lt;npm or yarn&gt;</strong><br>? Choose UI framework <strong>None</strong><br>? Choose custom server framework <strong>Express</strong><br>? Choose Nuxt.js modules <strong>Axios</strong><br>? Choose linting tools <strong>ESLint</strong>, <strong>Prettier</strong><br>? Choose test framework <strong>None</strong><br>? Choose rendering mode <strong>Universal (SSR)</strong></pre><p>In our case we chose yarn as the package manager and therefore from here on all of the given commands will be using yarn. With this we got a default project that we can easily view by running:</p><pre>yarn dev</pre><h3>Implementing AMP</h3><p>After the above initialization, we need to do some tweaks to the nuxt.config.js to be able to use AMP. Fortunately, the Nuxt team has prepared an AMP example that can be found <a href="https://github.com/nuxt/nuxt.js/tree/dev/examples/with-amp">here</a>:</p><p><a href="https://github.com/nuxt/nuxt.js/tree/dev/examples/with-amp">nuxt/nuxt.js</a></p><p>As seen in the example, besides the given changes to the config file we also need to to add anapp.html file. But that’s not all. Because AMP only allows inline CSS and only one &lt;style amp-custom&gt; tag, we also need to solve the problem of the styles written in each component.</p><p>The above example solves this by moving all of the styles into one file — main.css, that is then injected in every page by Nuxt. Then, with the help of the render:route hook, the amp-custom attribute is added to the &lt;style&gt; tag. Although this is a good solution, it also has its drawbacks.<br>First, you will have to write all the style in one file, which doesn’t improve the developers’ experience, unless you use multiple files and import all in one main file. Furthermore, if you have multiple components, and if not all of them are used on every page, you will have an unused CSS in each of your pages. Not to mention AMP imposes a 50KB size restriction, therefore your merged CSS should not exceed that size.</p><p>For these reasons, we decided to try a different approach, which was to leave the CSS as it is, in each component. When Nuxt renders each site, it will include only the needed CSS and all we have to do is merge them all in the render:route hook. We can do so by removing the line that adds the amp-custom attribute to added CSS, and replace it with the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ff3e43632fa3004b6fd3f3bb84ddff9/href">https://medium.com/media/9ff3e43632fa3004b6fd3f3bb84ddff9/href</a></iframe><p>As can be seen in the code above, we’re removing every style tag and merging all of their contents. Afterward, we just add all the content into a single &lt;style amp-custom&gt; tag at the end of the &lt;head&gt; tag. It’s worth noting that the merged content is not minified, therefore you can use a library to minify it, to further reduce its size (e.g. <a href="https://www.npmjs.com/package/clean-css">clean-css</a>).</p><h3>The Home page</h3><p>Unlike my <a href="https://medium.com/the-web-tub/building-a-showcase-site-with-gridsome-netlify-977d51432838">previous post</a>, where I kept the CSS to the bare minimum, I decided to spend some time and make the pages look a bit more decent. You can get the CSS from the finished <a href="https://github.com/cvetkovskin/nuxt-amp-home-theater">project’s repo</a>.</p><p>The content of the Home page is rather simple, containing just two parts: a banner and a short trending movie list. The content of the home page looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*iuU-MH_BGKckruu-uYH6FQ.gif" /><figcaption>Mobile View of the Home Page</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1515eafad8e7dbae590b46db7268a902/href">https://medium.com/media/1515eafad8e7dbae590b46db7268a902/href</a></iframe><p>We’re passing the list of movies obtained from the OMDb’s API to both the bannerand the movie-list component. The latter is also rather simple, just a list of images displayed as a gird. Since we’re displaying an image, we have to use the amp-img tag as instructed by AMP:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30c65e727b996f9a351feac63acacac7/href">https://medium.com/media/30c65e727b996f9a351feac63acacac7/href</a></iframe><p>The banner component, on the other hand, displays just the logos of the app, Nuxt, and AMP, as well as a carousel displaying the posters of the movies. As you can notice, we’re using the amp-carousel component to display the carousel as custom JavaScript is not allowed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4768ee303bfa5d13d05c9f76adbc23cb/href">https://medium.com/media/4768ee303bfa5d13d05c9f76adbc23cb/href</a></iframe><p>With this our Home page is complete, however, if we try to display it and add #development=1 at the end of the URL, we’ll see an error regarding the autoplay attribute of the carousel element. The problem is that Nuxt renders this attribute with the value: autoplay=&quot;autoplay&quot;, while AMP strongly requests it to have either no value for infinite loop or a number to specify the number of loops after which the autoplay will stop.<br>After some browsing, we couldn’t find a way how to disable this automatic value assignment, and therefore proceeded to solve it by adding the following line in themodifyHtml method in the config file:</p><pre>html = html.replace(/&lt;amp-carousel([^&gt;]*)&gt;/gi, match =&gt; {<br>  return match.replace(&#39;autoplay=&quot;autoplay&quot;&#39;, &#39;autoplay&#39;)<br>})</pre><h3>The Series page</h3><p>The second page contains just a list of movies, along with a pagination component to move through the pages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*TqKLuOnBSSKcseu0WONqIw.png" /><figcaption>Mobile View of the Series Page</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/249040dadf703d75af5f98411fa76803/href">https://medium.com/media/249040dadf703d75af5f98411fa76803/href</a></iframe><p>Unlike the Home page, where the list was rendered just once on the server-side to be presented to the user, here we need to update the list as we go through the pages. For that reason, we are using the amp-list component along with a custom pagination component.<br>By reading the <a href="https://amp.dev/documentation/components/amp-list/">AMP documentation</a> about this component, it is evident that it is more convenient for an infinite scroll, rather than paginated display. However, since it requires the JSON response to contain the URL of the next page, and the OMDb API doesn’t, we cannot implement the infinite scroll. Instead, we have to manually change the URL usingamp-bind. This functionality allows you to change the values of attributes similarly like Vue. <br>To achieve that AMP enables you to maintain a variable using the amp-state component since JavaScript is not allowed.</p><p>In our case, we modify the URL with the help of the currentPage state (variable) that we maintain in the pagination component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/627dac9b2fa8d4ce50061368b268689c/href">https://medium.com/media/627dac9b2fa8d4ce50061368b268689c/href</a></iframe><p>Stimulating the pagination component, without being able to use JavaScript, required using several amp-state components, and updating each with the on:&quot;tap:AMP.setState()&quot; method. <br>We need to initialize the multiple states, and that can only be done by either providing an API URL or using a &lt;script type=&quot;application/json&quot;&gt; tag. Since we’re using the states as variables for the pagination, we need to use the script tag. That presents a problem as we previously set up the modifyHtml render function to remove all scripts tags. Hence, we need to modify that part to exclude the type=&quot;application/json&quot; tags.</p><p>After the modification, the final version of the modifyHtml function should look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30d4c79daf96b476ae451bcee9a7785a/href">https://medium.com/media/30d4c79daf96b476ae451bcee9a7785a/href</a></iframe><p>You may notice that we’re also adding several scripts right after removing the already existing ones. These are the mandatory scripts that need to be included to be able to use the various AMP components.</p><p>With this, our demo project is complete and can be deployed. For this blog post, we used <a href="https://www.heroku.com/">Heroku</a>, but it is up to the developer to chose which platform works best for them. As the deployment of a Nuxt project is not the target of this post, we shall not get in any details regarding this subject. For those who are interested in deployment with Heroku, I suggest you take a look at the blog post below.</p><p><a href="https://medium.com/@ale_colombo/deploy-nuxt-js-app-on-heroku-531a935bce90">Deploy Nuxt.js app on Heroku</a></p><p>You can visit our deployed demo <a href="https://pure-spire-55025.herokuapp.com/">here</a>, and check out the project&#39;s repo <a href="https://github.com/cvetkovskin/nuxt-amp-home-theater">here</a>.</p><h3>Conclusion</h3><p>By demonstrating the above project, we can see that it is possible to combine Nuxt (Vue) and AMP. This combination comes at the coast of the page initial load time as we need to adjust the Nuxt generated HTML to be suitable for AMP. After the initial load, the pages should be cached, and thus any subsequential load should be faster.</p><p>However, since Nuxt is a JavaScript dependent framework, while AMP requires all other JavaScript to be removed, I believe using both is a bit counterintuitive. Therefore, I would advise to carefully think about the purpose and potential goals of a project before you start its development so that the right framework can be chosen from the very start.</p><p>Nevertheless, the direction of a project is not always clear, nor does it always stays the same. And so, I hope this post will be of some help to those who might find themselves in a situation similar to ours.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ef904819de6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/making-a-website-with-nuxt-vue-and-amp-3ef904819de6">Making a website with Nuxt (Vue) and AMP</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Showcase site with Gridsome + Netlify]]></title>
            <link>https://medium.com/the-web-tub/building-a-showcase-site-with-gridsome-netlify-977d51432838?source=rss-c93a94c28ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/977d51432838</guid>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[gridsome]]></category>
            <category><![CDATA[static-site-generator]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nikola Cvetkovski]]></dc:creator>
            <pubDate>Fri, 01 Mar 2019 06:00:37 GMT</pubDate>
            <atom:updated>2019-03-03T04:56:14.169Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*sBTKnU6sNs3-fnCcEfmolA.png" /></figure><p>Although building a static website has its fair share of benefits, it has a large negative impact when it comes to creating and maintaining the site. This impact led many developers to leave the static building methodology and take up a dynamic approach. The dynamic approach is generally easier to develop and maintain thanks to pre-made generators and content management systems (CMS).<br>However, in recent years more and more static site generators have emerged that combine the advantages of traditional static websites with the convenience of development on par with dynamic ones.</p><p>In this article, we will cover the steps of how to build a simple showcase website using one such static site generator — Gridsome and deploy it almost immediately using Netlify. The website will solely display a list of books that will be fetched through their International Standard Book Number (ISBN) by using OpenLibrary’s API.</p><p>This article is written with the assumption that the reader has at least basic knowledge in <a href="https://vuejs.org/">Vue.js</a>, if not we advise you to continue reading after you become familiar with it. Knowledge of <a href="https://graphql.org/">GraphQL</a> is also preferred but not required.</p><h3>Why a static page?</h3><p>While dynamic pages are easy to maintain and develop, the cost and time to set up and host might not be worth it if the content of the website is mostly static.</p><p>In contrast, static websites are much cheaper and simpler to develop and host, and with the help of the static site generators their development is made even faster.<br>The downside is that any changes to the content would require a developer to manually apply them, however, most of these cases can be overcome via API calls from the client side (This may impose some security threats).</p><p>Therefore the decision of whether a website should be made dynamic or static is case-specific and should be made only after carefully considering the pros and cons of both options.</p><h3>Why Gridsome?</h3><p>Not more than a week ago Gridsome 0.5 was released and it caught our attention due to the technologies it uses.</p><blockquote>Gridsome is a Vue.js-powered, modern site generator for building the fastest possible websites for any Headless CMS, APIs or Markdown-files. Gridsome makes it easy and fun for developers to create fast, beautiful websites without needing to become a performance expert.</blockquote><p>In short, Gridsome allows you to create beautiful websites using Vue.js with features such as hot-reloading for better and faster local development, file-based page routing, static files generation for easy deployment, etc.<br>Content can be fetched through some of its source plugins or some external APIs, and then, stored in a local database where it can be accessed through its GraphQL data layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2KUTXjoTjT3kJA7Cv4I0lA.png" /><figcaption>Courtesy of Gridsome (<a href="https://gridsome.org/docs/how-it-works/">https://gridsome.org/docs/how-it-works/</a>)</figcaption></figure><h3>Let’s get started!</h3><p>The first thing we need to do is to install the Gridsome CLI tool. We can do that from the terminal by using Node or Yarn with the following command:</p><pre>// If using yarn<br>yarn global add @gridsome/cli</pre><pre>// If using npm<br>npm install --global @gridsome/cli</pre><p>Then we create our new project by using the gridsome create &lt;project-name&gt;command. In this case, we’ll use the name book-showcase for our project.</p><pre>gridsome create book-showcase</pre><p>If we enter inside the newly created folder, we can see that Gridsome has generated some sample pages — Home and About, as well as a default layout that surrounds their content in the layouts folder. If we run girdsome develop while inside the root of our project, we can see their content by accessing localhost:8080 .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EUHkwW_mr8Bg8nW7NJOgUA.png" /><figcaption>First view after running the develop command</figcaption></figure><p>Due to its hot reload feature if we change something in the generated page or layout files, the changes will immediately be shown on the screen.</p><h3>Creating the showcase</h3><p>Before creating the showcase, we probably want to change the name of our website, which is currently set to the default — Gridsome. We can do this by changing the siteName property in the gridsome.config.js file generated in the root of our project. Let’s name our site Book Showcase, and so our gridsome.config.js file should contain the following lines:</p><pre>module.exports = {<br>  siteName: &#39;Book Showcase&#39;,<br>  plugins: []<br>}</pre><p>Even though we changed the name, the link on the layout is still displaying the old value. This is because the hot-reload feature does not react to changes in the config files in the root folder. Therefore we need to stop our previous gridsome develop command and re-run it again.</p><p>Next, let’s create a new page for the showcase. We could have altered the contents of the Home.vue page, but we decided to create a new page to show off Gridsome’s automatic file-based page route generation feature. Create a new file called Showcase.vue in the pages folder of our project. As soon as we create this file, we can see Gridsome’s hot-reload feature generating a new route in the routes.js file located in the src/.temp folder. Furthermore, there is also an error 404 route that Gridsome automatically creates for us.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef9d80d63d8afec48b72db534bff9e34/href">https://medium.com/media/ef9d80d63d8afec48b72db534bff9e34/href</a></iframe><p>Although we created the new page and can access it by visiting localhost:8080/showcase, there is no way for the user to know how to access it. For that reason, let’s add a link to the Showcase page in the layout after the About link. We can do this by modifying the contents of the Default.vue layout file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c0168e6bf549c852cb9a2162edf4628/href">https://medium.com/media/8c0168e6bf549c852cb9a2162edf4628/href</a></iframe><p>As you can see we are using the globally available g-link component to easily make the link to the Showcase page.</p><blockquote><em>g-link</em> uses Intersection Observer to prefetch linked pages when link is in view. This makes browsing around in Gridsome very fast because the clicked page is already downloaded.</blockquote><p>Our webpage should now contain the link in the layout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vMMd_cXVJL8TFMQoHP7K1Q.png" /><figcaption>The website after changing the name and adding the showcase link</figcaption></figure><h3>Fetching the data</h3><p>To create our showcase, we first need some data. We will fetch a list of books through their International Standard Book Number (ISBN) by using OpenLibrary’s API. We have prepared a predetermined list of ISBNs for this example. Please feel free to use the same list for this tutorial.</p><p>In order to fetch the data and have it available for the whole website, we need to modify the gridsome.server.js file in our root folder. The data then will be generated and stored as static JSON at build time and can be fetched through GraphQL queries. As we will be using an external API, we will use the recommended axios package to fetch the data and, therefore, we need to install it:</p><pre>npm install axios --save</pre><p>After installing axios, modify the gridsome.server.js file to contain the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a52468e216b9e37529702516130b052/href">https://medium.com/media/7a52468e216b9e37529702516130b052/href</a></iframe><p>Shown above, there are several steps that Gridsome will perform before building our website.<br>First, we fetch the details of each book by calling the openlibraryAPI with the corresponding ISBN. <br>After we get all of the book details and store them in the books array, we use Gridsome’s Data Store API to create a new type in our GraphQL data layer by calling the store.addContentType() method.</p><blockquote>GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn’t tied to any specific database or storage engine and is instead backed by your existing code and data.</blockquote><p>In short, GraphQL allows you to define types, their fields and allows you to query or mutate those types’ fields. As seen in the code above, we are creating a type namedBookEntryand specifying the route that we’ll use in order to view the details of this data source. Afterward, we iterate the book list and add each book as a node (a new entry) of the newly created content type. Note that we could have added the route field to each individual node instead globally, but in that case, we would have to replace the :id parameter with each node’s id. By putting it in the addContentType method, we tell Gridsome to do that for us. We shall also see later when we create the details page for the books that Gridsome will automatically generate its route and connect it to this content type hence the need for this field.</p><p>As with gridsome.config.js, in order to apply the changes to the gridsome.server.js file, we need to re-run the gridsome develop command. Since we didn’t make any changes to the View, there’s no way for us to see the changes from there. Instead, Gridsome provides us with a GraphQL explorer (Playground) where we can get a list of all available collections as well as explore and test queries when in development mode. Access the Playground by going to <a href="http://localhost:8080/___explore">localhost:8080/___explore</a>.</p><p>The Playground is pretty simple. It is divided into two parts, the space for inputting queries and the result display. On the right edge of the screen, we also have two tabs called Docs and Schema. By opening the Docs tab, we can see a drawer open up, displaying all of our possible queries including the ones for our newly created content type, bookEntry and allBookEntry. As we can see from the picture below, it displays which parameters it gets, and what it can return.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FsWXirKlvNd-fsG5NMaqKQ.png" /><figcaption>GraphQL Playground</figcaption></figure><p>To confirm that our data has been properly propagated, let’s query the whole list of books, displaying only their ids and titles. If you’re unfamiliar with the GraphQL queries, you can read about it <a href="https://graphql.github.io/learn/queries/">here</a>. In summary, to query something in GraphQL, you specify the operation (in this case query) followed by the type that you wish to query and the desired fields you want to get in the response. We can do that by inputting the following query on the left side of the screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EX55Jz8x2M5ZZ6po5ivG1g.png" /><figcaption>Executing the query</figcaption></figure><p>From the picture above we can see that we are querying the allBookEntry type and request for the edges field. Because GraphQL focuses on getting only the data that you need, it requires you to specify the subfields as well. Therefore, we ask for the id and title fields that are contained in the node subfield of an edge. You can check which parameters you can fetch by reading the content of the allBookEntry query in the Docs tab.</p><p>After inputting the query and clicking the button in the middle, we should get the results on the right side as shown above. Take note that the allBookEntry query returns a collection of edges, each edge containing a node and its neighboring nodes. Gridsome automatically generates this query with some useful arguments for sorting, filtering, and pagination. For more details open the Docs tab in the Playground.</p><h3>Creating the view</h3><p>Now that our data has been loaded into our Data Layer we can finally go back to designing the view of our showcase. Open the Showcase.vue file and input the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b3c1e0e6e0395226f635eda42f26e9e/href">https://medium.com/media/9b3c1e0e6e0395226f635eda42f26e9e/href</a></iframe><p>From the code, we can see that all we do is fetch the books, iterate through each book and display the information we want to present.</p><p>We fetch the books through the &lt;page-query&gt; block where we can execute GraphQL queries in the same manner as in the Playground. The query we are using now is similar to the one we used before, but it contains more fields that we want to fetch (see the Docs tab in the Playground for details).<br>Gridsome offers two blocks for fetching data from the Data Layer, &lt;page-query&gt; and &lt;static-query&gt;. The former saves the result in the $page variable and should be used in pages and templates. The latter saves the result in the $static variable and is advised to be used in components.</p><p>After we get the data, we iterate it with the v-for directive and display each book’s data in a block. We make the title of each book a link (using &lt;g-link&gt;) to the detail page of that book (we’ll explain laterwards why the link points to /showcase/:id).</p><p>In this tutorial, we won’t use any UI framework, instead, we added some CSS to make the results look a bit more pleasant to the eye. We also added the shortenText method to limit one of the fields’ content to a maximum of 300 characters. The page should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vCej-3kwugoJNfBRA_-zlQ.png" /><figcaption>The Showcase page</figcaption></figure><h3>Creating the Detail Page</h3><p>Next step is to create the detail page for each book. Gridsome advises us to use templates for this purpose.</p><blockquote>Templates are used for single post views to <strong>GraphQL collections</strong>. Add a <strong>.vue</strong> file with the same name as a GraphQL collection to src/templates to create a template.</blockquote><p>Since our collection is called BookEntry, we need to create a BookEntry.vue file in our templates folder. After creating the file, its route will automatically be generated in routes.js. Notice that even though the file name is called BookEntry.vue the generated route is /showcase/:id. This is because we previously linked the BookEntry collection to this path and therefore Gridsome automatically connected them for us.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c77e7bc8796c29024360b9a8cfcdddbd/href">https://medium.com/media/c77e7bc8796c29024360b9a8cfcdddbd/href</a></iframe><p>Add the following code to the page:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cebdc044fb62fa2e0ad59ec2d63b6673/href">https://medium.com/media/cebdc044fb62fa2e0ad59ec2d63b6673/href</a></iframe><p>Similar to the Showcase page, we fetch the book data through the &lt;page-query&gt; block and display the data by accessing the content in the $page variable. The only difference here is that in order to fetch the corresponding BookEntry, we are using the $id route parameter that Gridsome populates for us automatically because of the route linking we did in the gridsome.server.js file. The page should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sR93zKDh4Lp1h39h-632LA.png" /><figcaption>The Details Page</figcaption></figure><h3>Deploying the website</h3><p>We successfully made our static showcase and are ready to present it to the world. The only thing left to do is to build it using the gridsome build command after which all of the needed files will be stored in the dist folder, and we’ll be ready to deploy our website.</p><p>There are many hosting services that we can use to deploy our website, but for the purpose of this tutorial, we decided to use Netlify which offers a rather simple (and free) way of deploying your website by just dragging the dist folder and dropping it in the specified area on their page. To do this, you will have to log in first or create a Free Plan account if you don’t have one already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R6EHjInvWzp_GUWrXFnjWQ.png" /><figcaption>Netlify Sites Screen</figcaption></figure><p>After dropping the dist folder, your website will automatically be hosted under a pre-generated hostname, which you can change in the Site Settings menu. In our case, we decided to host it at <a href="https://static-book-showcase.netlify.com/">https://static-book-showcase.netlify.com</a>.</p><p>You can view the whole project on <a href="https://github.com/cvetkovskin/gridsome-book-showcase.git">GitHub</a>.</p><h3>Conclusion</h3><p>As we saw in this tutorial, creating a website with Gridsome feels like a breeze, and if you use a service like Netlify, you can have your site up and running in no time.</p><p>Gridsome is still in its stage of development with its developers but from what we tried when making this tutorial we can only look forward to all of the features that should be added till the 1.0 version is out.</p><p>If any of you find Gridsome as amazing as we did and would like to contribute to it, make sure to check out their <a href="https://gridsome.org/">website</a> or <a href="https://github.com/gridsome/gridsome">Github repository</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=977d51432838" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/building-a-showcase-site-with-gridsome-netlify-977d51432838">Building a Showcase site with Gridsome + Netlify</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>