diff --git a/preview/README.md b/preview/README.md index fe7eb6d..cff9c76 100644 --- a/preview/README.md +++ b/preview/README.md @@ -56,4 +56,5 @@ These are all the parameters this action supports: * `message-template` (_optional_): Text message to be injected by the action in the Pull Request description. It supports the following placeholders to be replaced: * `{docs-pr-index-url}`: URL to the root of the documentation for the Pull Request preview. * `platform` (_optional_): Read the Docs Community (`community`) or Read the Docs for Business (`business`). (default: `community`) -* `single-version` (_optional_): Set this to `'true'` if your project is single version, so we can link to the correct URL. (default: `'false'`) +* `single-version` (_optional_): Set this to `'true'` if your project is single version, so we can link to the correct URL. (`/`) (default: `'false'`) +* `single-language` (_optional_): Set this to `'true'` if your project is multi-version but single language, so we can link to the correct URL. (`/$version/`) (default: `'false'`) diff --git a/preview/scripts/edit-description.js b/preview/scripts/edit-description.js index b4b739e..a7788fc 100644 --- a/preview/scripts/edit-description.js +++ b/preview/scripts/edit-description.js @@ -4,6 +4,7 @@ module.exports = async ({inputs, github, context}) => { const RTD_PROJECT_LANGUAGE = inputs["project-language"]; const RTD_PLATFORM = inputs["platform"]; const RTD_SINGLE_VERSION = inputs["single-version"]; + const RTD_SINGLE_LANGUAGE = inputs["single-language"]; let RTD_DOMAIN = ""; let RTD_URL = ""; @@ -19,6 +20,8 @@ module.exports = async ({inputs, github, context}) => { if (RTD_SINGLE_VERSION === "true") { RTD_URL = RTD_PROJECT_DOMAIN; + } else if (RTD_SINGLE_LANGUAGE) { + RTD_URL = RTD_PROJECT_DOMAIN + `${RTD_SINGLE_LANGUAGE}/`; } else { RTD_URL = RTD_PROJECT_DOMAIN + `${RTD_PROJECT_LANGUAGE}/${PR_NUMBER}/`; }