Yogsototh

How to manage accessibility with iWeb

Posted in geek by yogsototh on March 2, 2009

I discovered this week-end iWeb use JavaScript to manage the navigation bar. The resulting problem is: no blog post is referenced in Google.

Now I did manage the problem with a simple trick.

  • First I opened the Web directory in the interface (I have a bug, and have to remove the Web link). It then reappear and create a second mount: yannesposito-1 which contain the Web directory on my iDisk.
  • My site’s name is YBlog

Once my iDisk Web folder was mounted then I opened a terminal and did :

cd /Volumes/yannesposito-1/Web/Sites/

{
print '<div style="display: none">'
for fic in YBlog/**/*.html(.); do
    print '<a href="/'$fic'">'$fic:t'</a><br/>'
done
print '</div>'
} > /tmp/hiddenReferences.txt

I then “copy/paste” the content of /tmp/hiddenReferences.txt into an HTML snippet in my “welcome” page.

But tonight, I’ll do a much better thing (to automatize a little more), and to prevent the problem that, in fact the iFrame is not searched by Google.

I’ll make a simple text box, relatively small and hidden, containing only one link to:

http://yannesposito.com/hiddenReferences.html

And I’ll create a script called updateiWebReferences.sh with the following content

#!/usr/bin/env zsh
WebDirectory="/Volumes/yannesposito-1/Web/Sites"
cd $WebDirectory

{
: ###### Print XHTML 1.0 Strict prefix #####
cat << END_TAG
<?xml version="1.0" encoding="utf-8"?>'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>all site references</title>
    </head>
    <body>
       <h1>All pages of my site</h1>
       <ul>
END_TAG

: ###### Add all pages with their title #####
for fic in YBlog/**/*.html(.); do
    pageTitle=$( perl -pe 'if(m#<title>(.*)</title># ) {
            if ( $1 ) { $_=$1."\n";}
            else { $_="" ; } }
        else { $_=""; }' <  $fic )
    if [[ $pageTitle = "" ]]; then
        pageTitle=span style="font-weight:bold;color:#aa55aa;">"$fic:t:gs#_# #"
    fi
    print '<li><a href="/'$fic'">'$pageTitle'</a></li>'
done

: ###### End of the XHTML page #####
cat << END_TAG
        </ul>
    </body>
</html>
END_TAG
} > $WebDirectory/hiddenReferences.html

And I’ll just have to launch this script once per new blog entry, or each time I change a blog post title, just after I published my iWeb website. And now all my blog entries are referenced in google.

Tell me if you founded this trick usefull.

Blogged with the Flock Browser

2 Responses

Subscribe to comments with RSS.

  1. Belgarum said, on March 3, 2009 at 7:35 am

    Just dropping by.Btw, you website have great content!

    ______________________________
    How Would You Like To UNPLUG Your House From Your Electrical Company, Knowing That You Are “100% Powered By Nature” With Renewable Energy?


Leave a Reply