Introduction
An SSG (Static Site Generator) site is a type of website that is generated from pre-built files rather than being dynamically generated by a server upon each request. On Altitude, you do not need to provide us with your built files, we can seamlessly manage your build step and provide you with a number of additional great factors.
- Automatic Index Documents: For SSG sites, if a request is made to a root folder (
/foofor example), we will automatically check for the existence of an index document for that folder (/foo/index.htmlin this example) and serve this without any rewrite logic needed. - Custom Error Page: You can show a custom 404 page when one of your customers requests an invalid path. For this to happen automatically, you can create a document under the path of
/404.html.
Set-up
1. Edge Configuration
First set up your Altitude.yaml file to use static as a rendering type. This will let us know that your project has pre-built the HTML required to serve a page. An example config file is shown below:
altitude.yaml
version: v2.1
provider: cloudflare
routes:
- pathPrefix: /
name: <your function/site name>
type: static
directory: .
build:
command: <your projects build command>
output:
directory: <your projects build directory (for e.g. dist)>
2. Build & Deploy.
Now you’re ready to build and deploy.
Further Reading
- Learn how to deploy on Altitude