From 57213fa0dbabd52001897d0b63bfb1a8d9d6926a Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Tue, 27 Oct 2009 22:22:11 -0400 Subject: Google will take a full URL, request that the plugin send it --- doc/plugins/google/discussion.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins/google') diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index babc919d2..39403f9f9 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -4,3 +4,8 @@ This is not very good since the default ikiwiki templates produce XHTML instead of HTML. > Fixed, thanks for the patch! --[[Joey]] + +It works to pass the whole wiki baseurl to Google, not just the +domain, and appears to be legal. I've got a wiki that'd benefit +(it's a few directories down from the root). Can the plugin be +tweaked to do this? --[[schmonz]] -- cgit v1.2.3 From c29957e0177c3c654a1ea1feffdba00307449560 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 29 Oct 2009 18:05:58 -0400 Subject: google: Pass the whole wiki url to google, not just the domain, so that search works correctly for wikis that are located in subdirectories of domains. --- IkiWiki/Plugin/google.pm | 9 +-------- debian/changelog | 3 +++ doc/plugins/google/discussion.mdwn | 2 ++ templates/googleform.tmpl | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) (limited to 'doc/plugins/google') diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm index 1683220e7..483fa1707 100644 --- a/IkiWiki/Plugin/google.pm +++ b/IkiWiki/Plugin/google.pm @@ -6,8 +6,6 @@ use strict; use IkiWiki 3.00; use URI; -my $host; - sub import { hook(type => "getsetup", id => "google", call => \&getsetup); hook(type => "checkconfig", id => "google", call => \&checkconfig); @@ -26,11 +24,6 @@ sub checkconfig () { if (! length $config{url}) { error(sprintf(gettext("Must specify %s when using the %s plugin"), "url", 'google')); } - my $uri=URI->new($config{url}); - if (! $uri || ! defined $uri->host) { - error(gettext("Failed to parse url, cannot determine domain name")); - } - $host=$uri->host; } my $form; @@ -43,7 +36,7 @@ sub pagetemplate (@) { if ($template->query(name => "searchform")) { if (! defined $form) { my $searchform = template("googleform.tmpl", blind_cache => 1); - $searchform->param(sitefqdn => $host); + $searchform->param(url => $config{url}); $form=$searchform->output; } diff --git a/debian/changelog b/debian/changelog index 4c8c4d6fc..f19b4eae4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ ikiwiki (3.20091024) UNRELEASED; urgency=low url is uri-encoded. Most browsers other than MSIE don't care, but it's the right thing to do. * Add a spec file to allow building rpm from the source package. + * google: Pass the whole wiki url to google, not just the domain, + so that search works correctly for wikis that are located in + subdirectories of domains. -- Joey Hess Mon, 26 Oct 2009 11:53:32 -0400 diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index 39403f9f9..94fc36a35 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -9,3 +9,5 @@ It works to pass the whole wiki baseurl to Google, not just the domain, and appears to be legal. I've got a wiki that'd benefit (it's a few directories down from the root). Can the plugin be tweaked to do this? --[[schmonz]] + +> Done. --[[Joey]] diff --git a/templates/googleform.tmpl b/templates/googleform.tmpl index e2d4a1f43..bcf1004a4 100644 --- a/templates/googleform.tmpl +++ b/templates/googleform.tmpl @@ -1,6 +1,6 @@
- +
-- cgit v1.2.3 From cf26aa6bc76ada153b265ef7851eacb1c6f2417e Mon Sep 17 00:00:00 2001 From: "http://weakish.pigro.net/" Date: Thu, 24 Dec 2009 08:46:40 +0000 Subject: question: "still domain specific or not?" --- doc/plugins/google/discussion.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins/google') diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index 94fc36a35..32a0a41b9 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -11,3 +11,12 @@ domain, and appears to be legal. I've got a wiki that'd benefit tweaked to do this? --[[schmonz]] > Done. --[[Joey]] + +The main page said: + +> Also, if the same domain has other content, outside the wiki's +> content, it will be searched as well. + +Is it still true now? (Or this statement is out of date?) --[weakish] + +[weakish]: http://weakish.pigro.net -- cgit v1.2.3 From d35bf0be6765d692d97769cd2d81ed143c8e9036 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 25 Dec 2009 15:08:22 -0500 Subject: correction --- doc/plugins/google.mdwn | 3 +-- doc/plugins/google/discussion.mdwn | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'doc/plugins/google') diff --git a/doc/plugins/google.mdwn b/doc/plugins/google.mdwn index 7c61e637b..349c278ee 100644 --- a/doc/plugins/google.mdwn +++ b/doc/plugins/google.mdwn @@ -5,8 +5,7 @@ This plugin adds a search form to the wiki, using google's site search. Google is asked to search for pages in the domain specified in the wiki's `url` configuration parameter. Results will depend on whether google has -indexed the site, and how recently. Also, if the same domain has other -content, outside the wiki's content, it will be searched as well. +indexed the site, and how recently. The [[search]] plugin offers full text search of only the wiki, but requires that a search engine be installed on your site. diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index 32a0a41b9..e664f5723 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -20,3 +20,6 @@ The main page said: Is it still true now? (Or this statement is out of date?) --[weakish] [weakish]: http://weakish.pigro.net + +> I checked, and it's never been true; google is given the url to the top +> of the wiki and only searches things in there. --[[Joey]] -- cgit v1.2.3