diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bd7b3af1..370ba4a3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,7 +2,7 @@ name: Documentation on: push: - branches: [main] + branches: [main, bugfix/docs*] release: types: [published] workflow_dispatch: diff --git a/build_scripts/copy_changelog.py b/build_scripts/copy_changelog.py deleted file mode 100644 index 21de453d..00000000 --- a/build_scripts/copy_changelog.py +++ /dev/null @@ -1,38 +0,0 @@ -import logging -import os -from pathlib import Path - -import mkdocs.plugins - -logger = logging.getLogger(__name__) - -root_dir = Path(__file__).parent.parent -docs_dir = root_dir / "docs" -changelog_file = root_dir / "CHANGELOG.md" -target_filepath = docs_dir / changelog_file.name - - -@mkdocs.plugins.event_priority(100) -def on_pre_build(config): - logger.info("Temporarily copying changelog to docs directory") - try: - if os.path.getmtime(changelog_file) <= os.path.getmtime(target_filepath): - logger.info( - f"Changelog '{os.fspath(changelog_file)}' hasn't been updated, skipping." - ) - return - except FileNotFoundError: - pass - logger.info( - f"Creating symbolic link for '{os.fspath(changelog_file)}' " - f"at '{os.fspath(target_filepath)}'" - ) - target_filepath.symlink_to(changelog_file) - - logger.info("Finished copying changelog to docs directory") - - -@mkdocs.plugins.event_priority(-100) -def on_shutdown(): - logger.info("Removing temporary changelog in docs directory") - target_filepath.unlink() diff --git a/build_scripts/copy_contributing.py b/build_scripts/copy_contributing.py deleted file mode 100644 index bce3936a..00000000 --- a/build_scripts/copy_contributing.py +++ /dev/null @@ -1,38 +0,0 @@ -import logging -import os -from pathlib import Path - -import mkdocs.plugins - -logger = logging.getLogger(__name__) - -root_dir = Path(__file__).parent.parent -docs_dir = root_dir / "docs" -contributing_file = root_dir / "CONTRIBUTING.md" -target_filepath = docs_dir / contributing_file.name - - -@mkdocs.plugins.event_priority(100) -def on_pre_build(config): - logger.info("Temporarily copying contributing to docs directory") - try: - if os.path.getmtime(contributing_file) <= os.path.getmtime(target_filepath): - logger.info( - f"Contributing '{os.fspath(contributing_file)}' hasn't been updated, skipping." - ) - return - except FileNotFoundError: - pass - logger.info( - f"Creating symbolic link for '{os.fspath(contributing_file)}' " - f"at '{os.fspath(target_filepath)}'" - ) - target_filepath.symlink_to(contributing_file) - - logger.info("Finished copying contributing to docs directory") - - -@mkdocs.plugins.event_priority(-100) -def on_shutdown(): - logger.info("Removing temporary contributing in docs directory") - target_filepath.unlink() diff --git a/docs/.gitignore b/docs/.gitignore index c83509d2..4d449b88 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,8 +1,2 @@ # Notebooks *.ipynb - -# Changelog -CHANGELOG.md - -# Contributing -CONTRIBUTING.md diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md new file mode 120000 index 00000000..04c99a55 --- /dev/null +++ b/docs/CHANGELOG.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 120000 index 00000000..44fcc634 --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1 @@ +../CONTRIBUTING.md \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 824640b1..1aebd819 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,8 +12,6 @@ watch: hooks: - build_scripts/copy_notebooks.py - - build_scripts/copy_changelog.py - - build_scripts/copy_contributing.py - build_scripts/copy_benchmarks.py plugins: