aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2016-11-17 13:48:15 +1100
committerAndrew Gerrand <adg@golang.org>2016-11-17 02:50:40 +0000
commit44f17a108ad6d3c2ab63233a43368d7a21fe98a3 (patch)
treeeefb6d147c530fac662bd5f998d2c8903fe5bd2a
parentc129568cc4ace90e54382dddc3e0ff44b19941f3 (diff)
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>
-rw-r--r--app.yaml8
-rw-r--r--blog/blog.go3
-rw-r--r--static/fonts.css20
-rw-r--r--static/fonts/Go-Bold.woff (renamed from static/Go-Bold.woff)bin36532 -> 36532 bytes
-rw-r--r--static/fonts/Go-BoldItalic.woff (renamed from static/Go-BoldItalic.woff)bin39416 -> 39416 bytes
-rw-r--r--static/fonts/Go-Italic.woff (renamed from static/Go-Italic.woff)bin39852 -> 39852 bytes
-rw-r--r--static/fonts/GoMedium-Italic.woff (renamed from static/GoMedium-Italic.woff)bin45996 -> 45996 bytes
-rw-r--r--static/fonts/GoMedium.woff (renamed from static/GoMedium.woff)bin42316 -> 42316 bytes
-rw-r--r--static/fonts/GoMono-Bold.woff (renamed from static/GoMono-Bold.woff)bin39200 -> 39200 bytes
-rw-r--r--static/fonts/GoMono-BoldItalic.woff (renamed from static/GoMono-BoldItalic.woff)bin42968 -> 42968 bytes
-rw-r--r--static/fonts/GoMono-Italic.woff (renamed from static/GoMono-Italic.woff)bin42912 -> 42912 bytes
-rw-r--r--static/fonts/GoMono.woff (renamed from static/GoMono.woff)bin39336 -> 39336 bytes
-rw-r--r--static/fonts/GoRegular.woff (renamed from static/GoRegular.woff)bin36928 -> 36928 bytes
-rw-r--r--template/root.tmpl2
14 files changed, 21 insertions, 12 deletions
diff --git a/app.yaml b/app.yaml
index 0377f30..43127be 100644
--- a/app.yaml
+++ b/app.yaml
@@ -8,6 +8,14 @@ handlers:
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 @@ func init() {
}
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
index 9e20c5d..9e20c5d 100644
--- a/static/Go-Bold.woff
+++ b/static/fonts/Go-Bold.woff
Binary files differ
diff --git a/static/Go-BoldItalic.woff b/static/fonts/Go-BoldItalic.woff
index 02af73a..02af73a 100644
--- a/static/Go-BoldItalic.woff
+++ b/static/fonts/Go-BoldItalic.woff
Binary files differ
diff --git a/static/Go-Italic.woff b/static/fonts/Go-Italic.woff
index ac68078..ac68078 100644
--- a/static/Go-Italic.woff
+++ b/static/fonts/Go-Italic.woff
Binary files differ
diff --git a/static/GoMedium-Italic.woff b/static/fonts/GoMedium-Italic.woff
index 49c509c..49c509c 100644
--- a/static/GoMedium-Italic.woff
+++ b/static/fonts/GoMedium-Italic.woff
Binary files differ
diff --git a/static/GoMedium.woff b/static/fonts/GoMedium.woff
index 2541515..2541515 100644
--- a/static/GoMedium.woff
+++ b/static/fonts/GoMedium.woff
Binary files differ
diff --git a/static/GoMono-Bold.woff b/static/fonts/GoMono-Bold.woff
index f636e56..f636e56 100644
--- a/static/GoMono-Bold.woff
+++ b/static/fonts/GoMono-Bold.woff
Binary files differ
diff --git a/static/GoMono-BoldItalic.woff b/static/fonts/GoMono-BoldItalic.woff
index 3d977e0..3d977e0 100644
--- a/static/GoMono-BoldItalic.woff
+++ b/static/fonts/GoMono-BoldItalic.woff
Binary files differ
diff --git a/static/GoMono-Italic.woff b/static/fonts/GoMono-Italic.woff
index 9544027..9544027 100644
--- a/static/GoMono-Italic.woff
+++ b/static/fonts/GoMono-Italic.woff
Binary files differ
diff --git a/static/GoMono.woff b/static/fonts/GoMono.woff
index f7e5ffe..f7e5ffe 100644
--- a/static/GoMono.woff
+++ b/static/fonts/GoMono.woff
Binary files differ
diff --git a/static/GoRegular.woff b/static/fonts/GoRegular.woff
index 5292f4a..5292f4a 100644
--- a/static/GoRegular.woff
+++ b/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>