Deploy an mdBook website
mdBook is a command-line tool for creating modern online books and documentation. It is designed to help you write and organize your content in a structured way.
Requirements
If you need an example source code, init a new project (you’ll need git and Rust):
cargo install mdbook
mdbook init myStaticApp --title="my mdBook" --ignore=gitDeploy a static application
You can create an application in our Console or through Clever Tools. Install them with npm or any supported package manager:
# Install with npm or any supported method
npm i -g clever-tools
# Login to Clever Cloud and check it worked
clever login
clever profileGo to the folder where you want to create your application, initialize a Git repository and create the linked application:
cd myStaticApp
git init
clever create -t staticTo deploy on Clever Cloud, your local folder needs to be an initialized Git repository linked to an application. If you already have an application on Clever Cloud and want to link it to the current local folder:
clever link your_app_name_or_IDAutomatic build
mdBook is one of the static site generators supported by the Static runtime automatic build, so you don’t need any additional build configuration.
Push your code
Once you complete these steps, commit your content to the local repository and deploy it:
git add .
git commit -m "First deploy"
clever deploy
clever openYou can display your website’s URL or add a custom domain to it (you’ll need to configure DNS):
clever domain
clever domain add your.website.tld404 page location
If you need to use a specific page for 404 errors, define its location with the SERVER_ERROR_PAGE_404 environment variable from Static Web Server, used by default in the Static runtime. For example: SERVER_ERROR_PAGE_404=404.html.