Skip to content

Commit

Permalink
Move most assets from /static to /assets
Browse files Browse the repository at this point in the history
Allows to only serve the file that we actually use.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
  • Loading branch information
zecakeh committed Nov 13, 2024
1 parent a493acb commit e9914bf
Show file tree
Hide file tree
Showing 15 changed files with 6 additions and 14 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion static/css/fonts/README.md → assets/css/fonts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ load them. Example call:
```sh
python3 download_google_fonts_css.py \
"https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i" \
../../fonts \
../../../static/fonts \
../../fonts
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
9 changes: 0 additions & 9 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ sidebar_menu_compact = true
[[module.imports]]
path = "github.com/matrix-org/docsy"
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

Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/hooks/body-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
in the document.

*/}}

<script defer language="javascript" type="text/javascript" src="{{ "js/toc.js" | urlize | relURL }}"></script>
{{ $toc := resources.Get "js/toc.js" -}}
<script defer language="javascript" type="text/javascript" src="{{ $toc.RelPermalink }}"></script>
5 changes: 3 additions & 2 deletions layouts/partials/hooks/head-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
Google Fonts manually via a script:
https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts
*/}}
<link rel="preload" href="{{ "css/fonts/Inter.css" | relURL }}" as="style">
<link rel="stylesheet" href="{{ "css/fonts/Inter.css" | relURL }}">
{{ $inter := resources.Get "css/fonts/Inter.css" -}}
<link rel="preload" href="{{ $inter.RelPermalink }}" as="style">
<link rel="stylesheet" href="{{ $inter.RelPermalink }}">

0 comments on commit e9914bf

Please sign in to comment.