mirror of
https://github.com/Noettore/cocoa-eh-hugo-theme.git
synced 2025-10-14 19:26:40 +02:00
Adding the option to turn off Google Analytics & Fix Latest Posts List (#144)
* adding option to turn off Google Analytics * fixing the latest posts list
This commit is contained in:

committed by
GitHub

parent
9ea1d79fb2
commit
038d6623a0
@@ -10,11 +10,13 @@
|
||||
|
||||
{{ if isset .Site.Params "latestpostcount" }}
|
||||
<div class="posts">
|
||||
{{ $nbPosts := len (where .Data.Pages "Section" "blog") }}
|
||||
{{ $blogPosts := (where .Site.RegularPages "Section" "blog") }}
|
||||
{{ $nbPosts := len $blogPosts }}
|
||||
{{ if gt $nbPosts 0 }}
|
||||
<div class="page-heading">Latest posts</div>
|
||||
<ul>
|
||||
{{ range (first .Site.Params.latestpostcount (where .Pages "Section" "blog")).GroupByDate "Jan, 2006" "desc" }}
|
||||
|
||||
{{ range (first .Site.Params.latestpostcount $blogPosts).GroupByDate "Jan, 2006" "desc" }}
|
||||
<li class="groupby">{{ .Key }}</li>
|
||||
{{ range sort .Pages "Date" "desc" }}
|
||||
{{ partial "li.html" . }}
|
||||
|
@@ -41,7 +41,9 @@ fathom('trackPageview');
|
||||
<!-- / Fathom -->
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.googleAnalyticsEnabled }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<script>
|
||||
window.onload = function() {
|
||||
|
Reference in New Issue
Block a user