This post covers how to get your site in the web using Netlify’s servers.
Some words you might not know
- Netlify: Netlify is a hosting platform specializing in hosting projects build with workflows like ours (static site generator and GitHub).
- They have a generous free pricing tier that is great for the kind of personal projects we’re doing in class.
- Deploy: This is the process of moving your files from your local dev environment (your computer and GitHub Repository) to a web site everyone in the world can see.
Steps to Deploy to Netlify
- Make sure you have a GitHub repository and have pushed your latest changes.
- You will need to have a build script in your package.json. If you used my eleventy basic template then you have the script. It’s this line
- “build”: “npx @11ty/eleventy”
- Sign up for Netlify using your GitHub account
- Click the “New site from Git” button
- Select “Github” as your Git provider
- Select your repository (username/my-eleventy-project)
- Check the following settings:
- Branch to deploy: main
- Base Directory: leave this blank
- Build Command: npm run build
- Publish directory: public
- Click the “Deploy site” button
It will go to a new screen and show that your site deploy is in process. When it’s done you will see a check mark next to step 1 on that screen.
If you get an error on your deploy, let me know and we’ll work through it.
Optional – Change your site name
by default your url will be something like https://wierd-words-12dsfdds.netlify.app You can change the front part so it is more like my-project.netlify.app.
- Click the “Site settings” button
- Click the “Change site name” button
- Enter the name you want (it will be the part before .netlify.app). Remember that it can not have spaces in the name.
- Click the “Save” button
Here are links to some other people going over Deploying to Netlify