From 0ea60e1dc9648a911266a31b750c52480163ed28 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Tue, 16 Jul 2024 14:39:38 -0700 Subject: [PATCH 1/2] Set html_baseurl (#50) readthedoc will deprecate setting html_baseurl automatically soon soon. Now we set it explicitly in conf.py. https://about.readthedocs.com/blog/2024/07/addons-by-default/#how-does-it-affect-my-projects --- conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 037a465..67c77b7 100644 --- a/conf.py +++ b/conf.py @@ -18,7 +18,7 @@ # -- Project information ----------------------------------------------------- project = 'EditorConfig Specification' -copyright = '2019--2020, EditorConfig Team' +copyright = '2019--2024, EditorConfig Team' author = 'EditorConfig Team' version = '0.16.0' @@ -26,6 +26,11 @@ # -- General configuration --------------------------------------------------- +import os + +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + # The master document master_doc = 'index' From 755ddfdf06c6cb3846cf9f157b947e5fa3133921 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Tue, 16 Jul 2024 15:11:51 -0700 Subject: [PATCH 2/2] Enable previewing generated doc in PR (#51) --- .github/workflows/preview.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..dda3ea6 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,19 @@ +# Preview the generated doc in pull requests. + +name: Preview Generated Docs +on: + pull_request: + branches: ["master"] + +permissions: + pull-requests: write + +jobs: + documentation-links: + name: Preview Docs + runs-on: ubuntu-latest + steps: + - uses: readthedocs/actions/preview@v1 + with: + project-slug: "editorconfig-specification" + single-version: true