diff --git a/markdown/assets/javascripts/feedback.js b/markdown/assets/javascripts/feedback.js new file mode 100644 index 0000000..90bcbba --- /dev/null +++ b/markdown/assets/javascripts/feedback.js @@ -0,0 +1,23 @@ +document$.subscribe(function() { + var feedback = document.forms.feedback + if (typeof feedback === "undefined") return + + feedback.hidden = false + + feedback.addEventListener("submit", function(ev) { + ev.preventDefault() + + var page = document.location.pathname + var data = ev.submitter.getAttribute("data-md-value") + + posthog.capture("page_feedback", { page, data }) + + feedback.firstElementChild.disabled = true + + var note = feedback.querySelector( + ".md-feedback__note [data-md-value='" + data + "']" + ) + if (note) + note.hidden = false + }) +} diff --git a/mkdocs.readthedocs.yml b/mkdocs.readthedocs.yml index ec5166c..a7bd679 100644 --- a/mkdocs.readthedocs.yml +++ b/mkdocs.readthedocs.yml @@ -8,3 +8,4 @@ extra: deployment: staging # for the announcement banner extra_javascript: - assets/javascripts/rtd.js +- assets/javascripts/feedback.js diff --git a/mkdocs.yml b/mkdocs.yml index 321442a..687d51b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,9 +29,9 @@ nav: - "Donations and Sponsorships": contact/donations.md - "Work with Andrei Jiroh": contact/work.md - "Found a security issue?": contact/security.md - - "Aything else": + - "Anything else": - contact/else.md - - "See all available contact methods": contact/details.md + - "Show all contact details": contact/details.md - "PGP and SSH keys": keys.md - Legal: - Security policy: security.md @@ -226,6 +226,10 @@ extra: link: https://linkedin.com/in/ajhalili2006 name: ~ajhalili2006 on linkedin for employers analytics: + provider: custom # provider: plausible # property: andreijiroh.eu.org # url: "https://analytics.projectsegfau.lt" + +extra_javascript: +- assets/javascripts/feedback.js diff --git a/overrides/base.html b/overrides/base.html deleted file mode 100644 index f0413e2..0000000 --- a/overrides/base.html +++ /dev/null @@ -1,254 +0,0 @@ -{#- - This file was automatically generated - do not edit --#} -{% import "partials/language.html" as lang with context %} - - -
- {% block site_meta %} - - - {% if page.meta and page.meta.description %} - - {% elif config.site_description %} - - {% endif %} - {% if page.meta and page.meta.author %} - - {% elif config.site_author %} - - {% endif %} - {% if page.canonical_url %} - - {% endif %} - {% if page.previous_page %} - - {% endif %} - {% if page.next_page %} - - {% endif %} - {% if "rss" in config.plugins %} - - - {% endif %} - - - {% endblock %} - {% block htmltitle %} - {% if page.meta and page.meta.title %} -