Too busy to start from scratch, but excited to start learning how to use an API-based CMS? Get this blog up and running in minutes, then deploy it statically to Netlify for rapid page load times. Modify and adapt it to your liking, it's all yours!
For this project, we provide you with all the source code you need to get your blog up and running. So let's go.
Install the Prismic Command Line Tool
If you don't already have it, make sure to first install npm on your machine.
Fire up a terminal (command prompt or similar on Windows) and run the following command.
npm install -g prismic-cli
Sometimes it's possible that this command doesn't work. If that's the case for you, try executing a sudo command:
sudo npm install -g prismic-cli
The Prismic command is now available globally. We will now use that tool to launch this tutorial project. In the terminal, navigate to the location you want to launch your project and run the following command.
prismic theme https://github.com/prismicio/nuxtjs-blog.git --conf nuxt.config.js
prismic theme command will initialize a Nuxt.js project that is configured to connect with the repository you just created!
The command will end by displaying a link to your content repository backend in the form of https://your-repo-name.prismic.io.
Write some content
Start by filling in your photo, your name and a headline for your blog's home.
Go to "Content" and hit "New", choose the Blog's home type and fill it with your own content. Save and publish!
Now, write a few blog posts. Make sure to fill the mandatory UID field that is used for your post's URL. Save and publish!
Run the blog
Go back to terminal (command prompt or similar on Windows), point it to your project location (cd your-project-folder) and run!
npm run dev
This will launch a local development server at http://localhost:3000.
Deploy & go live!
If you want to deploy your website, Netlify is a great option, as it allows you deploy as both a SPA and a Statically built website. Simply follow the instructions on the Nuxt.js website on how to deploy on Netlify.
And that's it deploy your website and your live.
Customize to your liking
You should easily find what to modify in the code to customize the blog: just edit the stylesheets and the templates to fit your design!
Just curious about the code?
If you aren't interested in recreating this project and would just like to look at the code then you can download the project here.