From 672f9a10503cd69b2eb7f508505c59c60021258d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 14 Mar 2024 22:19:59 +0100 Subject: [PATCH] Feedback form POC --- mkdocs.yml | 21 ++++ theme/main.html | 8 ++ theme/partials/feedback.html | 79 +++++++++++++++ theme/partials/integrations/analytics.html | 50 +++++++++- .../integrations/analytics/google.html | 97 +++++++++++++++++++ 5 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 theme/partials/feedback.html create mode 100644 theme/partials/integrations/analytics/google.html diff --git a/mkdocs.yml b/mkdocs.yml index 081b045019..4165031a79 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -852,6 +852,27 @@ extra: url: '/projects/userguide' - title: 'Connect Documentation' url: '/projects/connect' + analytics: + provider: google + property: GTM-KKQR5LG + feedback: + title: Was this page helpful? + ratings: + - icon: material/emoticon-happy-outline + name: This page was helpful + data: 1 + note: >- + Thanks for your feedback! + - icon: material/emoticon-sad-outline + name: This page could be improved + data: 0 + note: >- + Thanks for your feedback! Help us improve this page by + using our feedback form
+ + Create an issue on JIRA
+ Suggest an improvement on GitHub
+ Create an issue on GitHub # Global variables site_display_name: 'Ibexa Documentation' diff --git a/theme/main.html b/theme/main.html index bb3616a273..b42831906f 100644 --- a/theme/main.html +++ b/theme/main.html @@ -9,6 +9,12 @@ {%- endif -%} {% endblock %} + + + {% block analytics %} + {% include "partials/integrations/analytics.html" %} + {% endblock %} + {% block extrahead %} @@ -68,6 +74,8 @@ {% endif %} {{ page.content }} + + {% include "partials/feedback.html" %} {% include "partials/tags.html" %} {% endblock %} diff --git a/theme/partials/feedback.html b/theme/partials/feedback.html new file mode 100644 index 0000000000..516c78204b --- /dev/null +++ b/theme/partials/feedback.html @@ -0,0 +1,79 @@ + + + +{% if config.extra.analytics %} + {% set feedback = config.extra.analytics.feedback %} +{% endif %} + + +{% if page.meta and page.meta.hide %} + {% if "feedback" in page.meta.hide %} + {% set feedback = None %} + {% endif %} +{% endif %} + + +{% if feedback %} + +{% endif %} diff --git a/theme/partials/integrations/analytics.html b/theme/partials/integrations/analytics.html index a01c64d099..66740668b1 100644 --- a/theme/partials/integrations/analytics.html +++ b/theme/partials/integrations/analytics.html @@ -1 +1,49 @@ - + + + +{% if config.extra.analytics %} + {% set provider = config.extra.analytics.provider %} +{% endif %} + + +{% if provider %} + {% include "partials/integrations/analytics/" ~ provider ~ ".html" %} + + + {% if config.extra.consent %} + + + + {% else %} + + {% endif %} +{% endif %} diff --git a/theme/partials/integrations/analytics/google.html b/theme/partials/integrations/analytics/google.html new file mode 100644 index 0000000000..ccc434af82 --- /dev/null +++ b/theme/partials/integrations/analytics/google.html @@ -0,0 +1,97 @@ + + + +{% if config.extra.analytics %} + {% set property = config.extra.analytics.property | d("", true) %} +{% endif %} + + +