Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

DanTup's ASP.NET MVC / Razor Blog Engine

This is the source code for the new version of blog, being written in ASP.NET MVC. The latest version of the code can always be found at code.dantup.com/blog.

At the time of writing, my blog is hosted on Google App Engine, which was written as an excercise in learning Python and a little about GAE. As my main skills are in .NET, it seemed a good idea to rewrite the blog using some new technologies to take advantage of this, including:

I'm sharing the code in the hope that it might be useful to others. I learned most of what I know from the online community, so sharing most of my source code online is an attempt to try and give a little back to others that are learning too. Hopefully, you should be able to run this project without any configuration. Just check the code out, open the solution, and press F5! As long as you have IIS Express installed, it should automatically:

  • Download dependencies from NuGet during compilation (to avoid bloating the repo with multiple versions of binaries)
  • Start up IIS Express (you may be prompted to allow it to configure port 50000 to point at the project)
  • Create a SQL CE database file in the App_Data folder (to avoid requiring SQL or SQL Express)
  • Populate the SQL CE database with test data

The blog should be fully-functional without any configuration. If this is not the case, please let me know so I can fix it! You can contact me through BitBucket or my blog.

The new site will be hosted at AppHarbor, which seems to the closest thing to Google App Engine for small ASP.NET apps (Azure seems overkill, and isn't free for tiny apps).

Code pushed to this repository will always be running at dev.dantup.com for testing. Once I've reproduced enough functionality from the GAE version, my live blog blog.dantup.com will be moved over to it.

Web.config Settings

BlogAuthor

The name of the author of the blog. Used in places such as the Feed author tags.

BlogAuthorEmail

The email address of the author. If provided, this will add an "Email Me" button to the sidebar.

BlogAuthorTwitter

The twitter username of the author. If provided, this will add a Twitter button to the sidebar.

BlogAuthorSites

A comma-separated list of sites owned by the author, used to output link rel=me tags. Note: Comma-sep is nasty, hoping for this to be moved to proper strongly-typed settings in the future if AppHarbor adds support (please vote for this here: http://feedback.appharbor.com/forums/95687-general/suggestions/1855625-add-the-ability-to-specify-web-config-transformati)

OpenIDProvider and OpenIDLocalID

Used to allow you to use your blog URL as an Open ID identifier.

BlogTitle and BlogTagline

The title and tagline used in the blog header. BlogTitle also appears at the end of page titles (eg. "{pagename} - {blogtitle}").

BlogFooter

This is shown at the foot of the page. NOTE: This is Markdown to allow for hyperlinks etc.

PostFooter

This is shown at the foot of the each post in the blog. NOTE: This is Markdown to allow for hyperlinks etc. and has the feed url appended so that it is usable in the Footer, eg.:

If you found this article interesting, why not [subscribe to my feed][feedurl]? This is a valid PostFooter, and the link named "feedurl" will be added automatically.

FeedPostFooter

This is shown at the foot of the each post in the feed. NOTE: This is Markdown to allow for hyperlinks etc. and has the post url appended so that it is usable in the Footer, eg.:

This post was served up via my RSS feed. Please [visit the original article][posturl] to read/post comments. This is a valid FeedPostFooter, and the link named "posturl" will be added automatically.

DatabaseHost, DatabaseName, DatabaseUsername, DatabasePassword

SQL Server database credentials. If DatabaseHost or DatabaseName are not provided, SQL CE will be used. If DatabaseUsername or DatabasePassword are not provided, integrated security will be used.

AllowCreateDatabase

Boolean to control whether the database will automatically be created if it doesn't exist. This won't work on AppHarbor, as you're unable to create databases.

BlockRobots

Defaults to False. Set to True if you want to serve a robots.txt to block all robots. This is useful on dev/staging sites (such as http://dev.dantup.com/, which has this value set to True in the AppHarbor control panel to avoid being indexed by search engines as it has duplicate content from my live blog).

GoogleAnalyticsID

Defaults to empty. If set, Google Analytics code will be output in the footer of the page using this tracking ID.

FeedBurnerUrl

Defaults to empty. If set, all lnks to the RSS Feed will go here instead of /feed. Also, any requests to /feed will be redirected here unless the user agent contains "feedburner".

GoogleValidation

Validation token for Google services that require a meta tag to be inserted in your site.

BingValidation

Validation token for Bing services that require a meta tag to be inserted in your site.

Updates

If you want notification of when new changes are pushed to this code, you have a few options:

Recent activity

Danny Tuppeny

Commits by Danny Tuppeny were pushed to DanTup/DanTup Blog

c217649 - Removed some crap from the build event that seems to have been used by SqlCompact that's bust with the upgrade
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.