Apply SEO for ShiftOS skins

This commit is contained in:
Michael 2017-05-24 10:50:36 -04:00
parent c6788eac2c
commit c4a2dd41f0
4 changed files with 14 additions and 1 deletions

View file

@ -61,6 +61,7 @@ public ActionResult PostSkin(CreateSkinViewModel model)
skin.PostedAt = DateTime.Now; skin.PostedAt = DateTime.Now;
skin.FullDescription = model.LongDescription; skin.FullDescription = model.LongDescription;
skin.UserId = User.Identity.GetUserId(); skin.UserId = User.Identity.GetUserId();
skin.Keywords = model.Keywords;
skin.VersionId = ""; skin.VersionId = "";
string repoFolder = $"~/Uploads/{ACL.UserNameRaw(skin.UserId)}/SkinFiles"; string repoFolder = $"~/Uploads/{ACL.UserNameRaw(skin.UserId)}/SkinFiles";
string screenshotFolder = $"~/Uploads/{ACL.UserNameRaw(skin.UserId)}/Screenshots"; string screenshotFolder = $"~/Uploads/{ACL.UserNameRaw(skin.UserId)}/Screenshots";

View file

@ -17,7 +17,7 @@ public class Skin
public string DownloadUrl { get; set; } public string DownloadUrl { get; set; }
public string ScreenshotUrl { get; set; } public string ScreenshotUrl { get; set; }
public DateTime PostedAt { get; set; } public DateTime PostedAt { get; set; }
public string Keywords { get; set; }
public Like[] Likes public Like[] Likes
{ {
get get
@ -57,6 +57,8 @@ public class CreateSkinViewModel
[MinLength(5, ErrorMessage = "You need to supply a valuable title.")] [MinLength(5, ErrorMessage = "You need to supply a valuable title.")]
public string Title { get; set; } public string Title { get; set; }
public string Keywords { get; set; }
[Required] [Required]
[MaxLength(500, ErrorMessage ="Your short description may not contain more than 500 characters.")] [MaxLength(500, ErrorMessage ="Your short description may not contain more than 500 characters.")]
public string ShortDescription { get; set; } public string ShortDescription { get; set; }

View file

@ -27,7 +27,15 @@
<script src="@Url.Action("jquery.datetimepicker.js", "Scripts")"></script> <script src="@Url.Action("jquery.datetimepicker.js", "Scripts")"></script>
<link rel="stylesheet" href="~/Content/datetimepicker.css" /> <link rel="stylesheet" href="~/Content/datetimepicker.css" />
@RenderSection("scripts", required: false) @RenderSection("scripts", required: false)
<title>@ViewBag.Title &bull; ShiftOS</title> <title>@ViewBag.Title &bull; ShiftOS</title>
<meta name="description" content="@ViewBag.Description" />
<meta name="keywords" content="@Model.Keywords" />
<meta property="og:title" content="@ViewBag.Title" />
<meta property="og:description" content="@ViewBag.Description" />
@Styles.Render("~/Content/css") @Styles.Render("~/Content/css")
@Styles.Render("~/Content/bootstrap-theme.css") @Styles.Render("~/Content/bootstrap-theme.css")
@Styles.Render("~/Content/Site.css") @Styles.Render("~/Content/Site.css")

View file

@ -1,6 +1,8 @@
@model Project_Unite.Models.Skin @model Project_Unite.Models.Skin
@{ @{
ViewBag.Title = Model.Name + " - Skin Repository"; ViewBag.Title = Model.Name + " - Skin Repository";
ViewBag.Description = Model.ShortDescription;
ViewBag.Keywords = "shiftos, shift, shifting, shifted, shifter, " + Model.Keywords;
} }
<h2>@Model.Name</h2> <h2>@Model.Name</h2>