Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit05527e4

Browse files
committed
Use absolute paths
1 parent65e103f commit05527e4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎server/index.egon‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<link rel="preload" href="/font/RobotoMono-Bold.woff2" as="font" type="font/woff2" crossorigin>
2525

2626
<% if cssPath != "" { %>
27-
<link href="<%== cssPath %>" rel="stylesheet">
27+
<link href="/<%== cssPath %>" rel="stylesheet">
2828
<% } %>
2929

3030
<link rel="manifest" href="/manifest.json">
@@ -34,7 +34,7 @@
3434
<div id="root"></div>
3535

3636
<% for _, script := range scripts { %>
37-
<script src="<%== script %>"></script>
37+
<script src="/<%== script %>"></script>
3838
<% } %>
3939

4040
<noscript>This page needs JavaScript enabled to function.</noscript>

‎server/index.egon.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ io.WriteString(w, "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\
1111
io.WriteString(w,inlineScript )
1212
io.WriteString(w,"</script><link rel=\"preload\" href=\"/font/fontello.woff2?48901973\" as=\"font\" type=\"font/woff2\" crossorigin><link rel=\"preload\" href=\"/font/RobotoMono-Regular.woff2\" as=\"font\" type=\"font/woff2\" crossorigin><link rel=\"preload\" href=\"/font/Montserrat-Regular.woff2\" as=\"font\" type=\"font/woff2\" crossorigin><link rel=\"preload\" href=\"/font/Montserrat-Bold.woff2\" as=\"font\" type=\"font/woff2\" crossorigin><link rel=\"preload\" href=\"/font/RobotoMono-Bold.woff2\" as=\"font\" type=\"font/woff2\" crossorigin>")
1313
ifcssPath!="" {
14-
io.WriteString(w,"<link href=\"")
14+
io.WriteString(w,"<link href=\"/")
1515
io.WriteString(w,cssPath )
1616
io.WriteString(w,"\" rel=\"stylesheet\">")
1717
}
1818
io.WriteString(w,"<link rel=\"manifest\" href=\"/manifest.json\"></head><body><div id=\"root\"></div>")
1919
for_,script:=rangescripts {
20-
io.WriteString(w,"<script src=\"")
20+
io.WriteString(w,"<script src=\"/")
2121
io.WriteString(w,script )
2222
io.WriteString(w,"\"></script>")
2323
}

‎server/serve_files.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (d *Dispatch) initFileServer() {
120120
}
121121

122122
file:=&File{
123-
Path:assetName,
123+
Path:"/"+assetName,
124124
Asset:asset,
125125
ContentType:contentTypes[filepath.Ext(assetName)],
126126
CacheControl:longCacheControl,
@@ -235,7 +235,7 @@ func (d *Dispatch) serveFiles(w http.ResponseWriter, r *http.Request) {
235235
}
236236

237237
for_,file:=rangefiles {
238-
ifstrings.HasSuffix(r.URL.Path,file.Path) {
238+
ifr.URL.Path==file.Path {
239239
d.serveFile(w,r,file)
240240
return
241241
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp