Skip to content

Commit 5364bd8

Browse files
Allow search engine indexing of the documentation (#948)
* add sitemap * add robots.txt and configure sitemap * sphinx-sitemap pip install * bug
1 parent 4c745cc commit 5364bd8

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/pages.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131
fetch-depth: 0
3232
fetch-tags: true
3333
- name: install
34-
run: python -m pip install .
34+
run: |
35+
python -m pip install .
36+
python -m pip install sphinx-sitemap
3537
- name: Run jupyter notebooks
3638
run: |
3739
python -m ipykernel install

docs/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def git_upstream_url():
6666
'sphinx.ext.autosectionlabel',
6767
'sphinx_tabs.tabs',
6868
"sphinx.ext.linkcode",
69-
'myst_parser'
69+
'myst_parser',
70+
"sphinx_sitemap",
7071
]
7172
autosummary_generate = True
7273

@@ -110,6 +111,12 @@ def git_upstream_url():
110111
# This patterns also effect to html_static_path and html_extra_path
111112
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'requirements.txt']
112113

114+
# The html path allows for google search console verification through
115+
# Aditya Vijaykumar's gmail ID
116+
117+
html_extra_path = ['robots.txt', 'google063678b5c432c237.html']
118+
119+
113120
# The name of the Pygments (syntax highlighting) style to use.
114121
pygments_style = 'sphinx'
115122

@@ -150,6 +157,7 @@ def git_upstream_url():
150157
]
151158
}
152159

160+
html_baseurl = 'https://bilby-dev.github.io/bilby/'
153161

154162
# -- Options for HTMLHelp output ------------------------------------------
155163

docs/google063678b5c432c237.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-site-verification: google063678b5c432c237.html

docs/robots.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Sitemap: https://bilby-dev.github.io/bilby/sitemap.xml

0 commit comments

Comments
 (0)