This is an automated email from the ASF dual-hosted git repository. jamesfredley pushed a commit to branch gh-pages in repository https://gitbox.apache.org/repos/asf/grails-views.git
commit da38314ca0aeb1103833cc2c0c2b68efd424288e Author: James Fredley <[email protected]> AuthorDate: Fri Oct 10 19:55:34 2025 -0400 Delete meta-refresh.groovy --- meta-refresh.groovy | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/meta-refresh.groovy b/meta-refresh.groovy deleted file mode 100644 index 002bb0857..000000000 --- a/meta-refresh.groovy +++ /dev/null @@ -1,45 +0,0 @@ -import java.nio.file.* - -def template = '''<!DOCTYPE html> -<html lang="en"> -<head> - <title>Redirecting...</title> - <meta http-equiv="refresh" content="0; url=%s"/> -</head> -<body> -<p>This page has moved to <a href="%s">%s</a></p> -</body> -</html> -''' - -def getTargetPath(String path) { - path = path.replace('C:\\Users\\james\\Documents\\IdeaProjects\\grails-views\\', '') - path = path.replace('\\', '/') - if (path.endsWith('index.html')) { - return path.substring(0, path.length() - 10) - } - return path -} - -def domain = 'https://grails.apache.org/docs-legacy-views/' - -def root = Paths.get(".").toRealPath() - -Files.walk(root) - .filter { path -> Files.isRegularFile(path) && path.toString().endsWith(".html") } - .each { path -> - def targetPath = getTargetPath(path.toString()) - if (targetPath) { - def targetUrl = "${domain}${targetPath}" - try { - new File(path.toString()).write(String.format(template, targetUrl, targetUrl, targetUrl)) - println "Updated ${path} to redirect to ${targetUrl}" - } catch (IOException e) { - println "Error writing to ${path}: ${e.message}" - } - } else { - println "Skipped ${path}: Not an HTML file" - } - } - -println "✅ Done."
