pull/8491/head
Kamran Ahmed 5 days ago
parent c683db2757
commit f28b018e99
  1. 8
      src/components/Analytics/Varify.astro
  2. 1
      src/components/Analytics/analytics.ts
  3. 14
      src/layouts/BaseLayout.astro
  4. 7
      src/layouts/SkeletonLayout.astro

@ -1,7 +1 @@
<!-- Varify.io® code for roadmap-->
<script>
// @ts-nocheck
window.varify = window.varify || {};
window.varify.iid = 4013;
</script>
<script src='https://app.varify.io/varify.js'></script>

@ -1,6 +1,7 @@
declare global { declare global {
interface Window { interface Window {
gtag: any; gtag: any;
varify: any;
fireEvent: (props: { fireEvent: (props: {
action: string; action: string;
category: string; category: string;

@ -36,6 +36,7 @@ export interface Props {
jsonLd?: Record<string, unknown>[]; jsonLd?: Record<string, unknown>[];
resourceId?: string; resourceId?: string;
resourceType?: ResourceType; resourceType?: ResourceType;
hasVarify?: boolean;
} }
const { const {
@ -52,6 +53,7 @@ const {
initialLoadingMessage = '', initialLoadingMessage = '',
resourceId, resourceId,
resourceType, resourceType,
hasVarify = false,
} = Astro.props; } = Astro.props;
// Remove trailing slashes to consider the page as canonical // Remove trailing slashes to consider the page as canonical
@ -152,6 +154,18 @@ const gaPageIdentifier = Astro.url.pathname
<link rel='preconnect' href='https://www.google-analytics.com/' /> <link rel='preconnect' href='https://www.google-analytics.com/' />
<link rel='preconnect' href='https://api.roadmap.sh/' /> <link rel='preconnect' href='https://api.roadmap.sh/' />
{
hasVarify && (
<Fragment>
<script>
window.varify = window.varify || {};
window.varify.iid = 4013;
</script>
<script src='https://app.varify.io/varify.js' />
</Fragment>
)
}
<slot name='after-header' /> <slot name='after-header' />
{ {
jsonLd.length > 0 && ( jsonLd.length > 0 && (

@ -1,17 +1,12 @@
--- ---
import Varify from '../components/Analytics/Varify.astro';
import BaseLayout, { type Props as BaseLayoutProps } from './BaseLayout.astro'; import BaseLayout, { type Props as BaseLayoutProps } from './BaseLayout.astro';
export interface Props extends BaseLayoutProps { export interface Props extends BaseLayoutProps {}
hasVarify?: boolean;
}
const props = Astro.props; const props = Astro.props;
--- ---
<BaseLayout {...props}> <BaseLayout {...props}>
{props.hasVarify && <Varify slot='after-header' />}
<div slot='course-announcement'></div> <div slot='course-announcement'></div>
<div slot='page-header'></div> <div slot='page-header'></div>
<slot /> <slot />

Loading…
Cancel
Save