| Comments

As I patiently awaited, here’s what was presented to my browser:

Build successful image

I’ve made my first official “commit” to an open source project that I didn’t start.  I feel good.  I feel like cracking open a Mt. Dew and going crazy.  Honestly though it does feel good (and fun). 

My blog engine I use is .  It’s the blog engine I’ve used almost exclusively (I actually started with .Text before scottw sold out went to Telligent to make Community Server.  I kid of course, Scott is a great guy, and very smart.  But when .Text was seemingly going to get stale, others stepped in.  Notably Phil Haack started Subtext which was an initial fork of .Text.  I’ve used it ever since and haven’t looked back.

SubText logoSubtext has a great community of developers that communicate regularly, share ideas, get feedback…all the things you’d expect out of an OSS project but don’t always get.  As I mentioned this was the first project I really got dirty in that wasn’t mine in the OSS world.  Over the past year or so I’ve been giving feedback, making some modifications to fit my needs, etc. but hadn’t really contributed much literally beyond “you guys should do this” comments.  Most of that was because of time and because I had fixed things for my own needs.

Until today.  This past week I had been submitting patches to the team with feedback and things that I really felt valuable and used in my custom build.  Yesterday I got an email from Phil asking if I wanted commit rights to the SVN repository.  I admitted my nervousness, but he let me in anyway :-).  I have to admit that the image above wasn’t the first one I received :-).  I was quickly met after my first commit with a failed build.

Sunofa...I broke the build.  Well, I will go to my grave saying that I didn’t, but something did.  I believe the popular thing is to blame Vista…so I do that too.

At any rate, with some hand holding I figured out the error of my way (had one file wrong) and got my changes into Subtext 2.0 trunk.  I'm really excited to be a part of this community with Subext even on the smallest scale compared to all the others who do the real work.  I'd encourage you all to find an OSS project and help out...with feedback and resolutions.

I'm not sure when my stuff will make it into the next Subtext build for release but I've previously written about what modifications I've made, but here's what I committed today:

    • Enhanced MetaWeblog API implementation to support providing a "slug" URL name for the post.  This gives the user the option to use the default URL naming, the "auto-friendly" or now to override that with your own slug name.
    • Fixed a bug in the SiteMap handler for blogs not hosted at root domains.  Would love people to test this out.
    • Added support for WordPress API functions of: newPage, editPage, getPages, newCategory
    • Simple modification to the Windows Live Writer manifest to prevent those who think they can future post :-)
    • Tag-based RSS syndicator

In all honest, most of my submissions were self-motivated.  I think that is really what starts getting people involved in OSS projects...not an interest, but selfishness.  All the changes I made are there to make Subtext+Live Writer the best experience it can be.  With the WordPress API implementation you can now create new "pages" in Writer that are Articles in Subtext.  It also supports adding new categories on the fly within the API.  It may not affect many who use Subtext, but I was happy to contribute and hopefully add some small value to the project!

Related Post:

| Comments

This blog runs on SubText.  I heart SubText.  I know there are others out there but for me SubText has met most of my needs.  And when it hasn’t I modify it.  Which brings me to this post.  There was a thread on an email list I belong to about Windows Live Writer (I heart Live Writer too :-)) and categories (adding new categories on the fly).  This got me to crack open the source and hunt.  Alas, there was no support for this.  I’ve been ranting about WordPress API support for SubText on the developer list and I think if I rant one more time it will probably get assigned to me.  Please keep in mind that my modifications were solely intended to make Live Writer the best tool for me…these are targeted at Live Writer functionality and may/may not add value to other areas of functionality.  So on with the show…

The Slug

One of the features in SubText is the ability to auto generate URLs based on the title of the blog post.  Well, I didn’t like that.  I usually want my URLs to be a slight derivative of the URL.  My workflow, then, has been to post as draft, go to the web interface, change and then enable the syndication.  I am sick of doing that.  So let’s start with that first.  You see in blog terms the end part of your URL in called a “slug.”  SubText calls this a ‘friendly url’ and other engines may call it something else.  Here I’m going to call it a slug.  My colleague Jason Mauer has a custom blog engine he uses where he’s implemented almost every blogging API in his set.  I’ve been geekly jealous of his API for some time…now it is time to change that.

I’m not going to go into the philosophical reasons why I want a different URL slug and why I want different ones.  We can debate that over a Mt. Dew some time if you’d like.

SubText uses the MetaWeblog API by default.  The developers chose to implement the spec of MetaWeblog (as they should have) and thus the slug is not a part of the newPost spec and the Post struct used to identify the structure of a post.  So my modification was a few steps.  If you are familiar with the latest source (1.9.5b) of SubText, I’ll be referring to line numbers in there.  First, I had to modify that Post struct for the MetaWeblogAPI implementation.  Now some may shirk that this is a no-no…and I might agree…so if modifying something that isn’t going to conform to a spec that really isn’t full anymore, then move along.  I modified about line 63 and added the following:

public string wp_slug;

I actually could have used wp_slug or mt_basename, both of which mean the same thing and both of which are sent to the API by Live Writer…so I just picked one.  Now my struct has the information when it passes it along for creation/edit of the post via Live Writer.

The next step was to modify the implementation of the post.  In MetaWeblog.cs at about line 234 I added:

if (!string.IsNullOrEmpty(post.wp_slug))
    entry.EntryName = post.wp_slug;

I also added this to the editPost method to ensure compatibility on edit.

The final step was to modify my wlwmanifest.xml file to announce to Live Writer that I now support this feature.  This is done by adding to the <options> node of this manifest:


Then do a refresh of the account settings in Live Writer.  When you do that, in a new post click the little ‘up’ arrow just underneath the editing area and you should now see a Slug field:

Now I don’t have to post a draft and login to change!

New Categories

The thread actually started with wanting to create new categories during a post.  SubText is one of the engines that doesn’t expose this API directly just yet, so some altering had to be done.  Here’s what I did.  I chose to mirror the WordPress newCategory method to do this. 

First I added IWordPressApi.cs to Subtext.Framework.XmlRpc.  The complete code within it is:

using System;
using CookComputing.XmlRpc;

namespace Subtext.Framework.XmlRpc

    public struct WordpressCategory
        public string name;

    public interface IWordPressApi
            Description = "Adds a new category to the blog engine.")]
        int newCategory(
          string blogid,
          string username,
          string password,
          WordpressCategory category);

I then went into MetaWeblog.cs and implemented that interface with:

public int newCategory(string blogid, string username, string password, WordpressCategory category)
    LinkCategory newCategory = new LinkCategory();
    newCategory.CategoryType = CategoryType.PostCollection;
    newCategory.Title = category.name;
    newCategory.IsActive = true;
    newCategory.Description = category.name;

    newCategory.Id = Links.CreateLinkCategory(newCategory);

    return newCategory.Id;

I chose to ignore the slug/description fields (again, thus ignoring the spec which isn’t ideal) at this time, partly because I was getting errors and partly because I decided that I didn’t need them anyway.  I don’t use the description field in categories in SubText, so I just set the description to also be the title.  I also had to modify the wlwmanifest.xml file with:


and refresh my Live Writer account profile to pick up the changes.  The result is now my category options in Live Writer include an “add” feature:

Done with both of those.

Future Posting

This is something I started to look at and added the information to the MetaWeblog API, but it seems that SubText doesn’t filter out future posts in the UI – or at least my quick scan didn’t reveal it did.  I’ve moved on away from this one since I don’t future post right now, but I’ll come back to it in a while.  What I did do, however, to prevent me from thinking SubText supported this was modify my wlwmanifest.xml file to include this definition in the options:


This way at least if the idiot in me *thinks* I can do it, Live Writer will warn me.

So that’s it!  These little adjustments make my Live Writer + SubText experience AWESOME.  Live Writer truly is one of the best tools Microsoft puts out (aside from Silverlight of course).  I’m going to submit these modifications to the SubText team and see what sticks.  I assume none will since they are admittedly partial.  But I’ve been suggesting on the dev list that SubText expose a WordPress API and I have a feeling I’ll need to start working on that for the team.

Hope this helps some of you!

| Comments

beta 2 of windows live writer was released today.  go get it.  improved user interface, improved blog support, some new functions...you know all the good stuff you want in an update.  oh yeah and continued extensibility.

i took a quick second (after doing a little RTFM'ing [thanks charles]) and uploaded a custom manifest to my blog.  why?  because when in writer sometimes i want quick access to things about my blog (stats and such).  so i took a minute to "subtext"-ize a sidebar extension to writer...see:

i've got the nice little transparent subtext icon in the back and two custom buttons taking me to my various stats.  additionally, a link directly to the admin functionality.  i'll be playing around more with this stuff later.

| Comments

the first night of mix yielded a few pre-parties.  i first went to the regional director dinner event, where we were able to chat with a few who happen to be at mix this year.  of particular note is from .  they are demonstrating (and you can see it/download the source) a really slick wpf application called which is essentially a visualization tool for family history information...very cool, check it out.

after that (and actually a little bit before) i went to the mashup day area (which will be going on as well monday night stay tuned for more on that).  after that i headed to the 'bloggerzone' -- which i'm pretty sure is basically one of the channel 9 guys' suite room that was opened up to host a party for bloggers.  a little crackdown, a little guitar hero, breakfast food (?), and some great conversations around how amazon s3 has saved certain companies money, etc.

i had a chance to finally meet .  what?! name doesn't ring a bell?  well, this blog here is hosted on the platform.  Subtext is a fork of the .Text engine.  phil was the man that started the movement and what has become one of the more active open source microsoft platform projects (there are others, but i think Subtext needs some creds here as well).  i recorded a part of my conversation with phil which you can hear on my *cast link (or direct here).  he's a great guy and has a good suggestion for microsoft at the end of the conversation.

more to come from mix07!

| Comments

after recently finding out about sites, i wanted to cut my teeth a bit more and learn some css by just reading them...so i figure i would adapt a few designs for (my blog engine).  i've created three subtext skins based on designs...you can see the screenshots of them at this flickr photostream.

i adapted three designs: minty, greenway, and metic.  the only requirement to using them is that the footer credits stay in place.  these designs use the creative commons attribution licenses, so please give the original authors credit and honor that license.  i've zipped them up individually and you can get the files below on this post. UPDATE: also available at www.subtextskins.com as of now.

each skin has a "Styles" folder with the name of a stylesheet matching the skin name...i.e., "minty-main.css" so to add then to your subtext admin/skins.config file you'll want to add (using greenway as a sample here):

<SkinTemplate Name="Greenway" TemplateFolder="greenway">
    <Style href="Styles/greenway-main.css"/>

for each skin you want to add -- just ensure the folder does exist in the skins directory.  hope you like -- they are very basic...maybe phil will include them in the next drop.

File: Greenway
File: Metic
File: Minty