Configuration¶
Configuration properties with default values:
mkdocs { // mkdocs sources sourcesDir = 'src/doc' // strict build (fail on build errors) strict = true // target build directory (publication root) buildDir = 'build/mkdocs' // automatically update site_url in mkdocs.yml before mkdocsBuild updateSiteUrl = true publish { // publication sub-folder (by default project version) docPath = '$version' // generate index.html' for root redirection to the last published version rootRedirect = true // publish repository uri (bu default the same as current repository) repoUri = null // publication branch branch = 'gh-pages' // publication comment comment = 'Publish $docPath documentation' // directory publication repository checkout, update and push repoDir = '.gradle/gh-pages' } }
By default:
- All documentation sources located in
src/doc
(andmkdocsInit
task generate stubs there) mkdocsBuild
task will build site intobuild/mkdocs
- Current project version is used as documentation folder (
build/mkdocs/$version
) - Github repository is assumed by default, so publication will be performed into
gh-pages
branch (where github will automatically detect it)
Note
In order to include something else into published docks (e.g. javadoc) see publication.
Single version site¶
If you don't want to use multi-version support at all then:
mkdocs.publish.docPath = '' // or null
This way, mkdocs site will always be published at the root (in case of publish it will always replace previous site version).