Skip to content

Commit

Permalink
trying a custom github enviorment variable for pdf path
Browse files Browse the repository at this point in the history
  • Loading branch information
eseverett committed Mar 6, 2024
1 parent 04f61b1 commit 57b516a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
Binary file modified docs/source/extensions/__pycache__/pdf_button.cpython-311.pyc
Binary file not shown.
24 changes: 9 additions & 15 deletions docs/source/extensions/pdf_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,18 @@ def run(self):

# Check if explicitly marked as a local build

# on_gitlab = os.environ.get('GITLAB_CI') == 'true'
# on_github = os.environ.get('GITHUB_ACTIONS') == 'true'
on_gitlab = os.environ.get('GITLAB_CI') == 'true'
on_github = os.environ.get('ON_GITHUB') == 'true' # custom environment variable

# if on_gitlab:
# pdf_path = f'/_static/{pdf_filename}'
# elif on_github:
# pdf_path = f'/_static/{pdf_filename}'
# else:
# # Default to local development path
# pdf_path = f'/docs/build/html/_static/{pdf_filename}'

if on_gitlab:
pdf_path = f'/_static/{pdf_filename}'
elif on_github:
pdf_path = f'/_static/{pdf_filename}'
else:
# Default to local development path
pdf_path = f'/docs/build/html/_static/{pdf_filename}'

on_gitpage = os.environ.get('CI') == 'true'

if on_gitpage:
pdf_path = f'/_static/{pdf_filename}'
else:
pdf_path = f'/docs/build/html/_static/{pdf_filename}'


# Use the provided content as the button text if available, otherwise default to the PDF filename
Expand Down

0 comments on commit 57b516a

Please sign in to comment.