From e8f498168e2f80aebe04818bd6fe071f7f77004a Mon Sep 17 00:00:00 2001 From: Manuel Da Pena <65864237+mdapena@users.noreply.github.com> Date: Sun, 7 Jun 2026 19:43:08 +0200 Subject: [PATCH 1/4] Add Analytics, Cookie Consent, and UI Improvements --- docs/.overrides/404.html | 48 ++++++++++++++++++++ docs/stylesheets/consent.css | 49 +++++++++++++++++++++ docs/stylesheets/header.css | 20 +++++++++ docs/stylesheets/search-bar.css | 30 +++++++++++++ docs/stylesheets/tabs.css | 25 +++++++++++ docs/stylesheets/task-list-indicator.css | 11 +++++ mkdocs.yml | 56 ++++++++++++++++++++---- 7 files changed, 230 insertions(+), 9 deletions(-) create mode 100644 docs/.overrides/404.html create mode 100644 docs/stylesheets/consent.css create mode 100644 docs/stylesheets/header.css create mode 100644 docs/stylesheets/search-bar.css create mode 100644 docs/stylesheets/tabs.css create mode 100644 docs/stylesheets/task-list-indicator.css diff --git a/docs/.overrides/404.html b/docs/.overrides/404.html new file mode 100644 index 0000000..7ad930f --- /dev/null +++ b/docs/.overrides/404.html @@ -0,0 +1,48 @@ +{% extends "main.html" %} + + +{% block content %} + + + + +
+ The requested URL was not found in this documentation. +
+ ++ Try searching or go to PyORlib's home page. +
+ + + +{% endblock %} \ No newline at end of file diff --git a/docs/stylesheets/consent.css b/docs/stylesheets/consent.css new file mode 100644 index 0000000..3ff53de --- /dev/null +++ b/docs/stylesheets/consent.css @@ -0,0 +1,49 @@ +.md-consent__overlay { + pointer-events: none; + background-color: inherit; + -webkit-backdrop-filter: none; + backdrop-filter: none; +} + +.md-consent__inner { + background-color: color-mix(in srgb, var(--md-default-bg-color) 75%, transparent); + -webkit-backdrop-filter: blur(0.7rem); + backdrop-filter: blur(0.7rem); + border-radius: 0; + + h4 { + display: flex; + align-items: center; + } + + img { + width: 1.5rem; + height: 1.5rem; + margin-right: 0.5rem; + } + + .md-button { + border-radius: 1rem; + } + + &::before { + content: ""; + position: absolute; + pointer-events: none; + background-color: color-mix(in srgb, var(--md-primary-fg-color) 7%, transparent); + z-index: 0; + inset: 0; + } +} + +.md-consent__controls { + .md-button { + border-color: var(--md-primary-fg-color--dark); + color: var(--md-primary-fg-color--dark); + } + + .md-button--primary { + background-color: var(--md-primary-fg-color--dark); + color: var(--md-primary-bg-color); + } +} \ No newline at end of file diff --git a/docs/stylesheets/header.css b/docs/stylesheets/header.css new file mode 100644 index 0000000..a567821 --- /dev/null +++ b/docs/stylesheets/header.css @@ -0,0 +1,20 @@ +.md-header { + font-weight: bold; + background-color: color-mix(in srgb, var(--md-primary-fg-color) 53%, transparent); + -webkit-backdrop-filter: blur(0.5rem); + backdrop-filter: blur(0.5rem); + border-radius: 0; + + &::before { + content: ""; + position: absolute; + pointer-events: none; + background-color: color-mix(in srgb, var(--md-primary-fg-color--dark) 57%, transparent); + z-index: 0; + inset: 0; + } +} + +.md-header__source { + z-index: 0; +} \ No newline at end of file diff --git a/docs/stylesheets/search-bar.css b/docs/stylesheets/search-bar.css new file mode 100644 index 0000000..6025267 --- /dev/null +++ b/docs/stylesheets/search-bar.css @@ -0,0 +1,30 @@ +.md-search__input { + font-weight: bold; +} + +.md-search__form { + border-radius: 1rem; + border-top-right-radius: 1rem !important; + border-top-left-radius: 1rem !important; + + &:hover { + background-color: var(--md-default-fg-color--lighter); + } +} + +.md-search__output { + border-bottom-left-radius: 1rem !important; + border-bottom-right-radius: 1rem !important; +} + +@media screen and (max-width: 59.9844em) { + .md-search__form { + border-top-right-radius: inherit !important; + border-top-left-radius: inherit !important; + } + + .md-search__output { + border-bottom-left-radius: inherit !important; + border-bottom-right-radius: inherit !important; + } +} \ No newline at end of file diff --git a/docs/stylesheets/tabs.css b/docs/stylesheets/tabs.css new file mode 100644 index 0000000..a2d025b --- /dev/null +++ b/docs/stylesheets/tabs.css @@ -0,0 +1,25 @@ +.md-tabs { + font-weight: bold; + box-shadow: 0 0 .1rem #0000001a, 0 .1rem .2rem #0003; + background-color: color-mix(in srgb, var(--md-primary-fg-color) 53%, transparent); + -webkit-backdrop-filter: blur(0.5rem); + backdrop-filter: blur(0.5rem); + border-radius: 0; + + &::before { + content: ""; + position: absolute; + pointer-events: none; + background-color: color-mix(in srgb, var(--md-primary-fg-color--dark) 57%, transparent); + z-index: 0; + inset: 0; + } +} + +.md-tabs__item--active { + text-decoration: underline; + text-decoration-color: color-mix(in srgb, var(--md-primary-bg-color) 70%, transparent); + text-decoration-thickness: 0.25rem; + text-decoration-skip-ink: auto; + text-underline-offset: 0.375rem; +} \ No newline at end of file diff --git a/docs/stylesheets/task-list-indicator.css b/docs/stylesheets/task-list-indicator.css new file mode 100644 index 0000000..dc680c0 --- /dev/null +++ b/docs/stylesheets/task-list-indicator.css @@ -0,0 +1,11 @@ +.md-typeset .task-list-indicator::before { + background-color: var(--md-default-fg-color--lighter); +} + +.md-typeset [type="checkbox"]:checked+.task-list-indicator::before { + background-color: var(--md-primary-fg-color--dark); +} + +.md-typeset .task-list-item { + padding-left: 0.25rem; +} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index ab055f9..e3d147d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,8 +3,7 @@ site_name: PyORlib site_url: https://dapensoft.github.io/pyorlib/ site_author: Isaac Da Pena & Manuel Da Pena site_description: >- - A powerful Python library for operations research. Define, solve, and interact with - mathematical models in a standardized manner across different optimization packages. + A powerful Python library for operations research and optimization. # Repository repo_name: dapensoft/pyorlib @@ -12,16 +11,24 @@ repo_url: https://github.com/dapensoft/pyorlib # Copyright copyright: | - Copyright © 2024 Isaac Da Pena, - Manuel Da Pena + Copyright © 2024-2026 Isaac Da Pena, + Manuel Da Pena – + Change Cookie Settings # Configuration theme: name: material language: en + custom_dir: docs/.overrides logo: images/logo/pyorlib-logo-white.svg favicon: images/favicon/pyorlib-logo.ico palette: + # Palette toggle for automatic mode + - media: "(prefers-color-scheme)" + toggle: + icon: material/weather-sunny + name: Switch to light mode + # Palette toggle for light mode - media: '(prefers-color-scheme: light)' scheme: default primary: pink @@ -29,13 +36,14 @@ theme: toggle: icon: material/weather-night name: Switch to dark mode + # Palette toggle for dark mode - media: '(prefers-color-scheme: dark)' scheme: slate primary: pink accent: amber toggle: - icon: material/weather-sunny - name: Switch to light mode + icon: material/brightness-auto + name: Switch to system preference features: - navigation.tabs - navigation.indexes @@ -56,11 +64,35 @@ extra: social: - icon: fontawesome/brands/github link: https://github.com/dapensoft + analytics: + provider: google + property: !ENV GOOGLE_ANALYTICS_KEY + feedback: + title: Was this page helpful? + ratings: + - icon: material/thumb-up-outline + name: This page was helpful + data: 1 + note: >- + Thanks for your feedback! + - icon: material/thumb-down-outline + name: This page could be improved + data: 0 + note: >- + Thanks for your feedback! + consent: + title: