From: Frank Lichtenheld Date: Sun, 15 Mar 2009 18:44:43 +0000 (+0100) Subject: templates: define packages_homepage and packages_homepage_abs X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=d4847b84cec9655e66d5faf9e9078c86bec11ecd;p=deb%2Fpackages.git templates: define packages_homepage and packages_homepage_abs We don't want to hardcode the full URL everywhere so that you can use the mirrors directly (e.g. packages-piatti.debian.org), but we need the full URL at other places (e.g. in the RSS feeds). --- diff --git a/templates/config.tmpl b/templates/config.tmpl index 132db62..77e6db1 100644 --- a/templates/config.tmpl +++ b/templates/config.tmpl @@ -5,7 +5,8 @@ organisation = 'Debian' project_homepage = 'http://www.debian.org/' - packages_homepage = 'http://packages.debian.net/' + packages_homepage = '/' + packages_homepage_abs = 'http://packages.debian.net/' searchformurl = packages_homepage search_url = '/search' tags_url = 'http://debtags.alioth.debian.org/' diff --git a/templates/rfc822/search.tmpl b/templates/rfc822/search.tmpl index 955bf45..a0b4bad 100644 --- a/templates/rfc822/search.tmpl +++ b/templates/rfc822/search.tmpl @@ -3,7 +3,7 @@ [%- FOREACH s IN suites -%] [%- FOREACH s.versions %] Package: [% pkg %] -Url: [% packages_homepage _ make_url(pkg,'','suite',s.suite,'arch','','section','','format','') %] +Url: [% packages_homepage_abs _ make_url(pkg,'','suite',s.suite,'arch','','section','','format','') %] Archive: [% archive %] Suite: [% s.suite %] Section: [% s.section %] @@ -22,7 +22,7 @@ Provided-by: [% s.providers.join(', ') %] [%- FOREACH origins -%] [%- origin = (archive == main_archive) ? suite : "$suite/$archive" %] Package: [% pkg %] -Url: [% packages_homepage _ make_url(pkg,'','source','source','suite',origin,'section','','arch','','format','') %] +Url: [% packages_homepage_abs _ make_url(pkg,'','source','source','suite',origin,'section','','arch','','format','') %] [%- "\nArchive: $real_archive" IF real_archive %] [%- "\nSection: $section" IF section %] Subsection: [% subsection %] diff --git a/templates/rss/newpkg.tmpl b/templates/rss/newpkg.tmpl index 378cca3..90533ba 100644 --- a/templates/rss/newpkg.tmpl +++ b/templates/rss/newpkg.tmpl @@ -9,7 +9,7 @@ xmlns:admin="http://webns.net/mvcb/" > -[%- root_url = "$packages_homepage$suite/"; +[%- root_url = "$packages_homepage_abs$suite/"; SET root_url = "$root_url$section/" IF section -%]