Skip to content

Commit

Permalink
GA conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 7, 2024
1 parent 92f5a4b commit d06e96c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
32 changes: 23 additions & 9 deletions frontend/src/components/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ interface Props {
title: string;
description: string;
}
const measurementID = import.meta.env.PUBLIC_GOOGLE_ANALYTICS_ID
const { title, description } = Astro.props;
---
Expand All @@ -14,8 +15,21 @@ const { title, description } = Astro.props;
<meta name="description" content={description} />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<link rel="canonical" href={Astro.url} />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
{measurementID && (
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XZJTXSVNVB"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-XZJTXSVNVB');
</script>
)}


</head>
<body
class="leading-normal tracking-normal text-slate-400 m-6 bg-cover bg-gradient"
Expand All @@ -34,13 +48,13 @@ const { title, description } = Astro.props;
background: -webkit-linear-gradient(to right, #061161, #780206);
background: linear-gradient(to right, #061161, #780206);
}
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
</style>
4 changes: 2 additions & 2 deletions pkg/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func SetHeadersResponseImage(header http.Header, output string) {
header.Set("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload")
}
func SetHeadersResponseHTML(header http.Header) {
header.Set("Cache-Control", "max-age=31536000")
header.Set("Expires", "31536000")
header.Set("Cache-Control", "max-age=86400")
header.Set("Expires", "86400")
header.Set("Content-Type", "text/html; charset=utf-8")
// security headers
header.Set("X-Content-Type-Options", "nosniff")
Expand Down

0 comments on commit d06e96c

Please sign in to comment.