Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS-3263] Add GTM tags to JS driver API index #283

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions concourse/scripts/body_gtm.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- Google Tag Manager (noscript) --><noscript><iframe src="https:\/\/www.googletagmanager.com\/ns.html?id=GTM-TGTQJ7M" height="0" width="0" style="display:none;visibility:hidden"><\/iframe><\/noscript><!-- End Google Tag Manager (noscript) -->
1 change: 1 addition & 0 deletions concourse/scripts/head_gtm.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- Google Tag Manager --><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https:\/\/www.googletagmanager.com\/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-TGTQJ7M');<\/script><!-- End Google Tag Manager -->
12 changes: 10 additions & 2 deletions concourse/scripts/publish_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PACKAGE_VERSION=$(node -p -e "require('./package.json').version")

# Generate docs
npm install
npm run docs
npm run doc

echo "Current docs version: $PACKAGE_VERSION"

Expand All @@ -25,7 +25,15 @@ if [ -d "$PACKAGE_VERSION" ]; then
echo "Existing $PACKAGE_VERSION directory removed."
fi

cp -R "../fauna-js-repository/build/docs" "$PACKAGE_VERSION"
cp -R "../fauna-js-repository/docs" "$PACKAGE_VERSION"

HEAD_GTM=$(cat ./fauna-js-repository/concourse/scripts/head_gtm.dat)
sed -i.bak "0,/<\/title>/{s/<\/title>/<\/title>${HEAD_GTM}/}" ./$PACKAGE_VERSION/index.html

BODY_GTM=$(cat ./fauna-js-repository/concourse/scripts/body_gtm.dat)
sed -i.bak "0,/<body>/{s/<body>/<body>${BODY_GTM}/}" ./$PACKAGE_VERSION/index.html

rm ./$PACKAGE_VERSION/index.html.bak

echo "Updating 'latest' symlink to point to $PACKAGE_VERSION"
ln -sfn "$PACKAGE_VERSION" latest
Expand Down
Loading