Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable feedback widget #1146

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>