HOWTO Create a landing page on Netlify

Introduction

This document is a detailed walkthrough of the steps performed to create a landing page on https://baroloteam.online.

Step-by-step instructions

Register a domain name

Choose your preferred domain registrar and buy an available domain.

In our example I logged into https://register.it and purchased baroloteam.online.

image

Create a project on Netlify

Login to https://www.netlify.com/ (or Sign up if you do not have an account yet).

You should be redirected to this page:

image

In the “Sites” panel, click Add a new site

image

If you already have a source project select the first option and provide the requested information.

In our case baroloteam.online#1 was still open so I chose Start from a template instead.

A few templates will be proposed which you can start from:

image

Choose one proposed template, or click Browse more templates to expand the list.

If you are still not satisfied, Google is your friend :wink:

You may also revert your previous choice and click the “Import from a Git repository” link.

In our example, I chose the “Gatsby E-commerce Theme”: Live demo, Source code.

You will be presented with the following choices

image

Click Clone to GitHub, then in section “Set up your site”

  • Team: (accept default)

  • Repository settings:

    • Repository name: gatsby-ecommerce-theme

    • Repository visibility: Public

then click Deploy site.

This command will create a new public repository https://github.com/gmacario/gatsby-ecommerce-theme on GitHub, then will start building the site.

If the build is successful you should be presented a page like this:

image

Click on the Open production deploy link and browse the site which has been generated.

image

Apply a template to a source repository

We can easily apply template “gatsby-ecommerce-theme” to the source repository “baroloteam.online” using the following shell commands

# Clone source repository
mkdir -p ~/github/B-AROL-O
cd ~/github/B-AROL-O
git clone https://github.com/B-AROL-O/baroloteam.online

# Add a git remote for the template repository
cd ~/github/B-AROL-O/baroloteam.online
git remote add template https://github.com/netlify-templates/gatsby-ecommerce-theme
git fetch --all --prune

# Create a feature branch
git checkout main
git pull --all --prune
git checkout -b feat/apply-gatsby-template
git merge --allow-unrelated-histories template/main

The last command may return errors, such as

gianpaolo.macario@HW2457 MINGW64 ~/github/B-AROL-O/baroloteam.online (feat/apply-gatsby-template)
$ git merge --allow-unrelated-histories template/main
Auto-merging README.md
CONFLICT (add/add): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.

gianpaolo.macario@HW2457 MINGW64 ~/github/B-AROL-O/baroloteam.online (feat/apply-gatsby-template|MERGING)
$

If so, inspect the problems with git status then

git status
vi README.md # Reconcile merge conflicts
git add -A
git commit -sm "Manually merge with template/main"

Update site contents

You may update the contents of the site by pushing new commits on the main branch of the source repository.

Configure Google Analytics

Please refer to HOWTO Configure Google Analytics for details.

TODO

Deploy to official URL

TODO