blog: clean up blog to allow usage with gcloud command

+ The app.yaml file needs to be in the same directory as the
  entry-point Go files, so those are moved from ./blog to ./
+ Go files within the context article did not have the +build OMIT
  directive, so gcloud would view them as files that needed to be
  built at deploy time. Add the +build OMIT directive and use
  the context package instead of x/net/context.
+ Switch to using a service instead of version and update app.yaml
  to account for this.
+ Use 1.9 as the runtime.
+ Remove superfluous .gitignore

Change-Id: I7c886849b912bc7f5b67cd2791cb6986d93d5cc7
Reviewed-on: https://go-review.googlesource.com/114455
Reviewed-by: Russ Cox <rsc@golang.org>
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 8339fd6..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# Add no patterns to .hgignore except for files generated by the build.
-last-change
diff --git a/README.md b/README.md
index d22821b..3305877 100644
--- a/README.md
+++ b/README.md
@@ -11,14 +11,12 @@
 
 To run the blog server locally:
 
-	go build -o blog.exe ./blog
-	./blog.exe
+```sh
+dev_appserver.py app.yaml
+```
 
 and then visit [http://localhost:8080/](http://localhost:8080) in your browser.
 
-Note that blog.exe caches all content and you must kill it (Ctrl-C on Unix
-systems) and restart it after editing any files to view changes.
-
 ## Contributing
 
 Articles on the blog should have broad interest to the Go community, and
diff --git a/app.yaml b/app.yaml
index 43127be..b6edeb7 100644
--- a/app.yaml
+++ b/app.yaml
@@ -1,7 +1,6 @@
-application: golang-org
-version: blog-test
+service: blog
 runtime: go
-api_version: go1
+api_version: go1.9
 
 handlers:
 - url: /favicon.ico
diff --git a/blog/appengine.go b/appengine.go
similarity index 100%
rename from blog/appengine.go
rename to appengine.go
diff --git a/blog/blog.go b/blog.go
similarity index 100%
rename from blog/blog.go
rename to blog.go
diff --git a/content/context/google/google.go b/content/context/google/google.go
index 740e6c5..75442d0 100644
--- a/content/context/google/google.go
+++ b/content/context/google/google.go
@@ -1,3 +1,5 @@
+// +build OMIT
+
 // Package google provides a function to do Google searches using the Google Web
 // Search API. See https://developers.google.com/web-search/docs/
 //
@@ -9,11 +11,11 @@
 package google
 
 import (
+	"context"
 	"encoding/json"
 	"net/http"
 
 	"golang.org/x/blog/content/context/userip"
-	"golang.org/x/net/context"
 )
 
 // Results is an ordered list of search results.
diff --git a/content/context/server/server.go b/content/context/server/server.go
index 2504370..ebee9a1 100644
--- a/content/context/server/server.go
+++ b/content/context/server/server.go
@@ -1,3 +1,5 @@
+// +build OMIT
+
 // The server program issues Google search requests and demonstrates the use of
 // the go.net Context API. It serves on port 8080.
 //
@@ -11,6 +13,7 @@
 package main
 
 import (
+	"context"
 	"html/template"
 	"log"
 	"net/http"
@@ -18,7 +21,6 @@
 
 	"golang.org/x/blog/content/context/google"
 	"golang.org/x/blog/content/context/userip"
-	"golang.org/x/net/context"
 )
 
 func main() {
diff --git a/content/context/userip/userip.go b/content/context/userip/userip.go
index 49a7522..06d3245 100644
--- a/content/context/userip/userip.go
+++ b/content/context/userip/userip.go
@@ -1,3 +1,5 @@
+// +build OMIT
+
 // Package userip provides functions for extracting a user IP address from a
 // request and associating it with a Context.
 //
@@ -6,11 +8,10 @@
 package userip
 
 import (
+	"context"
 	"fmt"
 	"net"
 	"net/http"
-
-	"golang.org/x/net/context"
 )
 
 // FromRequest extracts the user IP address from req, if present.
diff --git a/blog/local.go b/local.go
similarity index 100%
rename from blog/local.go
rename to local.go
diff --git a/blog/local_test.go b/local_test.go
similarity index 95%
rename from blog/local_test.go
rename to local_test.go
index a65d815..3b8de62 100644
--- a/blog/local_test.go
+++ b/local_test.go
@@ -12,7 +12,7 @@
 
 func TestServer(t *testing.T) {
 	mux, err := newServer(false, "/static", blog.Config{
-		TemplatePath: "../template",
+		TemplatePath: "./template",
 	})
 	if err != nil {
 		t.Fatal(err)
diff --git a/blog/rewrite.go b/rewrite.go
similarity index 100%
rename from blog/rewrite.go
rename to rewrite.go