Brown paper bag bugfix, make rss feeds work again!
This commit is contained in:
parent
a2342d38b9
commit
ea2ab9de56
2 changed files with 12 additions and 11 deletions
|
|
@ -216,6 +216,16 @@ fn select_handler {
|
||||||
if not if (~ $body *.html && test -f $body)
|
if not if (~ $body *.html && test -f $body)
|
||||||
set_handler html_handler $body
|
set_handler html_handler $body
|
||||||
|
|
||||||
|
# Rss feeds. TODO: we should check that the request is for a real blog dir
|
||||||
|
if not if (~ $REQUEST_URI */index.rss) {
|
||||||
|
uri = `{echo $uri | sed 's/index.rss$//'}
|
||||||
|
if (~ $blogDirs 0)
|
||||||
|
blogDirs = $sitedir^$uri
|
||||||
|
uri=$baseuri$"uri
|
||||||
|
master_template=feeds/rss20.tpl
|
||||||
|
response_format=raw
|
||||||
|
}
|
||||||
|
|
||||||
# Blog handler
|
# Blog handler
|
||||||
if not if (~ $body */[bB]log/index */[bB]log//index || ! ~ $#blogDirs 0) {
|
if not if (~ $body */[bB]log/index */[bB]log//index || ! ~ $#blogDirs 0) {
|
||||||
if (~ $#blogDirs 0)
|
if (~ $#blogDirs 0)
|
||||||
|
|
@ -230,16 +240,6 @@ fn select_handler {
|
||||||
set_handler blog_dir_handler $blogDirs
|
set_handler blog_dir_handler $blogDirs
|
||||||
}
|
}
|
||||||
|
|
||||||
# Rss feeds. TODO: we should check that the request is for a real blog dir
|
|
||||||
if not if (~ $REQUEST_URI */index.rss) {
|
|
||||||
uri = `{echo $uri | sed 's/index.rss$//'}
|
|
||||||
if (~ $blogDirs 0)
|
|
||||||
blogDirs = $sitedir^$uri
|
|
||||||
uri=$baseuri$"uri
|
|
||||||
master_template=feeds/rss20.tpl
|
|
||||||
response_format=raw
|
|
||||||
}
|
|
||||||
|
|
||||||
# Global tpl (eg sitemap.tpl)
|
# Global tpl (eg sitemap.tpl)
|
||||||
if not if (test -f lib/^$uri^.tpl)
|
if not if (test -f lib/^$uri^.tpl)
|
||||||
set_handler tpl_handler lib/^$uri^.tpl
|
set_handler tpl_handler lib/^$uri^.tpl
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
Content-Type: text/xml; charset=utf-8
|
Content-Type: text/xml; charset=utf-8
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
%{
|
%{
|
||||||
fn statpost {
|
fn statpost {
|
||||||
f = $1
|
f = $1
|
||||||
|
|
@ -25,7 +27,6 @@ fn statpost {
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
<channel>
|
<channel>
|
||||||
<atom:link href="%('http://'$site^$REQUEST_URI%)" rel="self" type="application/rss+xml" />
|
<atom:link href="%('http://'$site^$REQUEST_URI%)" rel="self" type="application/rss+xml" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue