Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 404 and other fixes #1

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Publish
on:
workflow_dispatch:
pull_request:
pull_request_target:
branches:
- main

Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
click
pre-commit
PyYAML
Sphinx
sphinx-book-theme
sphinx-notfound-page
4 changes: 2 additions & 2 deletions scripts/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def extract_release(releases_dir, url):
os.remove(file)

def extract_releases(update, site_dir, config):
releases_dir = os.path.join(site_dir, 'releases')
releases_dir = os.path.join(site_dir, 'versions')
os.makedirs(releases_dir, exist_ok=update)
for release in config['releases']:
if update and os.path.exists(os.path.join(releases_dir, release['name'])):
Expand Down Expand Up @@ -64,4 +64,4 @@ def build(update, dir):
extract_releases(update, dir, config)

if __name__ == '__main__':
cli()
cli()
13 changes: 13 additions & 0 deletions src/404.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
==============
Page Not Found
==============

We cannot find the page. Please try:

- Starting the navigation from `https://oneapi-spec.uxlfoundation.org`_
- Clearing your `browser cache`_
- Filing a `GitHub issue`_

.. _`https://oneapi-spec.uxlfoundation.org`: https://oneapi-spec.uxlfoundation.org
.. _`browser cache`: https://clear-my-cache.com/
.. _`GitHub issue`: https://github.com/uxlfoundation/oneapi-spec/issues
6 changes: 4 additions & 2 deletions src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
html_theme = 'sphinx_book_theme'

html_theme_options = {
'repository_url': 'https://github.com/uxlfoundation/oneapi-spec',
'path_to_docs': 'releases',
'repository_url': 'https://github.com/uxlfoundation/oneapi-spec-site',
'path_to_docs': 'src',
'use_issues_button': True,
'use_edit_page_button': True,
'repository_branch': 'main',
Expand All @@ -56,3 +56,5 @@
html_sidebars = {
"**": []
}

notfound_urls_prefix = ""