Skip to content

Commit

Permalink
Enable feedback widget (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaharagon committed Apr 29, 2022
1 parent c1a4eec commit e4654a7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/browsers.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: "Web Browsers"
icon: octicons/browser-16
tags:
- HTML5
- JavaScript
---
These are our current web browser recommendations and settings. We recommend keeping extensions to a minimum: they have privileged access within your browser, require you to trust the developer, can make you [stand out](https://en.wikipedia.org/wiki/Device_fingerprint#Browser_fingerprint), and [weaken](https://groups.google.com/a/chromium.org/g/chromium-extensions/c/0ei-UCHNm34/m/lDaXwQhzBAAJ) site isolation.

Expand Down
1 change: 1 addition & 0 deletions docs/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ template: overrides/home.en.html
hide:
- navigation
- toc
- feedback
---
<!-- markdownlint-disable-next-line -->
<div style="max-width:50rem;margin:auto;" markdown>
Expand Down
13 changes: 13 additions & 0 deletions docs/javascripts/feedback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var feedback = document.forms.feedback
feedback.removeAttribute("hidden");
feedback.addEventListener("submit", function(ev) {
ev.preventDefault()

/* Retrieve page and feedback value */
var page = document.location.pathname
var data = ev.submitter.getAttribute("data-md-value")

/* Send feedback value */
console.log(page, data)
plausible(data)
})
12 changes: 12 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ extra:
analytics:
provider: plausible
property: privacyguides.org
feedback:
title: Was this page helpful?
ratings:
- icon: material/emoticon-happy-outline
name: This page was helpful
data: Helpful
note: Thanks for your feedback!
- icon: material/emoticon-sad-outline
name: This page could be improved
data: Needs Improvement
note: Thanks for your feedback! Help us improve this page by opening a <a href="https://github.com/orgs/privacyguides/discussions" target=_blank>discusson on GitHub</a>.
social:
- icon: pg/matrix
link: https://matrix.to/#/#privacyguides:matrix.org
Expand Down Expand Up @@ -120,6 +131,7 @@ markdown_extensions:

extra_javascript:
- javascripts/mathjax.js
- javascripts/feedback.js

nav:
- Home: 'index.md'
Expand Down
1 change: 1 addition & 0 deletions theme/partials/integrations/analytics/plausible.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<script defer data-domain="{{ config.extra.analytics.property }}" src="https://stats.privacyguides.net/js/plausible.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>

0 comments on commit e4654a7

Please sign in to comment.