Skip to content

Commit

Permalink
inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
phillip-haydon committed May 1, 2013
0 parents commit d7205ae
Show file tree
Hide file tree
Showing 94 changed files with 9,677 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -crlf
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
*.[Cc]ache
*.csproj.user
*.[Rr]e[Ss]harper*
*.sln.cache
*.suo
*.user
*.orig
*.pidb
*.userprefs
AssemblyInfo.cs
.DS_Store
deploy/
build/
[Bb]in/
[Dd]ebug/
[Oo]bj/
[Rr]elease/
_[Rr]e[Ss]harper.*/
*.docstates
*.tss
*.ncrunchproject
*.ncrunchsolution
*.dotCover
Thumbs.db
.idea
Website/
packages/
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Sandra.Snow

Sandra.Snow is a Jekyll inspired static site generation tool that can be setup with Azure to build your site when your repository changes.

## Notes

This is the initial commit which contains a very very rough messy cut of code that works against my current blog which runs on Github pages using Jekyll.

Included is 'SnowSite' which Visual Studio will build against and generate a Website folder containing all of the compiled site.

The code contains a lot of hard-coded values, duplication, clutter, etc. It's basically a hacked together solution that I got up and running and now that I've put this on Github I intend to refactor it and make this more usable for everyone.

Feel free to help out!

<https://vimeo.com/65055971>

This video shows a really rough showcase of setting up an Azure website and deploying the website which gets compiled.

To get the F5 build working you will need to open up the project properties, and change the Debug command line arguments to specify the root directory of the SnowSite folder.
2 changes: 2 additions & 0 deletions SnowSite/.deployment
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[config]
command = deploy.cmd
Empty file.
138 changes: 138 additions & 0 deletions SnowSite/Snow/_layouts/default.sshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>philliphaydon.com</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css" />
</head>
<body class="home blog">
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<hgroup>
<h1 class="site-title"><a href="/" title="philliphaydon.com" rel="home">philliphaydon.com</a></h1>
<h2><small>Works on my PC...</small></h2>
<h2 class="site-description">Pleb from New Zealand who was banished overseas and currently resides in Singapore.</h2>
</hgroup>
<nav role="navigation" class="site-navigation main-navigation">
<h1 class="assistive-text">Menu</h1>
<div class="assistive-text skip-link"><a href="#content" title="Skip to content">Skip to content</a></div>
<div class="menu">
<ul>
<li><a href="/about">About</a></li>
<li><a href="/category">Categories</a></li>
</ul>
</div>
</nav>
</header>
<div id="main">
<div id="primary" class="site-content">
<div id="content" role="main">
@Section['content'];
</div>
<!-- #content -->
</div>
<!-- #primary .site-content -->

<div id="secondary" class="widget-area" role="complementary">
<aside id="text-5" class="widget widget_text">
<h1 class="widget-title">Follow</h1>
<div class="textwidget">
<a href="https://twitter.com/philliphaydon" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://twitter.com']);"><img src="/stylesheets/images/twitter.png"></a>
<a href="http://stackoverflow.com/users/456813/phill" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://stackoverflow.com']);"><img src="/stylesheets/images/stackoverflow.png"></a>
<a href="http://www.linkedin.com/in/philliphaydon" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://www.linkedin.com']);"><img src="/stylesheets/images/linkedin.png"></a>
<a href="https://plus.google.com/u/0/111751877537461442095" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://plus.google.com']);"><img src="/stylesheets/images/googleplus.png"></a><br />
<a href="https://github.com/phillip-haydon" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://github.com']);">Github</a><br />
<a href="http://www.codeschool.com/users/philliphaydon" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://codeschool.com']);">CodeSchool</a><br />
<a href="http://www.kickstarter.com/profile/phillip-haydon" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://kickstarter.com']);">KickStarter</a>
</div>
<a href="http://stackoverflow.com/users/456813/phill">
<img src="http://stackoverflow.com/users/flair/456813.png" width="208" height="58" alt="profile for Phill at Stack Overflow, Q&amp;A for professional and enthusiast programmers" title="profile for Phill at Stack Overflow, Q&amp;A for professional and enthusiast programmers">
</a>

<a href="http://nancyfx.org/mvm.html"><img src="/stylesheets/images/mvm.png"></a>

<div id = "clustrback" style="width:162px; height:133px; background:#f7f7f7 url(http://clustrmaps.com/admin/3d/images/st4_grey.png) center no-repeat; text-align:center;">
<a href="http://www2.clustrmaps.com/counter/maps.php?url=http://www.philliphaydon.com/" style="width:160px; display:block; margin:0 auto;" id="clustrMapsLink">
<img src="http://www2.clustrmaps.com/counter/index2.php?url=http://www.philliphaydon.com/" style="border:0px; margin:15px auto;margin:15px auto;" alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg" />
</a>
</div>
</aside>
<!--aside id="text-8" class="widget widget_text">
<h1 class="widget-title">Other sites</h1>
<div class="textwidget">
<a href="http://csharptube.com/" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://csharptube.com']);">csharptube.com</a><br />
<a href="http://thisisparrot.com/" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://thisisparrot.com']);">Parrot</a><br />
<a href="http://shitprogrammerswrite.com/" onclick="javascript:_gaq.push(['_trackEvent','outbound-widget','http://shitprogrammerswrite.com']);">Shit programmers write</a><br />
</div>
</aside-->
<aside id="linkcat-6" class="widget widget_links">
<h1 class="widget-title">Other Blogs</h1>
<ul class='xoxo blogroll'>
<li><a href="http://www.nickharris.net/" target="_top" onclick="javascript:_gaq.push(['_trackEvent','outbound-blogroll','http://nickharris.net/']);">Nick Harris</a></li>
<li><a href="http://www.mindscapehq.com/blog/" target="_top" onclick="javascript:_gaq.push(['_trackEvent','outbound-blogroll','http://www.mindscapehq.com/blog/']);">Mindscape</a></li>
<li><a href="http://blog.orangelightning.co.uk/" target="" onclick="javascript:_gaq.push(['_trackEvent','outbound-blogroll','http://blog.orangelightning.co.uk/']);">Phil Jones</a></li>
<li><a href="http://buildstarted.com/" target="" onclick="javascript:_gaq.push(['_trackEvent','outbound-blogroll','http://buildstarted.com']);">Ben Dornis</a></li>
<li><a href="http://jflood.net/" target="" onclick="javascript:_gaq.push(['_trackEvent','outbound-blogroll','http://jflood.net/']);">Jospeh Flood</a></li>
</ul>

</aside>
<!--aside id="archives-4" class="widget widget_archive">
<h1 class="widget-title">Archive</h1>
{% assign year = '2015' %}
{% assign month = 'December' %}

<ul class="posts">
{% for post in site.posts %}
{% capture postmonth %}{{ post.date | date: "%B" }}{% endcapture %}
<!-/- {{ postmonth }} {{ month }} -/->
{% if postmonth != month %}
{% assign month = postmonth %}
<li><a href='/archive#{{ post.date | date: "%Y" }}{{ month }}'>{{ month }} {{ post.date | date: "%Y" }}</a></li>
{% endif %}
{% endfor %}
</ul>
</aside-->
</div>
<!-- #secondary .widget-area -->


</div>
<!-- #main -->

<footer id="colophon" class="site-footer" role="contentinfo">
<div class="site-info">
Powered by Sandra.Snow
</div>
<!-- .site-info -->
</footer>
<!-- #colophon .site-footer -->
</div>
<!-- #page .hfeed .site -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src='/javascripts/prettify.js' type='text/javascript'></script>
<!--script src='http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js' type='text/javascript'></script-->
<script type='text/javascript'>
$(function () {
$("pre code").parent().each(function () {
if (!$(this).hasClass("prettyprint")) {
$(this).addClass("prettyprint");
a = true
}
});

prettyPrint();
});

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-655975-13']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
10 changes: 10 additions & 0 deletions SnowSite/Snow/_layouts/post.sshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@Master['default.sshtml']
@Section['content']

<div id="post">
<h1>@Model.Title</h1>

@Model.PostContent
</div>

@EndSection
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
layout: post
title: MVC Routing with Attributes makes routing awesome
category: ASP.NET MVC
---

I evaluated HEAPS of code/libraries and threw in the towel and decided that getting lower-case routes, while still having Area's, was a complete and utter waste of time and effort because they were all crappy, and broke stuff, or didn't work.

That was until my mate Brad grabbed [AttributeRouting](https://github.com/mccalltd/AttributeRouting) from [Nuget](http://nuget.org/List/Packages/AttributeRouting). Oh well you know what, this is the best thing sliced bread.

First and foremost, it solved the number 1 issue I had with routing, lowercase Urls. This is how simple is it to make Routes lowercase.

routes.MapAttributeRoutes(config =>
{
config.UseLowercaseRoutes = true;
});

Wow... Yet you bing for lowercase routes, and you end up with strange solutions... Here's a couple.

<http://stackoverflow.com/questions/878578/how-can-i-have-lowercase-routes-in-asp-net-mvc>

This question links to:

<http://coderjournal.com/2008/03/force-mvc-route-url-lowercase/>

This breaks Area's, why? Because to handle an Area it appends `?Area=areaname` to the Url. FAIL. Probably worked great for MVC 1,but considering I've seen it linked in MVC 3 questions,I consider it fail.

<!--excerpt-->

<http://stackoverflow.com/questions/878578/how-can-i-have-lowercase-routes-in-asp-net-mvc/1731652#1731652>

Writing them in lowercase? Really?

Pass, I'll stick with AR, it's too simple, it's ridiculously simple. I love it!

The next thing I love, is that instead of writing Routes, and then writing `HttpGet` `HttpPost` on all the actions, I just have to write `GET` and `POST` on the actions, and even define the URL along with it, and bam, it's clear and explicit how you get to that action.

Such as:

[POST("Auth/Login")]
public ActionResult Login(LoginViewModel loginViewModel, string returnUrl)

It's obvious to me, that I can access this Action by navigating to www.mysite.com/auth/login

[GET("Content/{slug}")]
public ActionResult Index(string slug)

Page content can be accessed via www.mysite.com/content/my-slug

And when controllers are divided into Area's, I can just define the area with the controller class:

[RouteArea("Admin")]
public class HomeController : BaseController

I could define the namespace to use for Area's in the Area Registration, but it just seems... hacky... AR is definitely worth checking out.
Loading

0 comments on commit d7205ae

Please sign in to comment.