diff --git a/docs/hooks.py b/docs/hooks.py new file mode 100644 index 00000000..cdb31a52 --- /dev/null +++ b/docs/hooks.py @@ -0,0 +1,6 @@ +import os +import shutil + +def copy_fonts(config, **kwargs): + site_dir = config['site_dir'] + shutil.copytree('docs/static/fonts', os.path.join(site_dir, 'get')) diff --git a/docs/releases.md b/docs/releases.md index 1e335cb2..507e6e35 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -11,6 +11,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release **Bug fixes + maintenance:** * `ntfy sub --poll --from-config` will now include authentication headers from client.yml (if applicable) ([#658](https://github.com/binwiederhier/ntfy/issues/658), thanks to [@wunter8](https://github.com/wunter8)) +* Docs: Removed dependency on Google Fonts in docs ([#554](https://github.com/binwiederhier/ntfy/issues/554), thanks to [@bt90](https://github.com/bt90) for reporting, and [@ozskywalker](https://github.com/ozskywalker) for implementing) * Increase allowed auth failure attempts per IP address to 30 (no ticket) * Web app: Increase maximum incremental backoff retry interval to 2 minutes (no ticket) diff --git a/docs/static/css/extra.css b/docs/static/css/extra.css index 0329b352..3104da16 100644 --- a/docs/static/css/extra.css +++ b/docs/static/css/extra.css @@ -3,6 +3,8 @@ --md-primary-fg-color--light: #338574; --md-primary-fg-color--dark: #338574; --md-footer-bg-color: #353744; + --md-text-font: "Roboto"; + --md-code-font: "Roboto Mono"; } .md-header__button.md-logo :is(img, svg) { @@ -147,3 +149,57 @@ figure video { .lightbox .close-lightbox:hover::before { background-color: #fff; } + +/* roboto-300 - latin */ +@font-face { + font-display: swap; + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + src: url('../fonts/roboto-v30-latin-300.woff2') format('woff2'); +} + +/* roboto-regular - latin */ +@font-face { + font-display: swap; + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: url('../fonts/roboto-v30-latin-regular.woff2') format('woff2'); +} + +/* roboto-italic - latin */ +@font-face { + font-display: swap; + font-family: 'Roboto'; + font-style: italic; + font-weight: 400; + src: url('../fonts/roboto-v30-latin-italic.woff2') format('woff2'); +} + +/* roboto-500 - latin */ +@font-face { + font-display: swap; + font-family: 'Roboto'; + font-style: normal; + font-weight: 500; + src: url('../fonts/roboto-v30-latin-500.woff2') format('woff2'); +} + +/* roboto-700 - latin */ +@font-face { + font-display: swap; + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + src: url('../fonts/roboto-v30-latin-700.woff2') format('woff2'); +} + +/* roboto-mono - latin */ +@font-face { + font-display: swap; + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + src: url('../fonts/roboto-mono-v22-latin-regular.woff2') format('woff2'); +} diff --git a/docs/static/fonts/roboto-mono-v22-latin-regular.woff2 b/docs/static/fonts/roboto-mono-v22-latin-regular.woff2 new file mode 100644 index 00000000..f8894bab Binary files /dev/null and b/docs/static/fonts/roboto-mono-v22-latin-regular.woff2 differ diff --git a/docs/static/fonts/roboto-v30-latin-300.woff2 b/docs/static/fonts/roboto-v30-latin-300.woff2 new file mode 100644 index 00000000..60681387 Binary files /dev/null and b/docs/static/fonts/roboto-v30-latin-300.woff2 differ diff --git a/docs/static/fonts/roboto-v30-latin-500.woff2 b/docs/static/fonts/roboto-v30-latin-500.woff2 new file mode 100644 index 00000000..29342a8d Binary files /dev/null and b/docs/static/fonts/roboto-v30-latin-500.woff2 differ diff --git a/docs/static/fonts/roboto-v30-latin-700.woff2 b/docs/static/fonts/roboto-v30-latin-700.woff2 new file mode 100644 index 00000000..771fbecc Binary files /dev/null and b/docs/static/fonts/roboto-v30-latin-700.woff2 differ diff --git a/docs/static/fonts/roboto-v30-latin-italic.woff2 b/docs/static/fonts/roboto-v30-latin-italic.woff2 new file mode 100644 index 00000000..e1b7a79f Binary files /dev/null and b/docs/static/fonts/roboto-v30-latin-italic.woff2 differ diff --git a/docs/static/fonts/roboto-v30-latin-regular.woff2 b/docs/static/fonts/roboto-v30-latin-regular.woff2 new file mode 100644 index 00000000..020729ef Binary files /dev/null and b/docs/static/fonts/roboto-v30-latin-regular.woff2 differ diff --git a/mkdocs.yml b/mkdocs.yml index e3a0d507..66fc4c84 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -9,6 +9,7 @@ edit_uri: blob/main/docs/ theme: name: material + font: false language: en custom_dir: docs/_overrides logo: static/img/ntfy.png @@ -70,6 +71,9 @@ plugins: - search - minify: minify_html: true + - mkdocs-simple-hooks: + hooks: + on_post_build: "docs.hooks:copy_fonts" nav: - "Getting started": index.md diff --git a/requirements.txt b/requirements.txt index 9c2212a8..17b0fc1a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ # The documentation uses 'mkdocs', which is written in Python mkdocs-material mkdocs-minify-plugin +mkdocs-simple-hooks diff --git a/web/public/static/css/fonts.css b/web/public/static/css/fonts.css index d14bad03..4245d0f5 100644 --- a/web/public/static/css/fonts.css +++ b/web/public/static/css/fonts.css @@ -6,8 +6,7 @@ font-style: normal; font-weight: 300; src: local(''), - url('../fonts/roboto-v29-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('../fonts/roboto-v29-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v29-latin-300.woff2') format('woff2'); } /* roboto-regular - latin */ @@ -16,8 +15,7 @@ font-style: normal; font-weight: 400; src: local(''), - url('../fonts/roboto-v29-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('../fonts/roboto-v29-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v29-latin-regular.woff2') format('woff2'); } /* roboto-500 - latin */ @@ -26,8 +24,7 @@ font-style: normal; font-weight: 500; src: local(''), - url('../fonts/roboto-v29-latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('../fonts/roboto-v29-latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v29-latin-500.woff2') format('woff2'); } /* roboto-700 - latin */ @@ -36,6 +33,5 @@ font-style: normal; font-weight: 700; src: local(''), - url('../fonts/roboto-v29-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ - url('../fonts/roboto-v29-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ + url('../fonts/roboto-v29-latin-700.woff2') format('woff2'); } diff --git a/web/public/static/fonts/roboto-v29-latin-300.woff b/web/public/static/fonts/roboto-v29-latin-300.woff deleted file mode 100644 index 5565042e..00000000 Binary files a/web/public/static/fonts/roboto-v29-latin-300.woff and /dev/null differ diff --git a/web/public/static/fonts/roboto-v29-latin-500.woff b/web/public/static/fonts/roboto-v29-latin-500.woff deleted file mode 100644 index c9eb5cab..00000000 Binary files a/web/public/static/fonts/roboto-v29-latin-500.woff and /dev/null differ diff --git a/web/public/static/fonts/roboto-v29-latin-700.woff b/web/public/static/fonts/roboto-v29-latin-700.woff deleted file mode 100644 index a5d98fc6..00000000 Binary files a/web/public/static/fonts/roboto-v29-latin-700.woff and /dev/null differ diff --git a/web/public/static/fonts/roboto-v29-latin-regular.woff b/web/public/static/fonts/roboto-v29-latin-regular.woff deleted file mode 100644 index 86b38637..00000000 Binary files a/web/public/static/fonts/roboto-v29-latin-regular.woff and /dev/null differ