Deploy a Maudit website
Deploy a static website built with Maudit and Rust on Clever Cloud.
Maudit is an open source Rust library for generating static websites. A Maudit project is a regular Rust program that generates its pages and assets during the build phase.
Create a Maudit project
You need Git and Rust to follow this guide. Install the Maudit CLI and start its interactive project generator:
cargo install maudit-cli
maudit initEnter myMauditSite as the project directory, select the Basics template and decline the Git repository initialization. Then move into the generated project:
cd myMauditSiteIf you already have a Maudit project, run the following commands from its root directory.
Create a Static application
Install Clever Tools, log in and create a Static application linked to your project folder:
npm i -g clever-tools
clever login
clever create -t static
# Or link an existing Clever Cloud application:
clever link your_app_name_or_IDClever Tools targets your personal organisation by default. To use another organisation, add --org ORGANISATION or -o ORGANISATION when you create or link the application.
Configure the application
Use a dedicated S build instance, then set the generated website directory and the command Clever Cloud runs during the build phase:
clever scale --build-flavor S
clever env set CC_WEBROOT "/dist"
clever env set CC_BUILD_COMMAND "cargo run --jobs 1 --config profile.dev.debug=0"Some Maudit dependencies require significant memory to compile. On an S build instance, a plain cargo run can compile several dependencies in parallel and exhaust the available memory. The --jobs 1 option compiles them sequentially, while --config profile.dev.debug=0 omits debug information that is unnecessary for generating a static website.
These options allow the build to use the smallest tested instance size. The command then runs the Maudit project to generate the website in dist/, whose contents are served by the Static runtime from its default XS instance.
Deploy the website
Commit the project and deploy it:
git init
git add .
git commit -m "First deploy"
clever deploy
clever openYou can display your website’s URL or add a custom domain. A custom domain also requires DNS configuration:
clever domain
clever domain add your.website.tldLearn more
Did this documentation help you ?