diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index c2d618f..f7fc316 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,7 +1,7 @@ name: Publish on: workflow_dispatch: - pull_request: + pull_request_target: branches: - main diff --git a/requirements.txt b/requirements.txt index 76ca591..1503748 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,6 @@ +click +pre-commit +PyYAML Sphinx +sphinx-book-theme sphinx-notfound-page diff --git a/scripts/site.py b/scripts/site.py index 11faead..98a7c63 100644 --- a/scripts/site.py +++ b/scripts/site.py @@ -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'])): @@ -64,4 +64,4 @@ def build(update, dir): extract_releases(update, dir, config) if __name__ == '__main__': - cli() \ No newline at end of file + cli() diff --git a/src/404.rst b/src/404.rst new file mode 100644 index 0000000..142c56c --- /dev/null +++ b/src/404.rst @@ -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 diff --git a/src/conf.py b/src/conf.py index e0f73b8..ca1f222 100644 --- a/src/conf.py +++ b/src/conf.py @@ -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', @@ -56,3 +56,5 @@ html_sidebars = { "**": [] } + +notfound_urls_prefix = ""