Skip to content

Commit

Permalink
fix: APPS-2931:
Browse files Browse the repository at this point in the history
  • Loading branch information
pghorpade committed Sep 11, 2024
1 parent 2c9e5be commit d18ac27
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
23 changes: 23 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,29 @@ onMounted(async () => {
classes.value.push({ 'has-scrolled-past-header': globalStore.sTop >= 150 })
await $alerts()
})
const shouldIncludeExtraScript = computed(() => {
if (useRuntimeConfig().public.hostName.indexOf('stage') > 0)
return true
return false
})
useHead({
titleTemplate: title =>
title === 'Homepage' ? 'UCLA Library' : `${title}` + ' | UCLA Library',
script: [
{
hid: 'libanswers',
src: 'https://ucla.libanswers.com/load_chat.php?hash=5a44dfe7cc29aaee5bba635ab13fa753',
defer: true
},
...(shouldIncludeExtraScript.value ? [{
hid: 'gsurvey',
src: 'https://test-librarystudy.library.ucla.edu/gsurvey.js',
defer: true
}
] : [])
]
})
</script>
<template>
<div>
Expand Down
15 changes: 13 additions & 2 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
<script setup>
// components need to be imported for nitro crawling in static mode
import { HeaderSmart, SectionWrapper, SiteNotificationAlert, FooterPrimary, FooterSock } from 'ucla-library-website-components'
import { onMounted } from 'vue'
const shouldIncludeExtraScript = computed(() => {
if (useRuntimeConfig().public.hostName.indexOf('stage') > 0)
return true
return false
})
useHead({
titleTemplate: title =>
title === 'Homepage' ? 'UCLA Library' : `${title}` + ' | UCLA Library',
title === 'Homepage' ? 'UCLA Library' : `${title || 'Error'}` + ' | UCLA Library',
script: [
{
hid: 'libanswers',
src: 'https://ucla.libanswers.com/load_chat.php?hash=5a44dfe7cc29aaee5bba635ab13fa753',
defer: true
},
...(shouldIncludeExtraScript.value ? [{
hid: 'gsurvey',
src: 'https://test-librarystudy.library.ucla.edu/gsurvey.js',
defer: true
}
] : [])
]
})
Expand Down

0 comments on commit d18ac27

Please sign in to comment.