fix(core): update
This commit is contained in:
24
material/partials/integrations/analytics.html
Normal file
24
material/partials/integrations/analytics.html
Normal file
@ -0,0 +1,24 @@
|
||||
{% set analytics = config.google_analytics %}
|
||||
<script>
|
||||
window.ga = window.ga || function() {
|
||||
(ga.q = ga.q || []).push(arguments)
|
||||
}
|
||||
ga.l = +new Date
|
||||
/* Setup integration and send page view */
|
||||
ga("create", "{{ analytics[0] }}", "{{ analytics[1] }}")
|
||||
ga("set", "anonymizeIp", true)
|
||||
ga("send", "pageview")
|
||||
/* Register handler to log search on blur */
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
if (document.forms.search) {
|
||||
var query = document.forms.search.query
|
||||
query.addEventListener("blur", function() {
|
||||
if (this.value) {
|
||||
var path = document.location.pathname;
|
||||
ga("send", "pageview", path + "?q=" + this.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<script async src="https://www.google-analytics.com/analytics.js"></script>
|
21
material/partials/integrations/disqus.html
Normal file
21
material/partials/integrations/disqus.html
Normal file
@ -0,0 +1,21 @@
|
||||
{% set disqus = config.extra.disqus %}
|
||||
{% if page and page.meta and page.meta.disqus is string %}
|
||||
{% set disqus = page.meta.disqus %}
|
||||
{% endif %}
|
||||
{% if not page.is_homepage and disqus %}
|
||||
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
||||
<div id="disqus_thread"></div>
|
||||
<script>
|
||||
var disqus_config = function () {
|
||||
this.page.url = "{{ page.canonical_url }}";
|
||||
this.page.identifier =
|
||||
"{{ page.canonical_url | replace(config.site_url, "") }}";
|
||||
};
|
||||
(function() {
|
||||
var d = document, s = d.createElement("script");
|
||||
s.src = "//{{ disqus }}.disqus.com/embed.js";
|
||||
s.setAttribute("data-timestamp", +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
Reference in New Issue
Block a user