internal/web: update doc
Added documentation of .ts file transforms to web package doc.
Change-Id: I00830e9eea9234bd2867b5f62e8f714b9a0474a0
Reviewed-on: https://go-review.googlesource.com/c/website/+/376075
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <amedee@google.com>
Trust: Carlos Amedee <amedee@google.com>
diff --git a/internal/web/site.go b/internal/web/site.go
index 1ebeb43..0004410 100644
--- a/internal/web/site.go
+++ b/internal/web/site.go
@@ -226,7 +226,7 @@
// (at least up to the first kilobyte of the file) and the Site
// can find a template “text.tmpl” in that file's directory or a parent,
// and the file is not named robots.txt,
-// and the file does not have a .css, .js, or .svg extension,
+// and the file does not have a .css, .js, .svg, or .ts extension,
// then the Site responds with the rendering of
//
// Page{
@@ -248,6 +248,10 @@
// then the text file content is not rendered or framed and is instead
// served directly as a plain text response.
//
+// If the request is for a file with a .ts extension the file contents
+// are transformed from TypeScript to JavaScript and then served with
+// a Content-Type=text/javascript header.
+//
// Otherwise, if none of those cases apply but the request path p
// does exist in the file system, then the Site passes the
// request to an http.FileServer serving from fsys.