Skip to content

Commit fb0012a

Browse files
committed
Update Post “2019-02-27-jamstack-and-cd-pipelines-create-a-blog-with-nuxt-netlify-cms-and-netlify”
1 parent 113aa0e commit fb0012a

File tree

1 file changed

+75
-2
lines changed

1 file changed

+75
-2
lines changed

content/blog/2019-02-27-jamstack-and-cd-pipelines-create-a-blog-with-nuxt-netlify-cms-and-netlify.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description: >-
1313
keywords: >-
1414
vue.js jamstack netlify cms blog how-to tutorial guide nuxt.js netlifycms cd
1515
continuous development vue nuxt
16-
date: '2019-02-27T16:15:19-06:00'
16+
date: '2019-03-01T21:15:00-06:00'
1717
thumbnail: /images/uploads/john-barkiple-539580-unsplash-micro.jpeg
1818
---
1919
## The "old" ways
@@ -68,4 +68,77 @@ All in all, these are amazing tools that let us create blazing fast sites, in a
6868

6969

7070
## Getting started
71-
TBD
71+
For this, we'll only be needing:
72+
- Github account
73+
- Netlify account
74+
- Vue/Nuxt understanding
75+
76+
## Fork the repo
77+
Using your Github account, go ahead and [click here](https://github.com/israelmuca/israelmuca.dev/fork) to fork the repo or just [clone it](https://github.com/israelmuca/israelmuca.dev).
78+
79+
## Build Setup
80+
Install all the dependencies
81+
``` bash
82+
npm i
83+
```
84+
85+
Now, you can run the code in development with:
86+
``` bash
87+
npm run dev
88+
```
89+
This will serve your page in `localhost:3000` with hot reload.
90+
91+
Once you're ready to generate your static assets for production:
92+
``` bash
93+
npm run generate
94+
```
95+
This will create a `/dist` folder with the assets. This folder is not committed.
96+
This is what Netlify will be building on their server, and then uploading the results to their CDN. *We don't need to do this manually ever.* We just do it for the sake of watching what happens inside Netlify.
97+
98+
## Configure your *new* repo
99+
100+
### Netlify CMS
101+
You'll need to define your fields and files for your content. I'm using defaults very similar to what you can see in [dev.to](https://dev.to). Mostly covering the title, description and keywords for SEO purposes, also a little summary of the post as well as a main image which is used both in the ArticleCard.vue and the Header.vue in the blog post page.
102+
103+
You can configure these fields in: `static/admin/config.yml`, and feel free to check the [Netlify CMS Documentation](https://www.netlifycms.org/docs/configuration-options/) for extra customization.
104+
105+
While your local server is running, you can access [localhost:3000/admin/](localhost:3000/admin/) to modify the content of your blog. You can also do it once it's deployed when you have the Netlify's address that's given to you.
106+
107+
### Routes
108+
In here, both Nuxt and Nuxtdown work together to create the routes in the website.
109+
110+
In the `pages` directory, you'll find an `index.vue` which is, as the name implies, the index of our site.
111+
**This is handled by Nuxt**.
112+
113+
The `pages/blog/` directory will work as a directory in our site as well (israelmuca.dev/blog/... in my case), which will hold all the blog posts that are created using the `_blogpost.vue` template inside. It will be compiled once for each `.md` in the `content/blog/` directory. You can see how the content is fetched inside of that `.vue` file.
114+
**This is handled by Nuxtdown**.
115+
116+
You can configure Nuxtdown in: `nuxtdown.config.js`, and please go ahead and check the [Nuxtdown Documentation](https://github.com/joostdecock/nuxtdown-module/blob/master/README.md) to further understand what is happening or to change the functionality.
117+
118+
### The rest of the site
119+
The rest of the site is a regular Vue + Nuxt app, I tried to comment the code where I think it's needed the most, and you can configure Nuxt in: `nuxt.config.js`, also, as usual, please check the [Vue.js](https://vuejs.org/v2/guide/) and [Nuxt.js](https://nuxtjs.org/guide/) documentation to further understand this code if you have any questions.
120+
121+
122+
## Congratulations
123+
By this point, you should have a fully functional Nuxt generated, Netlify hosted, blog site.
124+
125+
## Issues
126+
If you have any problems implementing this, please don't hesitate and create a Github Issue or send me a [tweet](https://twitter.com/IsraelMuCa).
127+
128+
## Thanks
129+
There's a phrase that I love and always try and remember:
130+
> _If I have seen further it is by standing in the shoulders of Giants_
131+
> - Isaac Newton
132+
133+
Being true to that phrase, I have to acknowledge the many people that in one way or another contributed to this specific repo:
134+
- [Andrea Gomez - with her design](https://twitter.com/acgomezu)
135+
- [Vue.js](https://vuejs.org/)
136+
- [Nuxt.js](https://nuxtjs.org/)
137+
- [Netlify CMS](https://www.netlifycms.org/)
138+
- [Nuxtdown](https://www.npmjs.com/package/nuxtdown)
139+
- [Bulma](https://www.bulma.io)
140+
- [Prism](https://prismjs.com/)
141+
- [renestalder's template](https://github.com/renestalder/nuxt-netlify-cms-starter-template)
142+
- [Netlify](https://www.netlify.com/)
143+
144+
Thanks again, and read ya'll soon!

0 commit comments

Comments
 (0)