Skip to content

Commit faa16bf

Browse files
committed
docs: Set html_baseurl
This will cause the `canonical` tag to be added tot the head, which is very important for SEO. The DOCS_BASE_URL setting in CI is a bit awkward, but I'm not so sure what the right way to do this would be.
1 parent c6790b1 commit faa16bf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
- uses: webfactory/ssh-agent@v0.5.4
2323
with:
2424
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
25+
- name: Set env for production build
26+
if: github.ref == 'refs/heads/master'
27+
run: |
28+
echo "DOCS_BASE_URL=docs.hypernode.io" >> $GITHUB_ENV
2529
- run: hypernode-deploy build -vvv
2630
- name: archive production artifacts
2731
uses: actions/upload-artifact@v3

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file only contains a selection of the most common options. For a full
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
import os
67

78
# -- Path setup --------------------------------------------------------------
89

@@ -71,6 +72,8 @@
7172
}
7273
html_show_sphinx = False
7374
html_show_sourcelink = False
75+
if os.getenv("DOCS_BASE_URL"):
76+
html_baseurl = os.getenv("DOCS_BASE_URL")
7477

7578
# Add any paths that contain custom static files (such as style sheets) here,
7679
# relative to this directory. They are copied after the builtin static files,

0 commit comments

Comments
 (0)