The barest minimum.
Install Pandoc if necessary, then:
bin/build.sh
The built site is in the build
directory.
Install Python if necessary, then:
cd build
python3 -m http.server
Test by going to http://localhost:8000/
Use Netlify to serve a static site from a repo on github/gitlab/bitbucket.
- Add a new site.
- a. Import an existing project: connect to the repo.
- b. Authorize configuration on Github.
- c. "Deploy settings" -> Basic build settings:
- Base directory: leave blank (means toplevel of repo)
- Build command:
bin/build.sh
- Publish directory:
build
- Click "Deploy Site" and wait for the site to be updated automatically.
Test by going to the site given by Netlify (like https://distracted-goldfish-ab4928.netlify.app
).
- Choose a domain for the site (like
foo.net
). Buy a domain from Namecheap if you want. - Go to the DNS provider (same as the domain registrar unless specified differently).
- Go to Advanced DNS settings and add a new DNS record for
www
.
- a. type: CNAME
- b. hostname:
www
(or whatever host you want for the site page). - c. the hostname from Netlify (will end in netlify.app). Remove the
https://
and the trailing/
.
- Configure Netlify to handle
www.foo.net
.
- a. "Site Settings"
- b. "Add a custom domain":
www.foo.net
- c. "Add domain"
- d. click on "Provision certificate" to enable https
- Add a DNS record to redirect the bare site (like https://foo.net, without any
www.
) to thewww
site.
- a. type: URL Redirect
- b. hostname:
@
(this means bare site) - c. target:
https://www.foo.net
Test by going to your own site (like https://foo.net).
Netlify will only publish updates to the site, if the site builds successfully.
If the site is build successfully locally, your best tool to diagnose the problem is to view the Deploy logs.
- Click on "Site overview" on the site's netlify home page.
- Click on the relevant deploy in the "Production deploys" section.
- The topmost deploy is the most recent build.
- There will be an label if a build was successfully "Published" or if its publishing "Failed".
On that page will be the "Deploy log" for that build.