Skip to content

Commit

Permalink
fix: add seo.html function.
Browse files Browse the repository at this point in the history
  • Loading branch information
MortyZhaoy committed Sep 22, 2024
1 parent 41d8e81 commit d34f7b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions layouts/_internal/google_analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z9ZLQYBPJ1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-Z9ZLQYBPJ1');
</script>
3 changes: 3 additions & 0 deletions layouts/partials/head/seo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- with .Site.GoogleAnalytics -}}
{{ template "_internal/google_analytics.html" }}
{{- end -}}

0 comments on commit d34f7b1

Please sign in to comment.