in xdocs/scripts/attic_filter.lua [14:58]
function output_filter(r)
if not r.content_type:match("text/html") then return end
local host = r.hostname:match("^([^.]+)")
local sty1 = 'font-size:x-large;padding:15px;color:white;background:red;' ;
local sty2 = 'color:white;text-decoration:underline' ;
local div = ([[
<div style='%s'>
This project has retired. For details please refer to its
<a style='%s' href="https://attic.apache.org/projects/%s.html">
Attic page</a>.
</div>]]):format(sty1, sty2, host)
if host == 'predictionio' or host == 'eagle' or host == 'metamodel'
then
coroutine.yield('')
else
coroutine.yield(div)
end
while bucket do
if host == 'predictionio'
then
local output = bucket:gsub('<header>', '<header>'..div, 1)
coroutine.yield(output)
elseif host == 'eagle'
then
local output = bucket:gsub('</nav>', '</nav>'..div, 1)
coroutine.yield(output)
elseif host == 'metamodel'
then
local output = bucket:gsub('</nav>', div..'</nav>', 1)
coroutine.yield(output)
else
coroutine.yield(bucket)
end
end
end