nuxt3tailwindcloudflare

How to build a static blog part 4

Tuesday, 4 July 2023


Getting set up

You have a choice here, work along with this series of posts, or just clone / fork the repo, and make it yours. It's up on Github.

Open a terminal, and cd to where you usually start new projects, and give your blog a name. This bit is straight out of the Nuxt docs, by the way.

npx nuxi init my-epic-blog

Then lets cd my-epic-blog and open it in our code editor, code . if you are on VSCode.

Install the packages,

yarn install

and start the dev server.

yarn dev

If all is well, you should now be able to open http://localhost:3000 in your browser to see the Nuxt 3 welcome page.

Now is probably a good time to initialise git and set up a Github repo. So that we can set up automatic deployments, once we have something to deploy.

git init && git add . && git commit -m "init commit innit?"

The next step is to login to your GitHub account, and create a new repo. Then, as described in the Github instructions:

git remote add origin https://github.com/<YOUR USERNAME>/<YOUR REPO NAME>.git
git branch -M main
git push -u origin main

NB. You could also use GitLab, if you don't want to use GitHub here.

It's up to you when, and how, you want to commit your changes, make branches and so on. Later on we'll want to allow Cloudflare pages to have access to this repo, so we'll need to commit the finished blog on our main branch, and git push to trigger the depoyment.

Next post →


go back