diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css index 5be72283d4..5789dfff8b 100644 --- a/docs/source/_static/css/custom.css +++ b/docs/source/_static/css/custom.css @@ -103,3 +103,7 @@ h3.admonition-title::before { mask-image: var(--icon-admonition-default); mask-repeat: no-repeat; } +/* Apply SVG from inline page.html */ +.hidden-svg { + display: none; +} diff --git a/docs/source/_static/css/dark_light_mode.css b/docs/source/_static/css/dark_light_mode.css new file mode 100644 index 0000000000..405fdb59a0 --- /dev/null +++ b/docs/source/_static/css/dark_light_mode.css @@ -0,0 +1,20 @@ +body { + --color-code-background: #f8f8f8; + --color-code-foreground: black; +} + +/* Dark theme styles */ +@media not print { + body[data-theme="dark"] { + --color-code-background: #272822; + --color-code-foreground: #f8f8f2; + } + + /* For users who prefer dark color scheme */ + @media (prefers-color-scheme: dark) { + body:not([data-theme="light"]) { + --color-code-background: #272822; + --color-code-foreground: #f8f8f2; + } + } +} diff --git a/docs/source/_static/js/loadShortbread.js b/docs/source/_static/js/loadShortbread.js new file mode 100644 index 0000000000..6b31b35f4a --- /dev/null +++ b/docs/source/_static/js/loadShortbread.js @@ -0,0 +1,27 @@ +// Load shortbread +document.addEventListener('DOMContentLoaded', function() { + + document.body.dataset.theme = localStorage.getItem("theme") || "auto"; + + if (typeof AWSCShortbread !== 'undefined') { + const shortbread = AWSCShortbread({ + // domain: ".amazonaws.com" + domain: "d3o2vvnrhogbwx.cloudfront.net" + }); + + // Check for cookie consent + shortbread.checkForCookieConsent(); + + // Add event listener for 'Cookie preferences' button read from page.html + const cookiePreferencesLink = document.getElementById('cookie-button-link'); + if (cookiePreferencesLink) { + cookiePreferencesLink.addEventListener('click', function(event) { + event.preventDefault(); + shortbread.customizeCookies(); + }); + } + console.log("AWSCShortbread loaded successfully loaded!!!") + } else { + console.error("AWSCShortbread failed to load!!!") + } +}); diff --git a/docs/source/_templates/_head_css_variables.html b/docs/source/_templates/_head_css_variables.html new file mode 100644 index 0000000000..8c635eb50b --- /dev/null +++ b/docs/source/_templates/_head_css_variables.html @@ -0,0 +1,31 @@ +{# + This is where user-provided CSS variables get converted into actual values. +#} +{% macro declare_css_variables(user_customisations, pygments_theme) -%} + + --color-code-background: {{ pygments_theme.background }}; + --color-code-foreground: {{ pygments_theme.foreground }}; + {% if user_customisations -%} + {% for name, value in user_customisations.items() -%} + --{{ name }}: {{ value }}; + {% endfor %} + {%- endif %} +{%- endmacro %} + + + + diff --git a/docs/source/_templates/base.html b/docs/source/_templates/base.html new file mode 100644 index 0000000000..580a01028c --- /dev/null +++ b/docs/source/_templates/base.html @@ -0,0 +1,107 @@ + + + + + + + {%- block site_meta -%} + + + + + {%- if metatags %}{{ metatags }}{% endif -%} + + {%- block linktags %} + {%- if hasdoc('about') -%} + + {%- endif -%} + {%- if hasdoc('genindex') -%} + + {%- endif -%} + {%- if hasdoc('search') -%} + + {%- endif -%} + {%- if hasdoc('copyright') -%} + + {%- endif -%} + {%- if next -%} + + {%- endif -%} + {%- if prev -%} + + {%- endif -%} + {#- rel="canonical" (set by html_baseurl) -#} + {%- if pageurl %} + + {%- endif %} + {%- endblock linktags %} + + {# Favicon #} + {%- if favicon_url -%} + + {%- endif -%} + + + + {%- endblock site_meta -%} + + {#- Site title -#} + {%- block htmltitle -%} + {% if not docstitle %} + {{ title|striptags|e }} + {% elif pagename == master_doc %} + {{ docstitle|striptags|e }} + {% else %} + {{ title|striptags|e }} - {{ docstitle|striptags|e }} + {% endif %} + {%- endblock -%} + + {%- block styles -%} + + {# Custom stylesheets #} + {%- block regular_styles -%} + {%- for css in css_files -%} + {% if css|attr("filename") -%} + {{ css_tag(css) }} + {%- else -%} + + {%- endif %} + {% endfor -%} + {%- endblock regular_styles -%} + + {#- Theme-related stylesheets -#} + {%- block theme_styles %} + {% include "_head_css_variables.html" with context %} + {%- endblock -%} + + {%- block extra_styles %} + {%- endblock -%} + + {%- endblock styles -%} + + {#- Custom front matter #} + {%- block extrahead -%}{%- endblock -%} + + + {% block body %} + + {% endblock %} + + {%- block scripts -%} + + {# Custom JS #} + {%- block regular_scripts -%} + {% for path in script_files -%} + {{ js_tag(path) }} + {% endfor -%} + {%- endblock regular_scripts -%} + + {# Theme-related JavaScript code #} + {%- block theme_scripts -%} + {%- endblock -%} + + {%- endblock scripts -%} + + \ No newline at end of file diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html new file mode 100644 index 0000000000..7b04258902 --- /dev/null +++ b/docs/source/_templates/layout.html @@ -0,0 +1,61 @@ +{# Adapted from Just the Docs #} + + + Contents + + + + + + Menu + + + + + + + + Expand + + + + + + Light mode + + + + + + + + + + + + + + Dark mode + + + + + + + Auto light/dark mode + + + + + + + + + + + \ No newline at end of file diff --git a/docs/source/_templates/page.html b/docs/source/_templates/page.html index 68cc2615d4..0d3b712686 100644 --- a/docs/source/_templates/page.html +++ b/docs/source/_templates/page.html @@ -9,14 +9,12 @@ furnished to do so, subject to the following conditions: #} -{%- extends "!page.html" %} +{% extends "base.html" %} + {% block body -%} - -{% include "partials/icons.html" %} - +{% include 'layout.html' %} + Close Menu - - - Privacy | Site Terms | Cookie preferences + + + Privacy | + Site Terms | + Cookie preferences {# end of AWS modification of Furo template #}