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 %} - {{ page.meta.title }} - {{ config.site_name }} - {% elif page.title and not page.is_homepage %} - {{ page.title | striptags }} - {{ config.site_name }} - {% else %} - {{ config.site_name }} - {% endif %} - {% endblock %} - {% block styles %} - - {% if config.theme.palette %} - {% set palette = config.theme.palette %} - - {% endif %} - {% include "partials/icons.html" %} - {% endblock %} - {% block libs %} - {% for script in config.extra.polyfills %} - {{ script | script_tag }} - {% endfor %} - {% endblock %} - {% block fonts %} - {% if config.theme.font != false %} - {% set text = config.theme.font.text | d("Roboto", true) %} - {% set code = config.theme.font.code | d("Roboto Mono", true) %} - - - - {% endif %} - {% endblock %} - {% for path in config.extra_css %} - - {% endfor %} - {% include "partials/javascripts/base.html" %} - {% block analytics %} - {% include "partials/integrations/analytics.html" %} - {% endblock %} - {% if page.meta and page.meta.meta %} - {% for tag in page.meta.meta %} - - {% endfor %} - {% endif %} - {% block extrahead %}{% endblock %} - - {% set direction = config.theme.direction or lang.t("direction") %} - {% if config.theme.palette %} - {% set palette = config.theme.palette %} - {% if not palette is mapping %} - {% set palette = palette | first %} - {% endif %} - {% set scheme = palette.scheme | d("default", true) %} - {% set primary = palette.primary | d("indigo", true) %} - {% set accent = palette.accent | d("indigo", true) %} - - {% else %} - - {% endif %} - {% set features = config.theme.features or [] %} - - - -
- {% if page.toc | first is defined %} - {% set skip = page.toc | first %} - - {{ lang.t("action.skip") }} - - {% endif %} -
-
- {% if self.announce() %} - - {% endif %} -
- {% if config.extra.version %} - - {% endif %} - {% block header %} - {% include "partials/header.html" %} - {% endblock %} -
- {% block hero %}{% endblock %} - {% block tabs %} - {% if "navigation.tabs.sticky" not in features %} - {% if "navigation.tabs" in features %} - {% include "partials/tabs.html" %} - {% endif %} - {% endif %} - {% endblock %} -
-
- {% block site_nav %} - {% if nav %} - {% if page.meta and page.meta.hide %} - {% set hidden = "hidden" if "navigation" in page.meta.hide %} - {% endif %} - - {% endif %} - {% if "toc.integrate" not in features %} - {% if page.meta and page.meta.hide %} - {% set hidden = "hidden" if "toc" in page.meta.hide %} - {% endif %} - - {% endif %} - {% endblock %} - {% block container %} -
-
- {% block content %} - {% include "partials/content.html" %} - {% endblock %} -
-
- {% endblock %} - {% include "partials/javascripts/content.html" %} -
- {% if "navigation.top" in features %} - {% include "partials/top.html" %} - {% endif %} -
- {% block footer %} - {% include "partials/footer.html" %} - {% endblock %} -
-
-
-
- {% if "navigation.instant.progress" in features %} - {% include "partials/progress.html" %} - {% endif %} - {% if config.extra.consent %} - - {% include "partials/javascripts/consent.html" %} - {% endif %} - {% block config %} - {% set _ = namespace() %} - {% set _.tags = config.extra.tags %} - {%- if config.extra.version -%} - {%- set mike = config.plugins.mike -%} - {%- if not mike or mike.config.version_selector -%} - {%- set _.version = config.extra.version -%} - {%- endif -%} - {%- endif -%} - - {% endblock %} - {% block scripts %} - - {% for script in config.extra_javascript %} - {{ script | script_tag }} - {% endfor %} - {% endblock %} - - diff --git a/overrides/partials/integrations/analytics/custom.html b/overrides/partials/integrations/analytics/custom.html new file mode 100644 index 0000000..0ebbf47 --- /dev/null +++ b/overrides/partials/integrations/analytics/custom.html @@ -0,0 +1,12 @@ + + + + +