From e9ab708fca2f7f22de0a1b7177a8273042b263fb Mon Sep 17 00:00:00 2001 From: tmont Date: Sat, 5 Mar 2011 23:49:19 +0000 Subject: [PATCH] added analytics link, robots.txt route, and meta stuff --- .../Controllers/HomeController.cs | 7 +++ Src/VideoGameQuotes.Web/Global.asax.cs | 1 + .../VideoGameQuotes.Web.csproj | 3 +- Src/VideoGameQuotes.Web/Views/Home/About.aspx | 8 +-- .../Views/Quote/Search.aspx | 2 +- .../Views/Shared/Foo.master | 17 ------ .../Views/Shared/PageWithoutAnalytics.Master | 2 + .../Views/Shared/Site.Master | 53 ------------------- 8 files changed, 18 insertions(+), 75 deletions(-) delete mode 100644 Src/VideoGameQuotes.Web/Views/Shared/Foo.master delete mode 100644 Src/VideoGameQuotes.Web/Views/Shared/Site.Master diff --git a/Src/VideoGameQuotes.Web/Controllers/HomeController.cs b/Src/VideoGameQuotes.Web/Controllers/HomeController.cs index 04a11e0..cfc978c 100644 --- a/Src/VideoGameQuotes.Web/Controllers/HomeController.cs +++ b/Src/VideoGameQuotes.Web/Controllers/HomeController.cs @@ -56,6 +56,13 @@ namespace VideoGameQuotes.Web.Controllers { return View(); } + public ActionResult Robots() { + const string robotsTxt = @"User-Agent: * +Disallow: /search/ +"; + return Content(robotsTxt, "text/plain", Encoding.UTF8); + } + public ActionResult Favicon() { return File("/media/images/favicon.png", "image/png"); } diff --git a/Src/VideoGameQuotes.Web/Global.asax.cs b/Src/VideoGameQuotes.Web/Global.asax.cs index 1c97171..ab8afad 100644 --- a/Src/VideoGameQuotes.Web/Global.asax.cs +++ b/Src/VideoGameQuotes.Web/Global.asax.cs @@ -52,6 +52,7 @@ namespace VideoGameQuotes.Web { routes.IgnoreRoute("media/{*anything}"); routes.MapRoute("favicon", "favicon.ico", new { controller = "Home", action = "Favicon" }); + routes.MapRoute("robots", "robots.txt", new { controller = "Home", action = "Robots" }); //bullshit route so that RenderAction works routes.MapSmartRoute("mainmenu", "home/mainmenu", new { controller = "Home", action = "MainMenu" }); diff --git a/Src/VideoGameQuotes.Web/VideoGameQuotes.Web.csproj b/Src/VideoGameQuotes.Web/VideoGameQuotes.Web.csproj index c1a0ef1..be231de 100644 --- a/Src/VideoGameQuotes.Web/VideoGameQuotes.Web.csproj +++ b/Src/VideoGameQuotes.Web/VideoGameQuotes.Web.csproj @@ -249,8 +249,9 @@ Web.config - + + diff --git a/Src/VideoGameQuotes.Web/Views/Home/About.aspx b/Src/VideoGameQuotes.Web/Views/Home/About.aspx index 58f1d07..9bf0d2d 100644 --- a/Src/VideoGameQuotes.Web/Views/Home/About.aspx +++ b/Src/VideoGameQuotes.Web/Views/Home/About.aspx @@ -5,9 +5,10 @@

Video Game Quotes is a little project that I decided to tackle one day. I gave - myself a week to implement everything and throw it up on the internet. It actually took three + myself a week to implement everything and throw it up on the internet. It actually took three and a half weeks as I struggled with Lucene and my - obviously poor graphic design skills. + obviously poor graphic design skills. Mono was also + a bit more of a disaster area than I expected.

@@ -29,7 +30,8 @@ Unity and NHibernate. It runs on nginx using Mono via FastCGI on Ubuntu. It uses MySQL for the backend and - Lucene.NET for search indexing. + Lucene.NET for search indexing. This was my first + foray into ASP.NET on Linux.

diff --git a/Src/VideoGameQuotes.Web/Views/Quote/Search.aspx b/Src/VideoGameQuotes.Web/Views/Quote/Search.aspx index d7506a4..feeba7f 100644 --- a/Src/VideoGameQuotes.Web/Views/Quote/Search.aspx +++ b/Src/VideoGameQuotes.Web/Views/Quote/Search.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Views/Shared/Site.Master" %> +<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Views/Shared/PageWithoutAnalytics.Master" %> <%@ Import Namespace="VideoGameQuotes.Web.Models" %> Search<%= !string.IsNullOrEmpty(Model.SearchQuery) ? " - " + Model.SearchQuery : "" %> diff --git a/Src/VideoGameQuotes.Web/Views/Shared/Foo.master b/Src/VideoGameQuotes.Web/Views/Shared/Foo.master deleted file mode 100644 index 5b58a65..0000000 --- a/Src/VideoGameQuotes.Web/Views/Shared/Foo.master +++ /dev/null @@ -1,17 +0,0 @@ -<%@ Master Language="C#" MasterPageFile="PageWithoutAnalytics.Master" %> - - - - - - diff --git a/Src/VideoGameQuotes.Web/Views/Shared/PageWithoutAnalytics.Master b/Src/VideoGameQuotes.Web/Views/Shared/PageWithoutAnalytics.Master index 0004935..b78505e 100644 --- a/Src/VideoGameQuotes.Web/Views/Shared/PageWithoutAnalytics.Master +++ b/Src/VideoGameQuotes.Web/Views/Shared/PageWithoutAnalytics.Master @@ -6,8 +6,10 @@ Video Game Quotes :: <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> + + diff --git a/Src/VideoGameQuotes.Web/Views/Shared/Site.Master b/Src/VideoGameQuotes.Web/Views/Shared/Site.Master deleted file mode 100644 index 0004935..0000000 --- a/Src/VideoGameQuotes.Web/Views/Shared/Site.Master +++ /dev/null @@ -1,53 +0,0 @@ -<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> - - - - - Video Game Quotes :: <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> - - - - - - -

- - -
-
- -
-
- - -
- - - - - -