Results tagged “movabletype” from Appleseed BlogSomething unexpected I just learned: to many, it's now considered best-practice to use hyphens ( - ) instead of underscores ( _ ) when separating words in URLs. For example, instead of this:
You'd be better off doing this:
Why? Simple: Google recommends it. According to Matt Cutts, the big G will do a better job recognizing and indexing the words in your URL if you separate them with hyphens. This has everything to do with search engine optimization (SEO), a term I tend to shy away from, what with its coming from the sinister realm of marketing versus the practical software architecture tack that I try to stick with. Sometimes the paths cross unexpectedly, though. For me, this happened most recently as I set up a new Movable Type (4.23) instance for a client. I was surprised to find that, by default, it enforced that all files it created use dashes in their names instead of underscores. Googling on this topic led me to discussions from people asking how to get MT to use dashes in its filenames instead of underscores - the exact opposite of what I sought, but I was intrigued that so many should care. A little more searching led to this post on Google Inside, as well as the articles I linked to above. I always approach the notion of work-pattern changes due to Google Fiat with a bit of skepticism, but this one's apparently settled into place globally over the last few years without my really noticing. Interesting, anyway. Though I wrote the first entry two days ago, I didn't link the blog into the site until just now. Setting it up proved to be a slightly more interesting task than I had bargained for. The blog runs on Movable Type, my favorite blogging software. (It currently plays second banana to Wordpress in the global blog-infrastructure popularity contest, but it's one hundred percent Perl, and therefore I'm much more comfortable with bending it into the shape I need.) Usually, an MT site runs as an entirely self-contained creature, using its very own templating toolkit and CSS-based styling system to define its look and functionality. However, I wanted it to look exactly like the rest of my site, which uses the Mason templating system, as well as perfectly good CSS that I already had lying around. I decided to solve this problem by having Movable Type output Mason's templating tags as needed, so that the pages it created would pull from the same HTML and CSS files that the rest of the site uses. Most of the pages on a Movable Type site are static files constructed from templates, so it wasn't difficult to customize these templates to output Mason tags. This is how, for example, the blog's own sidebar content appears as part of the usual appleseed-sc.com sidebar on the right, underneath Appleseed's contact information. That's pretty neat. This page on the Mason HQ wiki provided some good advice. However, in two spots visible to the blog's end-users - writing comments, and searching on tag names - MT runs CGI scripts to produce on-the-fly page content. Figuring out how to work that into my Mason templates was quite a chore, and took the better part of a day. But in doing so, I ended up learning a great deal about Movable Type, Mason, and Perl's API into Apache 2. The short answer is that instead of calling the CGI script directly, the site makes a separate HTTP request to it, captures the output, runs it through the Mason interpreter, and then presents that to you. It must also quietly pass It was a sufficiently interesting and illuminating task that I allowed myself to keep slogging at it until it was done, even though it was entirely unbillable labor. But (with coaching from my friend and fellow expert Andy Turner) it's done now. Back to work! (Minor note: to my chagrin, Movable Type's comment form uses different 0
|
|