Question
When I use the
PublishWebPlugin everything works fine with no errors. The HTML goes in the right dir (/twiki/dumps) and so do the attachments (/twiki/dumps/attach). The only thing is that the links to the attachments in the generated HTML are all wrong ("http://myhostname/attach/file.name" instead of just "attach/file.name").
I've gone through all the .cfg files and read everything I could find on the plugin but no-one else seems to be having the same problem.
Thanks in advance for your help.
Environment
--
TWikiGuest - 01 Mar 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
It is possible that there is a bug in the
PublishWebPlugin, I will investigate when I find time.
--
PeterThoeny - 02 Mar 2006
I think that the problem is caused by the way TWiki handles links. There's an old discussion on it here:
http://twiki.org/cgi-bin/view/Codev/WhyBaseTag
If I use a skin that doesn't have the <BASE> tag defined in it, it causes the links to other web pages to be less problematic because the browser doesn't stick the base URL in front of every link. The images are still linked in the same way described above; the page links are absolute UNIX paths which is also incorrect, plus they don't have the ".html" bit at the end - they're still TWiki-style links. I gather nothing resulted from the discussion about moving TWiki to relative links?
Possible partial answer:
Adding the "+" line below after the three lines before it in PublishWebPlugin.pm removes the problematic part of the path.
my $pubUrl = TWiki::Func::getPubUrlPath();
$tmpl =~ s/($pubUrl)\/([^\)'" ]+)/&fixAndCopyAttachments($1, $2, $pubDir )/geo;
$tmpl =~ s/<\/?(nop|noautolink)\/?>\n?//gois;
+ $tmpl =~ s!https?://[^/ "'\)]+/_attach/!/_attach/!gois;
--
WolfgangSlany - 08 Sep 2006
Thanks for the update, noted in
PublishWebPluginDev.
--
PeterThoeny - 08 Sep 2006