File tree 4 files changed +12
-10
lines changed
4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
1
name : eugene
2
- repo : loreanvictor.github.io
2
+ host : loreanvictor.github.io
3
+ repo : https://github.com/loreanvictor/techblog
3
4
contact : https://github.com/loreanvictor
Original file line number Diff line number Diff line change 1
1
name : tysonwilliams
2
- repo : tysonmn.github.io
2
+ host : tysonmn.github.io
3
+ repo : https://github.com/TysonMN/tysonmn.github.io
3
4
contact : https://github.com/TysonMN
Original file line number Diff line number Diff line change @@ -29,23 +29,23 @@ export async function getLiveBlogs() {
29
29
)
30
30
. map ( record => ( {
31
31
name : record . name . split ( '.' ) [ 0 ] ,
32
- repo : record . content ,
32
+ host : record . content ,
33
33
} ) )
34
34
} else {
35
35
throw createHttpError ( response . status , response . statusText )
36
36
}
37
37
}
38
38
39
39
40
- export async function addLiveBlog ( name , repo ) {
40
+ export async function addLiveBlog ( name , host ) {
41
41
const response = await fetch ( `${ BASE_URL } create/${ DOMAIN } ` , {
42
42
method : 'POST' ,
43
43
body : JSON . stringify ( {
44
44
apikey : process . env . API_KEY ,
45
45
secretapikey : process . env . API_SECRET ,
46
46
type : 'CNAME' ,
47
47
name,
48
- content : repo ,
48
+ content : host ,
49
49
} )
50
50
} )
51
51
@@ -55,13 +55,13 @@ export async function addLiveBlog(name, repo) {
55
55
}
56
56
57
57
58
- export async function updateLiveBlog ( name , repo ) {
58
+ export async function updateLiveBlog ( name , host ) {
59
59
const response = await fetch ( `${ BASE_URL } editByNameType/${ DOMAIN } /CNAME/${ name } ` , {
60
60
method : 'POST' ,
61
61
body : JSON . stringify ( {
62
62
apikey : process . env . API_KEY ,
63
63
secretapikey : process . env . API_SECRET ,
64
- content : repo ,
64
+ content : host ,
65
65
} )
66
66
} )
67
67
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export async function syncBlogs() {
17
17
const updates = local . filter (
18
18
blog => live . some (
19
19
liveBlog => liveBlog . name === blog . name &&
20
- liveBlog . repo !== blog . repo
20
+ liveBlog . host !== blog . host
21
21
)
22
22
)
23
23
const deletions = live . filter ( liveBlog => ! local . some ( localBlog => localBlog . name === liveBlog . name ) )
@@ -29,7 +29,7 @@ export async function syncBlogs() {
29
29
30
30
for ( const blog of additions ) {
31
31
try {
32
- await addLiveBlog ( blog . name , blog . repo )
32
+ await addLiveBlog ( blog . name , blog . host )
33
33
console . log ( chalk . hex ( ADD_COLOR ) ( `✨ Added ${ blog . name } ` ) )
34
34
} catch ( error ) {
35
35
console . log ( chalk . hex ( ERROR_COLOR ) ( `Adding ${ blog . name } failed: ${ error . message } ` ) )
@@ -38,7 +38,7 @@ export async function syncBlogs() {
38
38
39
39
for ( const blog of updates ) {
40
40
try {
41
- await updateLiveBlog ( blog . name , blog . repo )
41
+ await updateLiveBlog ( blog . name , blog . host )
42
42
console . log ( chalk . hex ( UPDATE_COLOR ) ( `✏️ Updated ${ blog . name } ` ) )
43
43
} catch ( error ) {
44
44
console . log ( chalk . hex ( ERROR_COLOR ) ( `Updating ${ blog . name } failed: ${ error . message } ` ) )
You can’t perform that action at this time.
0 commit comments