I'm Going to Write My Own Blog Engine
I have a site or two that I want to add News and/or Articles to. I basically want to add a Blog to the site. However, I don't want the user to have to leave the rest of the site to go to the "blog" page(s). I want to be able to put the blog on a portion of some of the pages of the site and if the user links into one of the articles, I want the article page to look just like the rest of the site -- with the same navigation and everything.
I've decided to write my own blog engine to accomplish this. I'll be building it with .NET, since I do most of my sites and programming with .NET. I figure the main things it has to do are as follows:
- have some kind of interface to accept a new post (by me only to start with) -- at first this might be a very manual process until I develop a nicer admin page type interface later
- be able to save/persist the content of the post to include a headline, the body of the post, some information about the poster and possibly images referenced in the post. It will have to allow some html tags such as bold (<b>) tags, hyperlinks, and img tags. I'll save this information into a database rather than files.
- create a URL for each post (a permalink). Rather than create an actual file for each post and naming the file based on the headline, I'll probably just have a convention like: "Article.aspx?id=312", where the id value is the unique identifier for the particular article. Later I might create a dummy name for the post based on the headline and store that in the database with the article. Then I might create something called an HttpModule that will be able to translate the post name back into the id value and correctly redirect from "site/Articles/sample_headline" to "site/Article.aspx?id=312".
- update the rss xml file(s) for each new article posted. I'll just view the source xml of some blogs and decide what parts are really necessary. I noticed that my vox blog has a "summary" feed and a "complete" feed. The summary feed has thumbnail versions of the images and only the first sentence or two of content.
- eventually allow people to post comments. This isn't a top priority for me, but I do plan on adding this feature. I'll probably only accept comments from registered users and then just save the comment in the database linked to the article and their user record.
- allow people to easily subscribe to the blog. If you view the source of my vox blog, you'll see several link tags that refer to syndication files for the blog. My guess is that containing a similar link in the main page will include the rss icon for the page in most current browsers.:
<link rel="alternate" type="application/atom+xml" href="http://jakekerber.vox.com/library/posts/atom-full.xml" title="Full Atom Feed for Posts" />
<link rel="alternate" type="application/rss+xml" href="http://jakekerber.vox.com/library/posts/rss.xml" title="RSS Feed for Posts" />
<link rel="alternate" type="application/rss+xml" href="http://jakekerber.vox.com/library/posts/rss-full.xml" title="Full RSS Feed for Posts" />
After some searching, I found a post about creating a blog engine using some new features of ASP.NET. I probably won't do it quite the way the author of the article went about it, but this might be a good reference. The site, aspalliance.com seems to have a lot of articles for .NET developers.
Something else I found was BlogEngine at CodePlex.com. They have the complete source code you can download, so I might take a look at some of the things they've done to get some tips, too.
Hopefully I'll have something ready to use in a couple weeks. I do NOT plan on releasing this to the public (either for free or for sale). It will be very custom and will be integrated into some of my other code. It would probably cost significant additional effort on my part to make it generic enough for it to be useful to anyone else. But anything's possible and I won't completely rule out the possibility of having something to distribute (full of disclaimers, though). ;)
Comments