File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ public static partial class FontPreloader
13
13
{
14
14
private static IReadOnlyCollection < string > ? FontUriCache = null ! ;
15
15
16
- public static async Task < IReadOnlyCollection < string > > GetFontUrisAsync ( ) => FontUriCache ??= await LoadFontUrisAsync ( ) ;
17
- private static async Task < IReadOnlyCollection < string > > LoadFontUrisAsync ( )
16
+ public static async Task < IReadOnlyCollection < string > > GetFontUrisAsync ( string ? urlPrefix ) => FontUriCache ??= await LoadFontUrisAsync ( urlPrefix ) ;
17
+ private static async Task < IReadOnlyCollection < string > > LoadFontUrisAsync ( string ? urlPrefix )
18
18
{
19
19
var cachedFontUris = new List < string > ( ) ;
20
20
var assembly = Assembly . GetExecutingAssembly ( ) ;
@@ -28,7 +28,7 @@ private static async Task<IReadOnlyCollection<string>> LoadFontUrisAsync()
28
28
foreach ( Match match in matches )
29
29
{
30
30
if ( match . Success )
31
- cachedFontUris . Add ( $ "/_static/{ match . Groups [ 1 ] . Value } ") ;
31
+ cachedFontUris . Add ( $ "{ urlPrefix } /_static/{ match . Groups [ 1 ] . Value } ") ;
32
32
}
33
33
FontUriCache = cachedFontUris ;
34
34
return FontUriCache ;
Original file line number Diff line number Diff line change 2
2
@using Elastic .Markdown .Helpers
3
3
<head >
4
4
<title >@Model.Title </title >
5
- @foreach ( var fontFile in await FontPreloader .GetFontUrisAsync ())
5
+ @foreach ( var fontFile in await FontPreloader .GetFontUrisAsync (@Model . UrlPathPrefix ))
6
6
{
7
7
<link rel =" preload" href =" @fontFile" as =" font" type =" font/woff2" crossorigin >
8
8
}
You can’t perform that action at this time.
0 commit comments