commit 5413b48143b352819aeaa40b056708f4939919ca parent 7f63b6083ab6b6d8182d52a297b6c9ae39408641 Author: uriel@soma <unknown> Date: Thu, 11 Dec 2008 21:38:31 +0000 Fix and simplify code that generates rss/atom urls. Now it handles urls in / properly. Diffstat:
M | bin/werc.rc | | | 8 | +++----- |
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/bin/werc.rc b/bin/werc.rc @@ -205,12 +205,10 @@ fn select_handler { if (~ $#blogDirs 0) blogDirs = `{basename -d $body} - u=`{cleanname `{basename -d $uri}} - rssuri=$baseuri^$"u^/index.rss - atomuri=$baseuri^$"u^/index.atom + u=`{cleanname $baseuri^`{basename -d '/'^$uri}|sed 's,:/,://,'} # Sed recovers '/' in 'http:/' stripped by cleanname extraHeaders=$"extraHeaders ^ \ - '<link rel="alternate" type="application/rss+xml" title="RSS" href="'$rssuri'" /> - <link rel="alternate" type="application/atom+xml" title="ATOM" href="'$atomuri'"/> + '<link rel="alternate" type="application/rss+xml" title="RSS" href="'$"u'/index.rss" /> +<link rel="alternate" type="application/atom+xml" title="ATOM" href="'$"u'/index.atom" /> ' set_handler tpl_handler lib/feeds/html.tpl