blog: fix serving of fonts on App Engine
Change-Id: I4c1fc9b10440b8e99a04614d89ac1fe0db58ae68
Reviewed-on: https://go-review.googlesource.com/33260
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/app.yaml b/app.yaml
index 0377f30..43127be 100644
--- a/app.yaml
+++ b/app.yaml
@@ -8,6 +8,14 @@
static_files: static/favicon.ico
upload: static/favicon.ico
secure: always
+- url: /fonts.css
+ static_files: static/fonts.css
+ upload: static/fonts.css
+ secure: always
+- url: /fonts
+ static_dir: static/fonts
+ http_headers:
+ Content-Type: application/font-woff
- url: /.*
script: _go_app
secure: always
diff --git a/blog/blog.go b/blog/blog.go
index 08125df..9d861c1 100644
--- a/blog/blog.go
+++ b/blog/blog.go
@@ -37,7 +37,8 @@
}
http.HandleFunc("/blog", redirect)
http.HandleFunc("/blog/", redirect)
-
+ http.Handle("/fonts/", http.FileServer(http.Dir("static")))
+ http.Handle("/fonts.css", http.FileServer(http.Dir("static")))
http.Handle("/lib/godoc/", http.StripPrefix("/lib/godoc/", http.HandlerFunc(staticHandler)))
}
diff --git a/static/fonts.css b/static/fonts.css
index 5edf1fa..62ca66e 100644
--- a/static/fonts.css
+++ b/static/fonts.css
@@ -1,69 +1,69 @@
@font-face {
font-family: 'Go';
- src: url('GoMedium-Italic.woff') format('woff');
+ src: url('fonts/GoMedium-Italic.woff') format('woff');
font-weight: 500;
font-style: italic;
}
@font-face {
font-family: 'Go';
- src: url('Go-Italic.woff') format('woff');
+ src: url('fonts/Go-Italic.woff') format('woff');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Go';
- src: url('Go-Bold.woff') format('woff');
+ src: url('fonts/Go-Bold.woff') format('woff');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Go';
- src: url('GoMedium.woff') format('woff');
+ src: url('fonts/GoMedium.woff') format('woff');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'Go';
- src: url('Go-BoldItalic.woff') format('woff');
+ src: url('fonts/Go-BoldItalic.woff') format('woff');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'Go';
- src: url('GoRegular.woff') format('woff');
+ src: url('fonts/GoRegular.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Go Mono';
- src: url('GoMono-Bold.woff') format('woff');
+ src: url('fonts/GoMono-Bold.woff') format('woff');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Go Mono';
- src: url('GoMono.woff') format('woff');
+ src: url('fonts/GoMono.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Go Mono';
- src: url('GoMono-Italic.woff') format('woff');
+ src: url('fonts/GoMono-Italic.woff') format('woff');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Go Mono';
- src: url('GoMono-BoldItalic.woff') format('woff');
+ src: url('fonts/GoMono-BoldItalic.woff') format('woff');
font-weight: bold;
font-style: italic;
}
diff --git a/static/Go-Bold.woff b/static/fonts/Go-Bold.woff
similarity index 100%
rename from static/Go-Bold.woff
rename to static/fonts/Go-Bold.woff
Binary files differ
diff --git a/static/Go-BoldItalic.woff b/static/fonts/Go-BoldItalic.woff
similarity index 100%
rename from static/Go-BoldItalic.woff
rename to static/fonts/Go-BoldItalic.woff
Binary files differ
diff --git a/static/Go-Italic.woff b/static/fonts/Go-Italic.woff
similarity index 100%
rename from static/Go-Italic.woff
rename to static/fonts/Go-Italic.woff
Binary files differ
diff --git a/static/GoMedium-Italic.woff b/static/fonts/GoMedium-Italic.woff
similarity index 100%
rename from static/GoMedium-Italic.woff
rename to static/fonts/GoMedium-Italic.woff
Binary files differ
diff --git a/static/GoMedium.woff b/static/fonts/GoMedium.woff
similarity index 100%
rename from static/GoMedium.woff
rename to static/fonts/GoMedium.woff
Binary files differ
diff --git a/static/GoMono-Bold.woff b/static/fonts/GoMono-Bold.woff
similarity index 100%
rename from static/GoMono-Bold.woff
rename to static/fonts/GoMono-Bold.woff
Binary files differ
diff --git a/static/GoMono-BoldItalic.woff b/static/fonts/GoMono-BoldItalic.woff
similarity index 100%
rename from static/GoMono-BoldItalic.woff
rename to static/fonts/GoMono-BoldItalic.woff
Binary files differ
diff --git a/static/GoMono-Italic.woff b/static/fonts/GoMono-Italic.woff
similarity index 100%
rename from static/GoMono-Italic.woff
rename to static/fonts/GoMono-Italic.woff
Binary files differ
diff --git a/static/GoMono.woff b/static/fonts/GoMono.woff
similarity index 100%
rename from static/GoMono.woff
rename to static/fonts/GoMono.woff
Binary files differ
diff --git a/static/GoRegular.woff b/static/fonts/GoRegular.woff
similarity index 100%
rename from static/GoRegular.woff
rename to static/fonts/GoRegular.woff
Binary files differ
diff --git a/template/root.tmpl b/template/root.tmpl
index 2c4d114..cf1142c 100644
--- a/template/root.tmpl
+++ b/template/root.tmpl
@@ -9,7 +9,7 @@
<meta name="theme-color" content="#375EAB">
<title>{{template "title" .}}</title>
<link type="text/css" rel="stylesheet" href="/lib/godoc/style.css">
- <link type="text/css" rel="stylesheet" href="/static/fonts.css">
+ <link type="text/css" rel="stylesheet" href="/fonts.css">
<link rel="alternate" type="application/atom+xml" title="blog.golang.org - Atom Feed" href="//blog.golang.org/feed.atom" />
<script type="text/javascript">window.initFuncs = [];</script>
<style>