Преглед на файлове

Adds Azure Application Insights as a new analytics option (#692)

* Added Application Insights

* Added entry to contributes

* Added new line at end of the file

* Updated configurations.md

Co-authored-by: Eltjo Veninga <eltjo.veninga@kpn.com>
Eltjo преди 3 години
родител
ревизия
abc1133c7e
променени са 5 файла, в които са добавени 19 реда и са изтрити 0 реда
  1. 1 0
      CONTRIBUTORS.md
  2. 9 0
      docs/configurations.md
  3. 4 0
      exampleSite/config.toml
  4. 4 0
      layouts/_default/baseof.html
  5. 1 0
      layouts/partials/analytics/applicationinsights.html

+ 1 - 0
CONTRIBUTORS.md

@@ -112,4 +112,5 @@
 - [John Feminella](https://jxf.me)
 - [zzsqwq](https://zzsqwq.cn)
 - [George Tsiokos](https://george.tsiokos.com)
+- [Eltjo](https://github.com/eltjo)
 - [Saurmandal](https://saur.neocities.org)

+ 9 - 0
docs/configurations.md

@@ -9,6 +9,7 @@
     * [Goat Counter](#goat-counter)
     * [Cloudflare](#cloudflare)
     * [Matomo](#matomo)
+    * [Application Insights](#application-insights)
   * [Commenting Systems](#commenting-systems)
     * [Disqus](#disqus)
     * [Commento](#commento)
@@ -33,6 +34,7 @@ This theme supports:
   * [Goat Counter](https://www.goatcounter.com/)
   * [Cloudflare](https://www.cloudflare.com/analytics/)
   * [Matomo](https://matomo.org/)
+  * [Application Insights](https://azure.com/)
 * Commenting Systems
   * [Disqus](https://disqus.com/)
   * [Commento](https://commento.io/)
@@ -89,6 +91,13 @@ Follow [these steps](https://gohugo.io/templates/internal/#configure-google-anal
     serverURL = "analytics.example.com"
 ```
 
+#### Application Insights
+
+```toml
+[params.applicationInsights]
+    connectionString = "connectionstring" # https://docs.microsoft.com/en-us/azure/azure-monitor/app/sdk-connection-string
+```
+
 ### Commenting Systems
 
 Comments are displayed within post pages, but can be disabled with `disableComments` front-matter.

+ 4 - 0
exampleSite/config.toml

@@ -69,6 +69,10 @@ customJS = []
 # [params.googleTagManager]
 # id = "gid"
 
+# If you want to use Application Insights(https://azure.com/) for analytics, add this section
+# [params.applicationInsights]
+# connectionString = "connectionString"
+
 # If you want to implement a Content-Security-Policy, add this section
 [params.csp]
 childsrc = ["'self'"]

+ 4 - 0
layouts/_default/baseof.html

@@ -65,6 +65,10 @@
   {{- partial "analytics/googletagmanager" . -}}
   {{ end }}
 
+  {{ if and .Site.Params.applicationInsights .Site.Params.applicationInsights.connectionString }}
+    {{- partial "analytics/applicationinsights" . -}}
+  {{ end }}   
+
   {{- partial "body/extensions" . -}}
 </body>
 

Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
layouts/partials/analytics/applicationinsights.html


Някои файлове не бяха показани, защото твърде много файлове са промени