Move most assets from /static to /assets

Allows to only serve the file that we actually use.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-11-13 18:39:36 +01:00
parent a493acb489
commit e9914bf9bb
No known key found for this signature in database
GPG key ID: 0C971D9DBC9D678D
15 changed files with 6 additions and 14 deletions

View file

@ -16,7 +16,7 @@ load them. Example call:
```sh ```sh
python3 download_google_fonts_css.py \ python3 download_google_fonts_css.py \
"https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i" \ "https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i" \
../../fonts \ ../../../static/fonts \
../../fonts ../../fonts
``` ```

View file

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -134,15 +134,6 @@ sidebar_menu_compact = true
[[module.imports]] [[module.imports]]
path = "github.com/matrix-org/docsy" path = "github.com/matrix-org/docsy"
disable = false disable = false
# Mounting /assets and /static as assets directories helps Hugo to generate
# the correct URL.
[[module.mounts]]
source = 'assets'
target = 'assets'
[[module.mounts]]
source = 'static'
target = 'assets'
# custom output formats # custom output formats

View file

@ -13,5 +13,5 @@
in the document. in the document.
*/}} */}}
{{ $toc := resources.Get "js/toc.js" -}}
<script defer language="javascript" type="text/javascript" src="{{ "js/toc.js" | urlize | relURL }}"></script> <script defer language="javascript" type="text/javascript" src="{{ $toc.RelPermalink }}"></script>

View file

@ -13,5 +13,6 @@
Google Fonts manually via a script: Google Fonts manually via a script:
https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts
*/}} */}}
<link rel="preload" href="{{ "css/fonts/Inter.css" | relURL }}" as="style"> {{ $inter := resources.Get "css/fonts/Inter.css" -}}
<link rel="stylesheet" href="{{ "css/fonts/Inter.css" | relURL }}"> <link rel="preload" href="{{ $inter.RelPermalink }}" as="style">
<link rel="stylesheet" href="{{ $inter.RelPermalink }}">