Skip to content

Commit

Permalink
Merge pull request #87 from hsf-training/add-analytics
Browse files Browse the repository at this point in the history
feat: add analytics
  • Loading branch information
ariostas authored Apr 29, 2024
2 parents 09debbd + 707ddf6 commit b9b663d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ jobs:
- name: Install node dependencies
run: npm install
- name: Build site
run: npm run build
run: |
PREFIX_PATHS=true npm run build
mkdir website
mv public website/training-center
cp redirect.html website/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
path: ./website
deploy:
if: github.event_name == 'push'
needs: build
Expand Down
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
pathPrefix: `/training-center`,
siteMetadata: {
siteUrl: "https://hsf-training.org",
title: "HSF Training Center",
Expand Down
15 changes: 15 additions & 0 deletions redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0; url=/training-center/" />
<script type="text/javascript">
window.location.href = "/training-center/";
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow this
<a href="/training-center/">link to the training center.</a>.
</body>
</html>
5 changes: 5 additions & 0 deletions src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const Layout = ({ pageTitle, children }) => {
<>
<header>
<title>{pageTitle}</title>
<script
defer
data-domain="hepsoftwarefoundation.org"
src="https://views.scientific-python.org/js/script.js"
></script>
</header>
{/* navbar */}
<nav>
Expand Down

0 comments on commit b9b663d

Please sign in to comment.