Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 15610f2

Browse filesBrowse files
committed
Add Sphinx logic for managing static redirect files.
Add a redirect for BigQuery from 'usage.html' -> 'index.html'.
1 parent d2a2a0d commit 15610f2
Copy full SHA for 15610f2

File tree

Expand file treeCollapse file tree

2 files changed

+27
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+27
-0
lines changed

‎bigquery/docs/usage.html

Copy file name to clipboard
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html>
2+
<head>
3+
<meta http-equiv="refresh" content="1; url=./index.html:" />
4+
<script>
5+
window.location.href = "./index.html"
6+
</script>
7+
</head>
8+
</html>

‎docs/conf.py

Copy file name to clipboardExpand all lines: docs/conf.py
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import email
2727
import os
2828
import pkg_resources
29+
import shutil
2930

3031
# If extensions (or modules to document with autodoc) are in another directory,
3132
# add these directories to sys.path here. If the directory is relative to the
@@ -319,3 +320,21 @@
319320
'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),
320321
'python': ('https://docs.python.org/3', None),
321322
}
323+
324+
# Static HTML pages, e.g. to support redirects
325+
# See: https://tech.signavio.com/2017/managing-sphinx-redirects
326+
# HTML pages to be copied from source to target
327+
static_html_pages = [
328+
'bigquery/usage.html',
329+
]
330+
331+
def copy_static_html_pages(app, docname):
332+
if app.builder.name == 'html':
333+
for static_html_page in static_html_pages:
334+
target_path = app.outdir + '/' + static_html_page
335+
src_path = app.srcdir + '/' + static_html_page
336+
if os.path.isfile(src_path):
337+
shutil.copyfile(src_path, target_path)
338+
339+
def setup(app):
340+
app.connect('build-finished', copy_static_html_pages)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.