Hosting a Static Blog on Netlify

β€” 2 minute read

permalink

In Yesterday's post, we learned how to create a static blog with eleventy, but having a blog local doesn't really bring us much fun, does it?

To give you some recap Netlify is an awesome static host. There are about a million more options, but I like to explore Netlify today since that is what I am using.

And the best of all they offer a free tier, see more on their pricing page.

So let's see how we can host our created blog on Netlify.

Deploying our Static blog with Netlify permalink

Creating an account on Netlify permalink

Head over to Netlify Signup and log in using your preferred method of authentication.

I am using GitHub because my project is on GitHub.

Creating a new site on Netlify permalink

Once we set up and created our account on Netlify we can go ahead and add a new site from Git.

This way, our website can incorporate automatic deployments later on.

I'm choosing GitHub here as an option; it will now ask you to authenticate with GitHub and asks you which repository you would like to use. Let's choose the blog we created yesterday.

Netlify build settings permalink

Netlify is amazing enough to help us get started to it will help us set a build command:

npx eleventy

And set the Publish directory to be _site for our project.

Now click Deploy site and wait a couple of seconds.

Netlify extra's permalink

Netlify comes with some amazing options

  • We can set up a custom domain like https://daily-dev-tips.com
  • We can secure the website (Highly recommended!)
  • We can add Forms
  • We can even add Netlify functions

Viewing our deployed website permalink

Once the project is deployed, click and visit your website.

See our website here!

Want to learn how to add a page to this blog?

Auto deployment permalink

Because we linked Netlify to our GitHub project every time we publish to the Master branch, we will automatically deploy to Netlify, isn't that just great? πŸ”₯

Thank you for reading, and let's connect! permalink

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter