TiddlyWiki and SEO

163 views
Skip to first unread message

fpro...@yahoo.fr

unread,
Feb 5, 2007, 1:02:12 PM2/5/07
to TiddlyWiki
Hi all!

I have just installed TiddlyWiki: http://www.superphysique.net.

I am really happy with it, and would like to optimize it for google
and others search engine.

I have think about something like this:

A tool that would take every tiddler and export each of them in a file
with the same name that the tiddler, and in subdirectory according to
associated tags.

For exemple :

A tiddler "Bodybuilding" with tags : Pictures, training

Would be exported in \Pictures\bodybuilding.html and \Training
\bodybuilding.html

The files exported would have this look:

<html>
<head>
<title>Tiddler title</title>
<meta keywords="Tidler Tags">
<body>
<script>location.href = "MyTiddlyWebsite.com#TidlerName";</script>
<no script>
Tidler Content

Please click on MyTiddlyWebsite.com#TidlerName to access full
websites!
</noscript>
</body>
</html>

With the possibility to exclude from export some tiddlers that
contains a tag excludesFromExport (for ex).

It may be considered as duplicate content, but as a TiddlyWiki can be
very large and with tiddlers Plugin full of Javascript, I am not sure
that Google read all the content of the page (at a moment, I have
heard of a 80 ko indexation limit) and moreover can index it properly.

I am not that good in Javascript, so I though to develop the tool in C
as a command tool but maybe with some existing plugin it may be
possible to do this kind of stuff easily (I have read about a
ForEachTiddler and ExportTiddler plugin).

Please let me know what you think about that.

Regards from Paris,

Fabrice

FND

unread,
Feb 5, 2007, 1:16:43 PM2/5/07
to Tiddl...@googlegroups.com
I can't really help you with your problem there, but I wanted to give
you some quick advice:
With Yann's PolyglotPlugin*, you could create a bi-lingual page without
having to resort to the somewhat clumsy workaround of having both
languages next to each other...

I haven't tried the plugin myself yet (sorry Yann... ), but it sure
looks promising!

HTH.


-- F.


* http://yann.perrin.googlepages.com/twkd.html#PolyGlotPlugin

olivier

unread,
Feb 10, 2007, 6:00:50 PM2/10/07
to TiddlyWiki
Hum, I am thinking of a php script which would return the file you
said from an url like tiddlywiki.php?tiddler=mytiddler.
If somebody makes that I would certainly use it :-)

Olivier

Bob McElrath

unread,
Feb 10, 2007, 6:09:24 PM2/10/07
to Tiddl...@googlegroups.com
Not sure if this helps, but ZiddlyWiki can do:
http://www.ziddlywiki.com/test2.1/tiddlers/GettingStarted
which gives plain text (e.g. TW line-escaping removed), and
http://www.ziddlywiki.com/test2.1?action=get&title=GettingStarted
which returns a <div> in the store's format.

The former is more appropriate for search engines since they will be
confused by TW's line escaping.

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
> To post to this group, send email to Tiddl...@googlegroups.com
> To unsubscribe from this group, send email to TiddlyWiki-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/TiddlyWiki?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
--
Cheers,
Bob McElrath [Univ. of California at Davis, Department of Physics]

"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man."
-- George Bernard Shaw, Maxims for Revolutionists

signature.asc

Simon Baird

unread,
Feb 10, 2007, 11:56:39 PM2/10/07
to Tiddl...@googlegroups.com
You could do that with ruby.

I have some ruby code that would make it quite easy.

http://code.google.com/p/r4tw/

Eg,

#!/usr/bin/ruby

require 'r4tw'

make_tw {
  source_file "mytw.html"
  tiddlers.each do |t|
    output = <<-EOT


<html>
<head>
<title>Tiddler title</title>
<meta keywords="Tidler Tags">
<body>
<script>location.href = "MyTiddlyWebsite.com##{t.name}";</script>
<no script>
#{t.text}

Please click on MyTiddlyWebsite.com##{t.name} to access full
websites!
</noscript>
</body>
</html>
    EOT

    output.to_file("#{t.name}.html")

  end

}


This is untested.



fpro...@yahoo.fr

unread,
Feb 11, 2007, 6:31:02 PM2/11/07
to TiddlyWiki
-> Thanks F for the suggested plugin. I will give a try.

-> Thanks Bob for the plugin. I probably will need it because at the
moment, I export tiddler as plain text.

-> Thanks Simon for the source code for Ruby.

Here is a "Release 0" for my first SEOHtmlPlugin :


0. CREATE A TIDDLER CALLED SEOHtmlPlugin WITH CONTENT BELOW AND WITH
systemConfig TAG

function generateSEOHtml()
{
var originalPath = document.location.toString();
if(originalPath.substr(0,5) != "file:")
{
alert(config.messages.notFileUrlError);
if(store.tiddlerExists(config.messages.saveInstructions))
story.displayTiddler(null,config.messages.saveInstructions);
return;
}
var y = [];
var g = [];
var localPath = getLocalPath(originalPath);
var c = store.getTiddlerText("SEOHtmlPluginConfig");
var u = store.getTiddlerText("SiteUrl");
var htmlPath = localPath.substr(0,localPath.lastIndexOf("\\"));
var tiddlers = store.getTiddlers("modified","excludeSearch");
for (var t=0; t<tiddlers.length; t++) {
var content = c;
var filename = tiddlers[t].title.htmlEncode();
filename = filename.replace(/ |\//gi, '-');
filename = filename.replace(/[-]+\//gi, '-');
content = content.replace(/TIDDLER_TITLE/gi,
tiddlers[t].title.htmlEncode());
content = content.replace(/TIDDLER_URL/gi, u.htmlEncode() + '#' +
String.encodeTiddlyLink(tiddlers[t].title));
content = content.replace(/TIDDLER_KEYWORDS/gi,
tiddlers[t].tags.join(',').htmlEncode());
content = content.replace(/TIDDLER_CONTENT/gi,
wikifyStatic(tiddlers[t].text,null,tiddlers[t]).htmlEncode());
for (var ta=0; ta<tiddlers[t].tags.length; ta++) {
g.push('<url><loc>' + u.htmlEncode() + tiddlers[t].tags[ta] + '/' +
filename + '.html' + '</loc></url>');
y.push(u.htmlEncode() + tiddlers[t].tags[ta] + '/' + filename +
'.html');
saveFile(htmlPath + '\\' + tiddlers[t].tags[ta] + '\\' + filename +
'.html', convertUnicodeToUTF8(content));
}
}
saveFile(htmlPath + '\\urllist.txt',
convertUnicodeToUTF8(y.join('\n')));
saveFile(htmlPath + '\\sitemap.xml', '<?xml version="1.0"
encoding="utf-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/
0.84">\n' + convertUnicodeToUTF8(g.join('\n')) + '</urlset>');
displayMessage('SEO Html file(s) created', '');
}

1. CREATE A TIDDLER CALLED SEOHtmlPluginConfig WITH CONTENT

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>TIDDLER_TITLE</title>
<meta name="keywords" content="TIDDLER_KEYWORDS">
<script language="JavaScript" type="text/javascript">
location.href = 'TIDDLER_URL';
</script>
</head>

<body>
TIDDLER_URL

TIDDLER_CONTENT
</body>
</html>


2. ADD TO AN EXISTING TIDDLER THE CONTENT

<html><a href="javascript:generateSEOHtml();">Generate SEO Html Files</
a></html>


3. BE SURE TO HAVE FILL IN THE SHADOW SiteUrl, AND TO HAVE PUT A / AT
THE END OF THE URL


4. SAVE YOUR TIDDLY WIKI AND OPEN IT LOCALY AND CLICK ON Generate SEO
Html Files

It will :

Generate files for all tiddlers except those with excludeSearch in
directory according to tags
Generate sitemap.xml file for Google
Generate urllist.txt file for Yahoo

There are many others things to do to improve, but this is the idea!

fpro...@yahoo.fr

unread,
Feb 11, 2007, 7:20:23 PM2/11/07
to TiddlyWiki
I have updated the code above.

Better to see the plugin in action:

http://www.superphysique.net/#SEOHtmlPlugin
http://www.superphysique.net/#SEOHtmlPluginConfig

The link to generate files (you need to be on your localdrive)
http://www.superphysique.net/#COPYRIGHT

Results:
http://www.superphysique.net/Gallery/
http://www.superphysique.net/Super Physique/
http://www.superphysique.net/Materials/

Open one of the file of the directory and see what happens.
Save one of the file of the directory to see its content.

Test a keyword density checker http://www.webconfs.com/keyword-density-checker.php
on one of the file, and the all tiddly wiki...

See also:
http://www.superphysique.net/sitemap.xml


Reply all
Reply to author
Forward
0 new messages