Pudu programming language
Menu
Package

@chrismichaelps / pudu-lang-docgen

Documentation publishing for Pudu: articles, API references, navigation, search, and static websites

0.1.0Apache-2.01

InstallClose

Redirect.pudu

Pudu25 lines837 B

GitHub ↗
1/** @Docgen.Site.Redirect — pages that send readers to a moved article */2module PuduLangDocgen.Site.Redirect34import PuduLangDocgen.Paths as Paths56/// A standalone page that forwards the browser to a destination at once and links to it.7export fn page(title: Str, destination: Str) -> Str {8  let href = Paths.escape(destination)9  [10    "<!doctype html>",11    "<html lang=\"en\">",12    "<head>",13    "<meta charset=\"utf-8\">",14    "<title>" + Paths.escape(title) + "</title>",15    "<meta name=\"robots\" content=\"noindex\">",16    "<meta http-equiv=\"refresh\" content=\"0; url=" + href + "\">",17    "<link rel=\"canonical\" href=\"" + href + "\">",18    "</head>",19    "<body>",20    "<p class=\"redirect\">This page has moved to <a href=\"" + href + "\">" + href + "</a>.</p>",21    "</body>",22    "</html>"23  ].join("\n") + "\n"24}25