From c4a2dd41f0ae69a2f9b67ee213c6a7194f9eaa83 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 24 May 2017 10:50:36 -0400 Subject: [PATCH] Apply SEO for ShiftOS skins --- Project-Unite/Controllers/SkinsController.cs | 1 + Project-Unite/Models/Skin.cs | 4 +++- Project-Unite/Views/Shared/_Layout.cshtml | 8 ++++++++ Project-Unite/Views/Skins/ViewSkin.cshtml | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Project-Unite/Controllers/SkinsController.cs b/Project-Unite/Controllers/SkinsController.cs index 3f8da3c..33fc61e 100644 --- a/Project-Unite/Controllers/SkinsController.cs +++ b/Project-Unite/Controllers/SkinsController.cs @@ -61,6 +61,7 @@ public ActionResult PostSkin(CreateSkinViewModel model) skin.PostedAt = DateTime.Now; skin.FullDescription = model.LongDescription; skin.UserId = User.Identity.GetUserId(); + skin.Keywords = model.Keywords; skin.VersionId = ""; string repoFolder = $"~/Uploads/{ACL.UserNameRaw(skin.UserId)}/SkinFiles"; string screenshotFolder = $"~/Uploads/{ACL.UserNameRaw(skin.UserId)}/Screenshots"; diff --git a/Project-Unite/Models/Skin.cs b/Project-Unite/Models/Skin.cs index b860518..521fc54 100644 --- a/Project-Unite/Models/Skin.cs +++ b/Project-Unite/Models/Skin.cs @@ -17,7 +17,7 @@ public class Skin public string DownloadUrl { get; set; } public string ScreenshotUrl { get; set; } public DateTime PostedAt { get; set; } - + public string Keywords { get; set; } public Like[] Likes { get @@ -57,6 +57,8 @@ public class CreateSkinViewModel [MinLength(5, ErrorMessage = "You need to supply a valuable title.")] public string Title { get; set; } + public string Keywords { get; set; } + [Required] [MaxLength(500, ErrorMessage ="Your short description may not contain more than 500 characters.")] public string ShortDescription { get; set; } diff --git a/Project-Unite/Views/Shared/_Layout.cshtml b/Project-Unite/Views/Shared/_Layout.cshtml index 353b7b3..3a1430d 100644 --- a/Project-Unite/Views/Shared/_Layout.cshtml +++ b/Project-Unite/Views/Shared/_Layout.cshtml @@ -27,7 +27,15 @@ @RenderSection("scripts", required: false) + @ViewBag.Title • ShiftOS + + + + + + + @Styles.Render("~/Content/css") @Styles.Render("~/Content/bootstrap-theme.css") @Styles.Render("~/Content/Site.css") diff --git a/Project-Unite/Views/Skins/ViewSkin.cshtml b/Project-Unite/Views/Skins/ViewSkin.cshtml index 996d02e..96dd541 100644 --- a/Project-Unite/Views/Skins/ViewSkin.cshtml +++ b/Project-Unite/Views/Skins/ViewSkin.cshtml @@ -1,6 +1,8 @@ @model Project_Unite.Models.Skin @{ ViewBag.Title = Model.Name + " - Skin Repository"; + ViewBag.Description = Model.ShortDescription; + ViewBag.Keywords = "shiftos, shift, shifting, shifted, shifter, " + Model.Keywords; }

@Model.Name