MkDocs with Surge (minimal configuration)
- Edit
mkdocs.ymlanddocs/index.md, add more files if needed. - Change the
docs/CNAMEto the desiredexample.surge.sh. Or you can use the custom domainexample.com - Add the pip package to
requirements.txt. (Themes and plugins) - Get a token with the command
surge token. - The API Key will be displayed, so save this text string.
- Select
Settingsfor your GitHub project. - Select
Secrets and variablesinSecrets. - Select
Actions - Select
New repository secrets. - Enter
SURGE_LOGINin Name and Surge login email in Value. - Select
New repository secrets. - Enter
SURGE_TOKENin Name and token in Value. - Commit to a GitHub project:
git push
Many of the build error are that you mistyped mkdocs.yml
or you forgot to add the package to requirements.txt.
Check the file change immediately before the error occurred.
This is often not a problem with this project.
You should not open an issue for that.
*.surge.sh/robots.txt is fixed.
*.surge.sh rejects the search engine crawler.
If you want to use Surge properly, use Custom Domain.
This sample also uses the EU.org domains, and Surge deploys it with a custom domains.