Author: henkp
Date: Wed Apr 11 15:51:33 2018
New Revision: 1828910

URL: http://svn.apache.org/viewvc?rev=1828910&view=rev
Log:
init attic_filter.lua

Added:
    attic/site/docs/scripts/attic_filter.lua

Added: attic/site/docs/scripts/attic_filter.lua
URL: 
http://svn.apache.org/viewvc/attic/site/docs/scripts/attic_filter.lua?rev=1828910&view=auto
==============================================================================
--- attic/site/docs/scripts/attic_filter.lua (added)
+++ attic/site/docs/scripts/attic_filter.lua Wed Apr 11 15:51:33 2018
@@ -0,0 +1,18 @@
+function output_filter(r)
+    -- We only filter text/html types
+    if not r.content_type:match(".*text/html.*") then return end
+ 
+    -- add header:
+    local host = r.hostname:match("^([^.]+)") -- get TLP part of hostname
+    coroutine.yield(([[
+        <div style='width: 100%; height: 32px; color: #FFF; background: #C00;'>
+            This project has retired! See %s's
+            <a href='https://attic.apache.org/projects/%s.html'>attic</a> page.
+        </div>
+        ]]):format(host, host))
+ 
+    -- spit out the actual page
+    while bucket do
+        coroutine.yield(bucket)
+    end
+end


Reply via email to