Weblog UI and slugs

In my Perfect Weblog System (which has a great resemblance to Anne’s), the slug would be automatically generated from the title using (client-side) javascript. If the slug was changed on its own, whatever handler was causing the updating would be removed. If the slug field was cleared completely, the handler would be replaced, and it would go back to being based on the title.

Why? Because I don’t like having to think about slugs. And normally the title or something auto-generated on it is good enough, it’s just for those posts with really long or punctuation-intensive titles that that breaks down. But that’s often enough that I have to think about it every time (or, sometimes, not). So this is one of those little gradual enhancements using javascript you keep hearing about.

Actually, perhaps this isn’t part of the Perfect Weblog System, but rather the Perfect Weblog System’s UI. Anyway.

Edit: Via choan in the comments, it exists! Thank you! But shouldn’t you be using UTF-8? ;)

7 Responses to “Weblog UI and slugs”

  1. Paul Goscicki says:

    I suppose cooking up a greasemonkey script that does that for a WordPress advanced edit UI is a matter of 5-7 lines (and less than 5 minutes for experienced js coder). I’m sure someone will write it, because it’s quite neat idea.

    Typing slugs by hand works for me, though.

  2. choan says:

    I suppose cooking up a greasemonkey script [...]

    Cooked. Unfortunately my server is down at the moment, so I cannot show it, but it’s working for me.

    I’ll made it publicly available as soon as my server goes up again.

  3. choan says:

    Well, my server’s back, so here’s the script. It works as an Opera user script too.

    Please, feel free to improve it.

  4. choan says:

    Via choan in the comments, it exists! Thank you! But shouldn’t you be using UTF-8? ;)

    Yes, I should and I’d really like to do it because, obviously, it’s simpler to use ñ than \u00F1. But reallity kicked my ass while developing the script: Opera won’t do the replacements for accented chars whatever encoding I use.

    So, I decided to take the \u#### route. As the rest of the script uses only ASCII characters, it seems as the encoding doesn’t matter.

  5. dolphinling says:

    I mean that your name and the try that didn’t work are in ISO-8859-1 and there’s no character encoding sent. I don’t know if this is a something you forgot to set or a bug in Apache because I see the rest of your site is in UTF-8.

    P.S.: Your blog is in spanish, so I can’t read all of it (took 4 years in middle/high school but stopped last year), but it has a cat at the top, so I approve. :-)

  6. choan says:

    [...] there’s no character encoding sent

    No, it’s not a bug, it’s a misconfiguration. I’ll try to solve it as soon as possible. Anyway, seen the problem with Opera, it seems mandatory to use the escaped characters.

    By the way, what’s the matter with apostrophes in these comments?

    PS: I love cats —and women, but the blog doesn’t have any of them (women) at the moment ;)

  7. Douglas F Shearer says:

    Nice blog post, gave me some good ideas while deciding in which direction to take the slug generation in my own publishing application.