Skip to content

Commit 9663b08

Browse files
committed
docs: update sphinx installation
1 parent ceb17b9 commit 9663b08

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

docs/installation/mkdocs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ To set up the PushPreview workflow in your MkDocs project:
7171

7272
```yaml
7373
- uses: actions/setup-python@v2
74-
with:
75-
python-version: 3.8 # Adjust the Python version as needed for your project
74+
with:
75+
python-version: 3.8 # Adjust the Python version as needed for your project
7676
```
7777

7878
1. Modify the **Build site step** to align with your MkDocs build process. For example:

docs/installation/pelican.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ To set up the PushPreview workflow in your Pelican project:
7171

7272
```yaml
7373
- uses: actions/setup-python@v2
74-
with:
75-
python-version: 3.8 # Adjust the Python version as needed for your project
74+
with:
75+
python-version: 3.8 # Adjust the Python version as needed for your project
7676
```
7777

7878
1. Modify the **Build site step** to align with your Pelican build process. For example:

docs/installation/sphinx.mdx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ To set up the PushPreview workflow in your Sphinx project:
7171

7272
```yaml
7373
- uses: actions/setup-python@v2
74-
with:
75-
python-version: 3.8 # Adjust the Python version as needed for your project
74+
with:
75+
python-version: 3.8 # Adjust the Python version as needed for your project
7676
```
7777

7878
1. Modify the **Build site step** to align with your Sphinx build process. For example:
@@ -97,13 +97,29 @@ To set up the PushPreview workflow in your Sphinx project:
9797
pushpreview-token: ${{ secrets.PUSHPREVIEW_TOKEN }}
9898
```
9999

100-
1. Save your changes and push the updated `pushpreview.yml` file to your repository.
101-
102100
## 2. Configure the GitHub secret
103101

104102
<GitHubSecret />
105103

106-
## 3. Verify the installation
104+
## 3. Edit Sphinx configuration
105+
106+
To ensure your Sphinx site correctly supports preview builds, you'll need to adjust the base URL setting in the Sphinx configuration.
107+
This modification allows your site to correctly resolve URLs in the context of the preview environment.
108+
109+
Follow the steps below to make these changes:
110+
111+
1. Open the `conf.py` file located in the root directory of your Sphinx project.
112+
113+
1. Modify the `base_url` setting to dynamically adapt to different environments, particularly for preview deployments. Update the setting as follows:
114+
115+
```python
116+
import os
117+
html_baseurl = os.getenv('BASE_URL', 'https://yourdomain.extension')
118+
```
119+
120+
1. Save your changes and push the updated `pushpreview.yml` file to your repository.
121+
122+
## 4. Verify the installation
107123

108124
<VerifyInstallation />
109125

0 commit comments

Comments
 (0)