Skip to content

Commit 1ec92d1

Browse files
authored
Merge pull request #93 from xylar/fix-docs-action
Fix docs action again
2 parents 9551ea4 + 59c4913 commit 1ec92d1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: .github/workflows/docs_workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
rm -rf gh-pages/${{ github.ref_name }}
6464
6565
# don't clobber existing release versions (in case we retroactively fixed them)
66-
cp -r -n _build/html/${{ github.ref_name }} gh-pages/
66+
cp -r _build/html/${{ github.ref_name }} gh-pages/
6767
6868
mkdir -p gh-pages/shared
6969
cp shared/version-switcher.js gh-pages/shared/version-switcher.js

Diff for: docs/generate_versions_json.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
)
1414
args = parser.parse_args()
1515
local = args.local
16-
output_dir = '_build/html/shared'
17-
version_dir = '_build/html' if local else 'gh-pages'
16+
base_dir = '_build/html' if local else 'gh-pages'
17+
shared_dir = os.path.join(base_dir, 'shared')
1818

1919
entries = []
2020

21-
versions = sorted(os.listdir(version_dir))
21+
versions = sorted(os.listdir(base_dir))
2222
if 'main' in versions:
2323
versions.insert(0, versions.pop(versions.index('main')))
2424

2525
for name in versions:
26-
path = os.path.join(version_dir, name)
26+
path = os.path.join(base_dir, name)
2727
if os.path.isdir(path) and name not in ('shared',):
2828
entries.append({
2929
'version': name,
3030
'url': f'../{name}/' if local else f'/{name}/'
3131
})
3232

33-
os.makedirs(output_dir, exist_ok=True)
34-
with open(os.path.join(output_dir, 'versions.json'), 'w') as f:
33+
os.makedirs(shared_dir, exist_ok=True)
34+
with open(os.path.join(shared_dir, 'versions.json'), 'w') as f:
3535
json.dump(entries, f, indent=2)

0 commit comments

Comments
 (0)