mirror of
https://github.com/sammyshear/sshear.dev.git
synced 2025-12-06 03:15:53 +00:00
google adsense
This commit is contained in:
parent
a729386a92
commit
2b2745d669
@ -1,23 +1,25 @@
|
|||||||
---
|
---
|
||||||
type Props = { measurementId: string }
|
type Props = { measurementId: string };
|
||||||
const props = Astro.props as Props
|
const props = Astro.props as Props;
|
||||||
const measurementId = props.measurementId
|
const measurementId = props.measurementId;
|
||||||
---
|
---
|
||||||
|
|
||||||
<script
|
<script
|
||||||
type='text/partytown'
|
type="text/partytown"
|
||||||
src={`https://www.googletagmanager.com/gtag/js?id=${measurementId}`}></script>
|
src={`https://www.googletagmanager.com/gtag/js?id=${measurementId}`}
|
||||||
|
></script>
|
||||||
<script
|
<script
|
||||||
type='text/partytown'
|
type="text/partytown"
|
||||||
data-ga-measurement-id={measurementId}
|
data-ga-measurement-id={measurementId}
|
||||||
id='ga-init'
|
id="ga-init"
|
||||||
>
|
>
|
||||||
const measurementId = document
|
const measurementId = document
|
||||||
.getElementById('ga-init')
|
.getElementById("ga-init")
|
||||||
.getAttribute('data-ga-measurement-id')
|
.getAttribute("data-ga-measurement-id");
|
||||||
window.dataLayer = window.dataLayer || []
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag() {
|
function gtag() {
|
||||||
dataLayer.push(arguments) // eslint-disable-line
|
dataLayer.push(arguments); // eslint-disable-line
|
||||||
}
|
}
|
||||||
gtag('js', new Date())
|
gtag("js", new Date());
|
||||||
gtag('config', measurementId)
|
gtag("config", measurementId);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -25,16 +25,14 @@ const {
|
|||||||
<meta name="author" content={author} />
|
<meta name="author" content={author} />
|
||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||||
|
<meta name="google-adsense-account" content="ca-pub-2655673927481085" />
|
||||||
<title>{title}</title>
|
<title>{title}</title>
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body
|
||||||
class="flex flex-col place-items-center bg-ctp-base ctp-latte text-ctp-text dark:ctp-mocha"
|
class="flex flex-col place-items-center bg-ctp-base ctp-latte text-ctp-text dark:ctp-mocha"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</body>
|
<style is:global>
|
||||||
</html>
|
|
||||||
|
|
||||||
<style is:global>
|
|
||||||
html.dark .astro-code,
|
html.dark .astro-code,
|
||||||
html.dark .astro-code span {
|
html.dark .astro-code span {
|
||||||
color: var(--shiki-dark) !important;
|
color: var(--shiki-dark) !important;
|
||||||
@ -44,9 +42,9 @@ const {
|
|||||||
font-weight: var(--shiki-dark-font-weight) !important;
|
font-weight: var(--shiki-dark-font-weight) !important;
|
||||||
text-decoration: var(--shiki-dark-text-decoration) !important;
|
text-decoration: var(--shiki-dark-text-decoration) !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script is:inline>
|
<script is:inline>
|
||||||
const theme = (() => {
|
const theme = (() => {
|
||||||
if (
|
if (
|
||||||
typeof localStorage !== "undefined" &&
|
typeof localStorage !== "undefined" &&
|
||||||
@ -66,4 +64,6 @@ const {
|
|||||||
document.documentElement.classList.add("dark");
|
document.documentElement.classList.add("dark");
|
||||||
}
|
}
|
||||||
window.localStorage.setItem("theme", theme);
|
window.localStorage.setItem("theme", theme);
|
||||||
</script>
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user