Title Junk

20 December 2010

John Gruber:

…a good rule of thumb for designing and writing page titles: pick a name (and, for CMS templates, a pattern) that makes sense as the name of a bookmark for that page. Most bookmarking tools — the ones built into web browsers, and bookmarklets for third-party apps — do use the page title as the default bookmark name. Tools that help people tweet links to articles use the page title as the default description. So make titles useful. Write them for humans, not search engine spiders. Putting SEO keywords in the page title (a) doesn’t actually help your page’s rank in search engine indexes, and (b) makes things harder for people trying to tweet a link, bookmark your page, or scan it from a list of currently open windows and tabs in their browser. Trust the Googlebot to figure it out.

Gruber hits the nail on the head here. SEO laden titles are a big burden to the user with little to no benefit to actual page rank. Your <title> should identify your content, not beg for page views, especially considering how prevalent sharing through services like Twitter and Facebook are these days.

Filed under: ,

Quick and Dirty Flatten Workflow

4 November 2010

Time for my monthly tiny-nugget-of-sort-of-useful-tech post.

I needed to turn a big folder of layered PhotoShop files into a big folder of flat .png files. I turned to Automator and ended up with a nice little service.

How to use:

1) Use a Mac

2) Download the .workflow file

3) Put in ~/Services/

4) Select the files in Finder, right click, and select “Flatten”

5) The service will ask you some questions.

Filed under: ,

target='_blank' in Textile

3 October 2010

I was trying to find a way to set target="_blank" in Textile. Turns out it’s not supported because target isn’t part of the XHTML spec, and for good reason. Real XHTML should only be concerned with the current window, not other windows, and the target attribute was originally meant for frames anyway. How do you open links in a new window, then? The answer is you really shouldn’t make that sort of decision for the user: they can always right click and “open in new tab” rather than having your site determine their browsing experience.

XHTML ideals and user experience arguments aside, I still needed an easy way to do this. This is pretty trivial (like my previous post) but it’s probably useful for someone looking for a quick solution like I was.

Do this in Textile:

"(newwindow)A link to Google":http://google.com

And throw this in your $(document).ready function (you’re using jQuery, right?):

$("a.newwindow").attr("target","_blank");

Filed under: ,

Serch

2 October 2010

I love Perch, a very small, easy, but deceptively powerful CMS. I've been using it on a couple of clients' sites and have loved it so far. It is commercial (costs around $50), but as happens frequently, the warm-kumbaya-free-love-open-source feeling you miss out on by using a commercial solution is replaced with a better experience:

I don't want to am not going to reluctantly will make this quick argument for closed source: most of the open source software (not just CMSs) I've used has sub par interface design and a bad user experience. I'm looking at you, Drupal.

Anyway, one of the several key things missing from Perch is site-wide search. I wrote a very (and I mean very) simple search engine plugin few lines of code to search through a Perch site and list out links to relevant pages and quick summary of that page's content. PHP, naturally. This is pretty hacky: it just pokes around in the database and lists out regions it finds that match the search given, with a link to the page the region was found on (excluding shared regions). Your mileage may vary.

I wrote this before Perch introduced apps, which may or may not make this obsolete. I haven't had time to look at what apps brings to the table to help with this.

I'm very interested in getting some feedback on this—I'd like to be able to parse out the title of the page somehow instead of just using the URL as the identifier of the page to the user, for instance—but I wanted to get it out there in case there's any Perchers Perchians Perchites Perch developers out there looking for a quick and dirty solution.

Without further adieu, I give you Serch (*snort*):


	// Serch
	// A really little search engine
	// Alex Ford, 2010
	// http://isseriousbusiness.com

	/* This program is free software. It comes without any warranty, to
	 * the extent permitted by applicable law. You can redistribute it
	 * and/or modify it under the terms of the Do What The Fuck You Want
	 * To Public License, Version 2, as published by Sam Hocevar. See
	 * http://sam.zoy.org/wtfpl/COPYING for more details. */


function serch($query) {

	$cleanQuery=mysql_escape_string($query);
	
	echo "";
	
	
	$SQL="SELECT * FROM perch_contentItems WHERE contentHTML LIKE '%".$cleanQuery."%' AND contentPage !='*'";
	$query=@mysql_query($SQL);
	if (!$query) die(mysql_error());
	
	if (mysql_num_rows($query)<1 || !$cleanQuery) {
		echo "No results.";
		return;
	}
	
	$pages[]=Array();
	echo "
    "; while ($result=mysql_fetch_array($query)) { if (!array_search($result['contentPage'],$pages)) { $pages[]=$result['contentPage']; echo "
  • "; echo "".$result['contentPage'].""; echo "".strip_tags(truncate($result['contentHTML'], 200)).""; echo "
  • "; } } echo ""; } // Support function(s) // Original PHP code by Chirp Internet: www.chirp.com.au // Please acknowledge use of this code by including this header. function truncate($string, $limit, $break=".", $pad="...") { // return with no change if string is shorter than $limit if(strlen($string) <= $limit) return $string; // is $break present between $limit and the end of the string? if(false !== ($breakpoint = strpos($string, $break, $limit))) { if($breakpoint < strlen($string) - 1) { $string = substr($string, 0, $breakpoint) . $pad; } } return $string; }

I wouldn't bother licensing this, except I think the WTFPL license is hilarious. So there's that.

Filed under: ,

Minimal OSU Wallpapers

13 September 2010

Ohio State Wallpaper

Couldn’t find any minimalist, “design-y” OSU wallpapers for football season so I made two. Perhaps you have come across this and would like them (1920×1200 .jpg)?

Download red version

Download white version

Filed under: ,

« Older