Skip to content

Commit

Permalink
Replace JBrowse built-in analytics with theme's
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanweeks committed Dec 29, 2024
1 parent 724d3f7 commit f54669f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
id: restore-cache-jbrowse
with:
path: ./_site/assets/js/jbrowse
key: jbrowse-${{ hashFiles('_data/datastore-metadata/**', '_scripts/jbrowse-tracks.sh', 'Makefile', 'assets/js/jbrowse-config.json') }}
key: jbrowse-${{ hashFiles('_data/datastore-metadata/**', '_config.yml', '_scripts/jbrowse-tracks.sh', '_themes/jekyll-theme-legumeinfo/_includes/analytics.html', 'Makefile', 'assets/js/jbrowse-config.json') }}
- uses: actions/setup-node@v4
if: steps.restore-cache-jbrowse.outputs.cache-hit != 'true'
with:
Expand All @@ -69,13 +69,13 @@ jobs:
run: |
make jbrowse
rm -rf assets/js/jbrowse/test_data
mv assets/js/jbrowse _site/assets/js
bundle exec jekyll build --profile --trace # process assets/js/jbrowse/index.html as liquid
- uses: actions/cache/save@v4
id: save-cache-jbrowse
if: steps.restore-cache-jbrowse.outputs.cache-hit != 'true'
with:
path: ./_site/assets/js/jbrowse
key: jbrowse-${{ hashFiles('_data/datastore-metadata/**', '_scripts/jbrowse-tracks.sh', 'Makefile', 'assets/js/jbrowse-config.json') }}
key: jbrowse-${{ hashFiles('_data/datastore-metadata/**', '_config.yml', '_scripts/jbrowse-tracks.sh', '_themes/jekyll-theme-legumeinfo/_includes/analytics.html', 'Makefile', 'assets/js/jbrowse-config.json') }}
# create artifact.tar from ./_site directory & upload as artifact named 'github-pages'
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ pa11y: setup


# JBrowse CLI will already be installed globally if using a dev container
# Ensure JBrowse index.html is parsed by jekyll & inline GA script
jbrowse: setup
if ! { command -v jbrowse || npm ls @jbrowse/cli ; } >/dev/null 2>&1; then npm install $(NPM_INSTALL_OPTIONS) @jbrowse/cli@${JBROWSE_VERSION}; fi
if ! [ -d ./assets/js/jbrowse ]; then npx jbrowse create assets/js/jbrowse --tag=v${JBROWSE_VERSION}; fi
if ! [ -d ./assets/js/jbrowse ]; then \
npx jbrowse create assets/js/jbrowse --tag=v${JBROWSE_VERSION}; \
sed -i.bak -e 's/^/---\n---\n/' -e 's/>/>\n/g' assets/js/jbrowse/index.html; \
sed -i.bak -e '/<\/script>/r ./_themes/jekyll-theme-legumeinfo/_includes/analytics.html' assets/js/jbrowse/index.html; \
fi
cp assets/js/jbrowse-config.json assets/js/jbrowse/config.json
npm exec -c '_scripts/jbrowse-tracks.sh'

Expand Down
1 change: 1 addition & 0 deletions assets/js/jbrowse-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"configuration": {
"disableAnalytics": true,
"hierarchical": {
"defaultCollapsed": {
"subCategories": true
Expand Down

0 comments on commit f54669f

Please sign in to comment.