SEO tweaks, Version Meta support

refactor-intermediate-models
Thomas Hounsell 2015-02-09 15:15:12 +00:00
parent 8f832a68e9
commit 476bce6bb2
7 changed files with 48 additions and 1 deletions

View File

@ -24,6 +24,7 @@ namespace BuildFeed.Areas.admin.Controllers
{
CurrentItems = from i in MetaItem.Select()
group i by i.Id.Type into b
orderby b.Key.ToString()
select b,
NewItems = from i in (from l in MetaItem.SelectUnusedLabs()
@ -34,8 +35,17 @@ namespace BuildFeed.Areas.admin.Controllers
Type = MetaType.Lab,
Value = l
}
})
}).Concat(from v in MetaItem.SelectUnusedVersions()
select new MetaItem()
{
Id = new MetaItemKey()
{
Type = MetaType.Version,
Value = v
}
})
group i by i.Id.Type into b
orderby b.Key.ToString()
select b
});
}

4
BingSiteAuth.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0"?>
<users>
<user>77FAD24B9B2579631630796D246267C3</user>
</users>

View File

@ -209,6 +209,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="BingSiteAuth.xml" />
<Content Include="browserconfig.xml" />
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
@ -223,6 +224,7 @@
<Content Include="Areas\admin\Views\users\admins.cshtml" />
<Content Include="Areas\admin\Views\meta\index.cshtml" />
<Content Include="Areas\admin\Views\meta\create.cshtml" />
<Content Include="yandex_702baad42b020be7.html" />
<None Include="Properties\PublishProfiles\Milestone 1 FTP.pubxml" />
<Content Include="googleacffc6da14c53e15.html" />
<Content Include="content\tile\large.png" />

View File

@ -331,5 +331,10 @@ namespace BuildFeed.Models
{
public byte Major { get; set; }
public byte Minor { get; set; }
public override string ToString()
{
return string.Format("{0}.{1}", Major, Minor);
}
}
}

View File

@ -79,6 +79,25 @@ namespace BuildFeed.Models
}
}
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static IEnumerable<string> SelectUnusedVersions()
{
using (RedisClient rClient = new RedisClient(DatabaseConfig.Host, DatabaseConfig.Port, db: DatabaseConfig.Database))
{
var client = rClient.As<MetaItem>();
var versions = Build.SelectBuildVersions();
var usedLabs = from u in client.GetAll()
where u.Id.Type == MetaType.Version
select u;
return from v in versions
where !usedLabs.Any(ul => ul.Id.Value == v.ToString())
select v.ToString();
}
}
[DataObjectMethod(DataObjectMethodType.Insert, true)]
public static void Insert(MetaItem item)
{

View File

@ -82,6 +82,8 @@
{
<h3>About</h3>
@Html.Raw(ViewBag.MetaItem.PageContent)
<h3>Share</h3>
<div class="addthis_sharing_toolbox"></div>
<h3>Listing</h3>
}
<ul class="list-unstyled">
@ -204,4 +206,5 @@
<p class="list-group-item-text">{{:Group}}</p>
</a>
</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5431719a661cbfd0" async="async"></script>
}

View File

@ -0,0 +1,4 @@
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
<body>Verification: 702baad42b020be7</body>
</html>