@@ -5,7 +5,7 @@ redirects <- yaml::read_yaml("_output.yml")$redirects
5
5
6
6
make_redirect <- function (from , to ){
7
7
html <- sprintf(
8
- ' <head><meta http-equiv="refresh" content="0; URL=%s.html" /></head>' ,
8
+ ' <head><meta http-equiv="refresh" content="0; URL=%s.html" /></head>' ,
9
9
to
10
10
)
11
11
dest <- fs :: path(" _site" , from , ext = " html" )
@@ -15,55 +15,25 @@ make_redirect <- function(from, to){
15
15
16
16
mapply(make_redirect , from = names(redirects ), to = redirects )
17
17
18
- # make_redirect_apps <- function(name, url){
19
- # fs::dir_create(
20
- # fs::path(
21
- # "redirects",
22
- # name
23
- # )
24
- # )
25
- # fls <- fs::path(
26
- # "_site",
27
- # name,
28
- # "index.html"
29
- # )
30
- # fs::file_create(
31
- # fls
32
- # )
33
- # write(file = fls,
34
- # sprintf('<head><meta http-equiv="refresh" content="0; URL=%s" /></head>', url)
35
- # )
36
- # }
37
-
38
- # make_redirect_apps("tidytuesday201942", "https://connect.thinkr.fr/tidytuesday201942/")
39
- # make_redirect_apps("hexmake", "https://connect.thinkr.fr/hexmake/")
40
- # make_redirect_apps("minifying", "https://connect.thinkr.fr/minifying/")
41
- # make_redirect_apps("golemhtmltemplate", "https://connect.thinkr.fr/golemhtmltemplate/")
42
- # make_redirect_apps("shinipsumdemo", "https://connect.thinkr.fr/shinipsumdemo/")
43
- # make_redirect_apps("databasedemo", "https://connect.thinkr.fr/databasedemo/")
44
- # make_redirect_apps("graysacle", "https://connect.thinkr.fr/graysacle/")
45
- # make_redirect_apps("bs4dashdemo", "https://connect.thinkr.fr/bs4dashdemo/")
46
- # make_redirect_apps("shinyfuture", "https://connect.thinkr.fr/shinyfuture/")
47
-
48
18
# Creating the redirect
49
19
unlink(" redirects" , TRUE , TRUE )
50
20
51
21
make_redirect <- function (name , url ){
52
22
fs :: dir_create(
53
23
fs :: path(
54
- " redirects" ,
24
+ " redirects" ,
55
25
name
56
26
)
57
27
)
58
28
fls <- fs :: path(
59
- " redirects" ,
60
- name ,
29
+ " redirects" ,
30
+ name ,
61
31
" index.html"
62
32
)
63
33
fs :: file_create(
64
34
fls
65
35
)
66
- write(file = fls ,
36
+ write(file = fls ,
67
37
sprintf(' <head><meta http-equiv="refresh" content="0; URL=%s" /></head>' , url )
68
38
)
69
39
}
88
58
dirs
89
59
)){
90
60
fs :: dir_copy(
91
- i ,
61
+ i ,
92
62
fs :: path(" _site" , basename(i ))
93
63
)
94
64
}
0 commit comments