From e3e86c54c5ea7aa65fbc4c98735687e61d516e32 Mon Sep 17 00:00:00 2001 From: randomdan Date: Sat, 17 Mar 2012 01:26:05 +0000 Subject: Add a sitemap --- gentoobrowse/.htaccess | 2 ++ gentoobrowse/present/sitemap.xml.xml | 9 +++++++++ gentoobrowse/views/categories.xml | 2 +- gentoobrowse/views/package.xml | 9 +++++++++ gentoobrowse/xslt/sitemap.xslt | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 gentoobrowse/present/sitemap.xml.xml create mode 100644 gentoobrowse/xslt/sitemap.xslt diff --git a/gentoobrowse/.htaccess b/gentoobrowse/.htaccess index c727c5d..e33d832 100644 --- a/gentoobrowse/.htaccess +++ b/gentoobrowse/.htaccess @@ -9,6 +9,8 @@ RewriteCond %{REQUEST_URI} !^/images/ RewriteCond %{REQUEST_URI} !^/[^/]+\.[^/]+$ RewriteCond %{REQUEST_URI} !^/p2web RewriteRule ^(.*) /p2web/\1 [L] +RewriteCond %{REQUEST_URI} ^/sitemap\.xml$ +RewriteRule ^(.*) /p2web/\1 [L] FilterDeclare XSLT FilterProvider XSLT XSLT resp=Content-Type $text/xml-xslt diff --git a/gentoobrowse/present/sitemap.xml.xml b/gentoobrowse/present/sitemap.xml.xml new file mode 100644 index 0000000..900fcc0 --- /dev/null +++ b/gentoobrowse/present/sitemap.xml.xml @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/gentoobrowse/views/categories.xml b/gentoobrowse/views/categories.xml index 1faec02..e40ff98 100644 --- a/gentoobrowse/views/categories.xml +++ b/gentoobrowse/views/categories.xml @@ -3,7 +3,7 @@ xmlns:project2="http://project2.randomdan.homeip.net"> - SELECT c.categoryid, MIN(c.name) AS catname, COUNT(*) AS packages, MIN(c.summary) AS summary + SELECT c.categoryid, MIN(c.name) AS catname, COUNT(*) AS packages, MIN(c.summary) AS summary, MAX(p.firstseen) AS pkgfirstseen FROM categories c, packages p WHERE c.categoryid = p.categoryid GROUP BY c.categoryid diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml index af36f44..7f10887 100644 --- a/gentoobrowse/views/package.xml +++ b/gentoobrowse/views/package.xml @@ -1,6 +1,15 @@ + + + SELECT c.name AS catname, p.name AS pkgname, MAX(e.moddate) AS moddate + FROM categories c, packages p, ebuilds e + WHERE p.packageid = e.packageid + AND c.categoryid = p.categoryid + GROUP BY c.name, p.name + + SELECT p.packageid, p.name AS pkgname, p.description, p.firstseen, c.name AS catname, p.herd, p.summary diff --git a/gentoobrowse/xslt/sitemap.xslt b/gentoobrowse/xslt/sitemap.xslt new file mode 100644 index 0000000..a90e150 --- /dev/null +++ b/gentoobrowse/xslt/sitemap.xslt @@ -0,0 +1,36 @@ + + + + + + + http://gentoobrowse.randomdan.homeip.net/ + daily + + + http://gentoobrowse.randomdan.homeip.net/popular + weekly + + + http://gentoobrowse.randomdan.homeip.net/categories + monthly + + + + http://gentoobrowse.randomdan.homeip.net/package// + + weekly + + + + + http://gentoobrowse.randomdan.homeip.net/category/ + + daily + + + + + + -- cgit v1.2.3