Skip to content

Commit

Permalink
Add draft watermark to PR versions of site
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Albertella <[email protected]>
  • Loading branch information
reiterative committed Nov 11, 2024
1 parent 40c3216 commit 988f61f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ jobs:
- name: Set domain
run: echo "DOMAIN=osep.elisa.tech" >> $GITHUB_ENV

- name: Set base URL for preview if PR
if: github.ref != 'refs/heads/main'
run: echo "BASE_URL=https://${{ env.DOMAIN }}/${{ env.PR_PATH}}/" >> $GITHUB_ENV

- name: Setup python
uses: actions/setup-python@v5
with:
Expand All @@ -40,6 +36,12 @@ jobs:
- name: Checkout the triggering ref
uses: actions/checkout@v4

- name: Adjust BASE_URL and css if this is a PR
if: github.ref != 'refs/heads/main'
run: |
echo "BASE_URL=https://${{ env.DOMAIN }}/${{ env.PR_PATH}}/" >> $GITHUB_ENV
cat docs/stylesheets/draft.css >> docs/stylesheets/elisa.css
- name: Build site
run: |
pip install -r docs/requirements.txt
Expand Down
10 changes: 10 additions & 0 deletions docs/stylesheets/draft.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

.md-content__inner.md-typeset:before {
content: "DRAFT FROM PR";
-webkit-transform: rotate(351deg);
-moz-transform: rotate(351deg);
-o-transform: rotate(351deg);
transform: rotate(351deg);
font-size: 10em;
color: rgba(255, 5, 5, 0.17);
}

0 comments on commit 988f61f

Please sign in to comment.