fork/cargo
git clone https://git.julia.blue/fork/cargo
5225467af
0.89.0
1#!/usr/bin/env python3 2 3MAPPING = { 4"build-script.html" :"https://doc.rust-lang.org/cargo/reference/build-scripts.html" , 5"config.html" :None , 6"crates-io.html" :"https://doc.rust-lang.org/cargo/reference/publishing.html" , 7"environment-variables.html" :None , 8"external-tools.html" :None , 9"faq.html" :"https://doc.rust-lang.org/cargo/faq.html" , 10"guide.html" :"https://doc.rust-lang.org/cargo/guide/" , 11"index.html" :"https://doc.rust-lang.org/cargo/" , 12"manifest.html" :None , 13"pkgid-spec.html" :None , 14"policies.html" :"https://crates.io/policies" , 15"source-replacement.html" :None , 16"specifying-dependencies.html" :None , 17} 18 19TEMPLATE = """\ 20<html> 21<head> 22<meta http-equiv="refresh" content="0; url={mapped}" /> 23<script> 24window.location.replace("{mapped}" + window.location.hash); 25</script> 26<title>Page Moved</title> 27</head> 28<body> 29This page has moved. Click <a href="{mapped}">here</a> to go to the new page. 30</body> 31</html> 32""" 33 34def main (): 35for name in sorted (MAPPING ): 36with open (name ,'w' )as f : 37mapped = MAPPING [name ] 38if mapped is None : 39mapped = "https://doc.rust-lang.org/cargo/reference/{}" .format (name ) 40f .write (TEMPLATE .format (name = name ,mapped = mapped )) 41 42# WARN: The CNAME file is for GitHub to redirect requests to the custom domain. 43# Missing this may entail security hazard and domain takeover. 44# See <https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#securing-your-custom-domain> 45with open ('CNAME' ,'w' )as f : 46f .write ('doc.crates.io' ) 47 48if __name__ == '__main__' : 49main ()