Skip to content

Commit 56fd4c0

Browse files
committed
final config of my site. such as Google Analytics and discus comments.
1 parent 72dde96 commit 56fd4c0

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

.gitignore

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
_site
2-
.sass-cache
31
.jekyll-cache
42
.jekyll-metadata
53
vendor
64
/.idea
7-
.bundle/
85
*.gem
6+
*.swp
7+
.DS_Store
8+
.analysis
9+
.bundle/
10+
.byebug_history
11+
.ruby-gemset
12+
.ruby-version
13+
.sass-cache
14+
/vendor
915
Gemfile.lock
16+
_site
17+
bin/
18+
bbin/
19+
coverage
20+
gh-pages/
21+
site/_site/
22+
test/dest
23+
tmp/*

_data/settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ contact:
3030

3131
#-------------------------------
3232
# Analytics Settings
33-
google_analytics: # Add your identifier. For example UA-99631805-1
33+
google_analytics: G-DQFE1TJN81
3434

3535
#-------------------------------
3636
# Build Settings

_includes/google-analytics.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
{% if jekyll.environment == 'production' %}
12
<!-- Global site tag (gtag.js) - Google Analytics -->
23
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.data.settings.google-analytics }}"></script>
34
<script>
4-
window.dataLayer = window.dataLayer || [];
5-
function gtag(){dataLayer.push(arguments);}
6-
gtag('js', new Date());
7-
gtag('config', '{{ site.data.settings.google-analytics }}');
8-
</script>
5+
window.dataLayer = window.dataLayer || [];
6+
7+
function gtag() {
8+
dataLayer.push(arguments);
9+
}
10+
11+
gtag('js', new Date());
12+
gtag('config', '{{ site.data.settings.google-analytics }}');
13+
</script>
14+
15+
{% endif %}

0 commit comments

Comments
 (0)