Author: sebb Date: Sat Nov 28 17:37:17 2020 New Revision: 1883905 URL: http://svn.apache.org/viewvc?rev=1883905&view=rev Log: ATTIC-189 - 'Retired' banner does not work for predictionio
Modified: attic/site/xdocs/scripts/attic_filter.lua Modified: attic/site/xdocs/scripts/attic_filter.lua URL: http://svn.apache.org/viewvc/attic/site/xdocs/scripts/attic_filter.lua?rev=1883905&r1=1883904&r2=1883905&view=diff ============================================================================== --- attic/site/xdocs/scripts/attic_filter.lua (original) +++ attic/site/xdocs/scripts/attic_filter.lua Sat Nov 28 17:37:17 2020 @@ -22,15 +22,29 @@ function output_filter(r) local name = host:gsub("^%l", string.upper) local sty1 = 'font-size:x-large;padding:15px;color:white;background:red;' ; local sty2 = 'color:white;text-decoration:underline' ; - coroutine.yield ( ([[ + local div = ([[ <div style='%s'> Project <i>%s</i> 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, name, sty2, host) ) + </div>]]):format(sty1, name, sty2, host) + -- special processing needed for predictionio + if host == 'predictionio' + then + coroutine.yield('') + else + coroutine.yield(div) + end -- spit out the actual page while bucket do - coroutine.yield(bucket) + -- special processing needed for predictionio + if host == 'predictionio' + then + local output = bucket:gsub('<header>', '<header>'..div, 1) + coroutine.yield(output) + else + coroutine.yield(bucket) + end end end