From 8753cac7a1334aaaf74690e3ff4d5c318fe2aefb Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 13 Apr 2007 01:52:20 +0200 Subject: [PATCH] static: Add a simple index page and use ttree to build and install Add a simple index page to static that we can use as homepage if we don't want to redirect to an external search form like we do on the official packages.debian.org. Also use ttree to build and install the contents of static. This allows to use TT for preprocessing. The first example of such a file is the added index file. --- conf/apache.conf.sed.in | 3 +- conf/ttreerc.sed.in | 17 +++++++ cron.d/700install_static | 2 +- static/index.tmpl | 107 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 conf/ttreerc.sed.in create mode 100644 static/index.tmpl diff --git a/conf/apache.conf.sed.in b/conf/apache.conf.sed.in index f1b62ab..594efd7 100644 --- a/conf/apache.conf.sed.in +++ b/conf/apache.conf.sed.in @@ -113,10 +113,11 @@ RewriteRule ^/[^/]+\.js - [L] # RewriteRule ^/$ http://www.debian.org/distrib/packages + RewriteRule ^/$ /index.html [L] RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N] RewriteRule ^/src:([^/]+)$ /source/$1 [R,L,NE] - RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [PT] + RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [L,PT] # In case we need to disable the site again # diff --git a/conf/ttreerc.sed.in b/conf/ttreerc.sed.in new file mode 100644 index 0000000..2470689 --- /dev/null +++ b/conf/ttreerc.sed.in @@ -0,0 +1,17 @@ +recurse +verbose + +ignore = \b(CVS|RCS|\.git|\.svn)\b +ignore = ^# +ignore = ~$ +ignore = \.sed\.in$ + +copy = \.(gif|png|jpg|pdf|css|js)$ +accept = \.tmpl$ +suffix tmpl=html + +lib = %TOPDIR%/templates +src = %TOPDIR%/static +dest = %TOPDIR%/www + +pre_process = config.tmpl diff --git a/cron.d/700install_static b/cron.d/700install_static index f30a5e1..84b6864 100755 --- a/cron.d/700install_static +++ b/cron.d/700install_static @@ -6,4 +6,4 @@ set -e test -d "$htmldir" || mkdir -p "$htmldir" -rsync -aC "$staticdir/"* "$htmldir/" +cd "$topdir" && ttree -f ./conf/ttreerc diff --git a/static/index.tmpl b/static/index.tmpl new file mode 100644 index 0000000..cbf214f --- /dev/null +++ b/static/index.tmpl @@ -0,0 +1,107 @@ +[% PROCESS 'html/head.tmpl' + title_tag = "$organisation Packages Search" + page_title = "$organisation Packages Search" + keywords = "$organisation, Packages" +%] + + +

This site provides you with information about all the packages +available in the [% organisation %] +Package archive. + +

Please contact [% admin.name %] +if you encounter any problems!

+ +

Browse through the lists of packages:

+ + + + +

There is also a list of packages +recently added to unstable.

+ +

Search

+ +

Search package directories

+ +
+ + + +
+Search on: + +   + + + + + +
+Only show exact matches: + +
+Distribution: + +Section: + +
+

There are shortcuts for some searches available:

+ +
+ +

Search the contents of packages

+ +

This search engine allows you to search the contents of [% organisation %] +distributions for any files (or just parts of file names) that are +part of packages. +You can also get a full list of files in a given package. +
+

+ + + +   + + +
+Display: +
+ + +
+ + +
+ + + + + + + + +
+ +[% PROCESS 'html/foot.tmpl' + langs.size = 0 %] -- 2.39.2