Skip to content

Commit bb537f8

Browse files
Make HTML redirect a helper function (#942)
1 parent 8111121 commit bb537f8

12 files changed

+29
-77
lines changed

blog/2017/12/ml&pl-cn.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!DOCTYPE html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=/blog/2017/12/ml-pl-cn/" />
6-
</head>
7-
</html>
1+
{{redirect /blog/2017/12/ml-pl-cn/}}

blog/2017/12/ml&pl-zh_tw.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!DOCTYPE html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=/blog/2017/12/ml-pl-zh/" />
6-
</head>
7-
</html>
1+
{{redirect /blog/2017/12/ml-pl-zh/}}

blog/2017/12/ml&pl.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!DOCTYPE html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=/blog/2017/12/ml-pl/" />
6-
</head>
7-
</html>
1+
{{redirect /blog/2017/12/ml-pl/}}

download.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=/downloads/">
6-
</head>
7-
</html>
1+
{{redirect /downloads/}}

ecosystems.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=/community/" />
6-
</head>
7-
</html>
1+
{{redirect /community/}}

license.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=https://github.com/JuliaLang/julia/blob/master/LICENSE.md">
6-
</head>
7-
</html>
1+
{{redirect https://github.com/JuliaLang/julia/blob/master/LICENSE.md}}

manual.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=https://docs.julialang.org/en/v1/">
6-
</head>
7-
</html>
1+
{{redirect https://docs.julialang.org/}}

soc/ideas-page.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=/jsoc/">
6-
</head>
7-
</html>
1+
{{redirect /jsoc/}}

soc/index.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=/jsoc/">
6-
</head>
7-
</html>
1+
{{redirect /jsoc/}}

teaching.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=/learning/">
6-
</head>
7-
</html>
1+
{{redirect /learning/}}

utf8proc.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
<!-- REDIRECT -->
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta http-equiv="refresh" content="0; url=https://juliastrings.github.io/utf8proc/">
6-
</head>
7-
</html>
1+
{{redirect https://juliastrings.github.io/utf8proc/}}

utils.jl

+18
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,21 @@ function hfun_recentblogposts()
121121
end
122122
return String(take!(io))
123123
end
124+
125+
"""
126+
{{redirect url}}
127+
128+
Creates a HTML layout for a redirect to `url`.
129+
"""
130+
function hfun_redirect(url)
131+
s = """
132+
<!-- REDIRECT -->
133+
<!doctype html>
134+
<html>
135+
<head>
136+
<meta http-equiv="refresh" content="0; url=$(url[1])">
137+
</head>
138+
</html>
139+
"""
140+
return s
141+
end

0 commit comments

Comments
 (0)