Skip to content

Commit 90d7307

Browse files
authored
Merge pull request #5982 from kenjis/deploy-userguide-latest-edit-this-page
chore: add "Edit this page" to the userguide latest
2 parents 614a717 + b6605e9 commit 90d7307

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/deploy-userguide-latest.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,25 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v3
2323

24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: '8.0'
28+
coverage: none
29+
2430
# Build the latest User Guide
2531
- name: Build with Sphinx
2632
uses: ammaraskar/sphinx-action@0.4
2733
with:
2834
docs-folder: user_guide_src/
2935

36+
- name: Add "Edit this page" links
37+
run: |
38+
cd user_guide_src
39+
# Fix permissions
40+
sudo chown -R runner:docker build/html/
41+
php add-edit-this-page build/html/
42+
3043
# Create an artifact of the html output
3144
- name: Upload artifact
3245
uses: actions/upload-artifact@v3

user_guide_src/add-edit-this-page

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ foreach ($files as $filePath => $fileInfo) {
4747
continue;
4848
}
4949

50-
$pattern = '/<div role="navigation" aria-label="breadcrumbs navigation">/u';
50+
$pattern = '/<div class="rst-content">/u';
5151
$content = preg_replace(
5252
$pattern,
53-
$gitHubLink . PHP_EOL . '<div role="navigation" aria-label="breadcrumbs navigation">',
53+
'<div class="rst-content">' . PHP_EOL . $gitHubLink . PHP_EOL,
5454
$content
5555
);
5656

0 commit comments

Comments
 (0)