Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Track3/hermit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnab Kumar Shil <ruddra90@gmail.com>2018-12-31 11:08:22 +0300
committerTrack3 <34504964+Track3@users.noreply.github.com>2018-12-31 11:08:22 +0300
commit97cc83914fc7ed67b623d499fbb0cde5d8fe2737 (patch)
tree38fb67c3f12e813ab039b7d2c7562a575487c193
parent97395d876cce68513dc29416cec937a32765df15 (diff)
Modularize analytics and add extra headers (#26)
-rw-r--r--README.md6
-rw-r--r--layouts/_default/baseof.html5
-rw-r--r--layouts/partials/analytics.html1
3 files changed, 11 insertions, 1 deletions
diff --git a/README.md b/README.md
index 466f250..b931390 100644
--- a/README.md
+++ b/README.md
@@ -89,6 +89,12 @@ You can modify or add any svg icons in site's `layouts/partials/svg.html`
We only have built-in support for Disqus at the moment, if that doesn't fit your needs, you can just add html to site's `layouts/partials/comments.html`
+##### Add extra header
+If you want to load something(like *custom javascript*, *google fonts* etc.) in every page with header, then you can add them inside site's `layouts/partials/extra-headers.html`.
+
+##### Add custom analytics
+If you prefer to use different analytics system other than google analytics, then add them inside `layouts/partials/analytics.html`.
+
#### Add custom css
For adding custom css to the theme, you need to assign an array of references in `config.toml` like following:
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 0a4bd7b..6758c98 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -28,6 +28,9 @@
{{ range .Site.Params.CustomCSS -}}
<link rel="stylesheet" href="{{ . | absURL }}">
{{- end }}
+ {{ if templates.Exists "partials/extra-headers.html" -}}
+ {{ partial "extra-headers.html" . }}
+ {{- end }}
</head>
<body id="page">
@@ -36,7 +39,7 @@
{{ block "footer" . -}}{{ end }}
{{ $script := resources.Get "js/main.js" | minify | fingerprint -}}
<script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }}></script>
- {{ template "_internal/google_analytics_async.html" . }}
+ {{ partial "analytics.html" }}
</body>
</html>
diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html
new file mode 100644
index 0000000..f13b4a0
--- /dev/null
+++ b/layouts/partials/analytics.html
@@ -0,0 +1 @@
+{{ template "_internal/google_analytics_async.html" . }} \ No newline at end of file