Skip to content

Commit 8c5cd10

Browse files
authored
Only run documentation build hooks in CI (#986)
1 parent 992c6d1 commit 8c5cd10

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/.hooks/algolia.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class AlgoliaRecord(TypedDict):
3636

3737

3838
def on_page_content(html: str, page: Page, config: Config, files: Files) -> str:
39+
if not os.getenv('CI'):
40+
return html
41+
3942
from bs4 import BeautifulSoup
4043

4144
assert page.title is not None, 'Page title must not be None'

docs/.hooks/build_llms_txt.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ def on_config(config: MkDocsConfig):
1717

1818

1919
def on_page_content(html: str, page: Page, config: MkDocsConfig, files: Files) -> str:
20+
if not os.getenv('CI'):
21+
return html
22+
2023
soup = BeautifulSoup(html, 'html.parser')
2124

2225
# Clean up presentational and UI elements

0 commit comments

Comments
 (0)