Skip to content

Commit 755e8d7

Browse files
committed
Better solution for hiding link
1 parent 7836ee1 commit 755e8d7

File tree

3 files changed

+34
-44
lines changed

3 files changed

+34
-44
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# Modify Plotly chart HTML files to disable showLink
4+
5+
cd charts
6+
7+
for file in *.html; do
8+
# Skip index.html
9+
if [ "$file" = "index.html" ]; then
10+
continue
11+
fi
12+
13+
# Check if file exists and is not empty
14+
if [ ! -f "$file" ] || [ ! -s "$file" ]; then
15+
continue
16+
fi
17+
18+
# Check if modification hasn't already been done
19+
if grep -q '"showLink"\s*:\s*false' "$file"; then
20+
echo "$file already has showLink disabled, skipping"
21+
continue
22+
fi
23+
24+
# Replace "showLink": true with "showLink": false
25+
sed -i.bak 's/"showLink"[[:space:]]*:[[:space:]]*true/"showLink": false/g' "$file"
26+
27+
# Remove backup file
28+
rm -f "${file}.bak"
29+
30+
echo "Disabled showLink in $file"
31+
done

.github/scripts/inject-css.sh

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/deploy-pages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
- name: Checkout
2626
uses: actions/checkout@v4
2727

28-
- name: Inject CSS to hide Chart Studio links
28+
- name: Disable Chart Studio showLink
2929
run: |
30-
chmod +x .github/scripts/inject-css.sh
31-
.github/scripts/inject-css.sh
30+
chmod +x .github/scripts/disable-showlink.sh
31+
.github/scripts/disable-showlink.sh
3232
3333
- name: Generate index page
3434
run: |

0 commit comments

Comments
 (0)