diff --git a/docs/developers.md b/docs/developers.md index 8db28fd..0d7e617 100644 --- a/docs/developers.md +++ b/docs/developers.md @@ -34,9 +34,9 @@ compassion wins every time. * If you need help with anything, get involved - _we welcome questions asked in good faith, and will move mountains to help_. * If you're unsure where to start, get involved - _we have [many ways to - contribute](/contributing)_. + contribute](contributing.md)_. -All contributors are expected to follow our [code of conduct](/conduct/). +All contributors are expected to follow our [code of conduct](conduct.md). ## Setup @@ -242,7 +242,7 @@ is through this environment that you contribute to PyScript. ## Contributing -* We have [suggestions for how to contribute to PyScript](/contributing). Take +* We have [suggestions for how to contribute to PyScript](contributing.md). Take a read and dive in. * Please make sure you discuss potential contributions *before* you put in diff --git a/docs/javascripts/mini-coi.js b/docs/javascripts/mini-coi.js new file mode 100644 index 0000000..b7a23bf --- /dev/null +++ b/docs/javascripts/mini-coi.js @@ -0,0 +1,28 @@ +/*! coi-serviceworker v0.1.7 - Guido Zuidhof and contributors, licensed under MIT */ +/*! mini-coi - Andrea Giammarchi and contributors, licensed under MIT */ +(({ document: d, navigator: { serviceWorker: s } }) => { + if (d) { + const { currentScript: c } = d; + s.register(c.src, { scope: c.getAttribute('scope') || '.' }).then(r => { + r.addEventListener('updatefound', () => location.reload()); + if (r.active && !s.controller) location.reload(); + }); + } + else { + addEventListener('install', () => skipWaiting()); + addEventListener('activate', e => e.waitUntil(clients.claim())); + addEventListener('fetch', e => { + const { request: r } = e; + if (r.cache === 'only-if-cached' && r.mode !== 'same-origin') return; + e.respondWith(fetch(r).then(r => { + const { body, status, statusText } = r; + if (!status || status > 399) return r; + const h = new Headers(r.headers); + h.set('Cross-Origin-Opener-Policy', 'same-origin'); + h.set('Cross-Origin-Embedder-Policy', 'require-corp'); + h.set('Cross-Origin-Resource-Policy', 'cross-origin'); + return new Response(body, { status, statusText, headers: h }); + })); + }); + } +})(self); diff --git a/mkdocs.yml b/mkdocs.yml index e361549..439fd63 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,6 +5,8 @@ theme: logo: assets/images/pyscript-black.svg + custom_dir: overrides + palette: # Palette toggle for automatic mode - media: "(prefers-color-scheme)" diff --git a/overrides/main.html b/overrides/main.html new file mode 100644 index 0000000..17c4856 --- /dev/null +++ b/overrides/main.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} + +{% block libs %} + +{{ super() }} +{% endblock %}