Skip to content

Commit 8cf2cbf

Browse files
committed
better field naming
1 parent 17d22ae commit 8cf2cbf

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

Diff for: domain/list/eugene.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
name: eugene
2-
repo: loreanvictor.github.io
2+
host: loreanvictor.github.io
3+
repo: https://github.com/loreanvictor/techblog
34
contact: https://github.com/loreanvictor

Diff for: domain/list/tysonwilliams.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
name: tysonwilliams
2-
repo: tysonmn.github.io
2+
host: tysonmn.github.io
3+
repo: https://github.com/TysonMN/tysonmn.github.io
34
contact: https://github.com/TysonMN

Diff for: domain/live.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ export async function getLiveBlogs() {
2929
)
3030
.map(record => ({
3131
name: record.name.split('.')[0],
32-
repo: record.content,
32+
host: record.content,
3333
}))
3434
} else {
3535
throw createHttpError(response.status, response.statusText)
3636
}
3737
}
3838

3939

40-
export async function addLiveBlog(name, repo) {
40+
export async function addLiveBlog(name, host) {
4141
const response = await fetch(`${BASE_URL}create/${DOMAIN}`, {
4242
method: 'POST',
4343
body: JSON.stringify({
4444
apikey: process.env.API_KEY,
4545
secretapikey: process.env.API_SECRET,
4646
type: 'CNAME',
4747
name,
48-
content: repo,
48+
content: host,
4949
})
5050
})
5151

@@ -55,13 +55,13 @@ export async function addLiveBlog(name, repo) {
5555
}
5656

5757

58-
export async function updateLiveBlog(name, repo) {
58+
export async function updateLiveBlog(name, host) {
5959
const response = await fetch(`${BASE_URL}editByNameType/${DOMAIN}/CNAME/${name}`, {
6060
method: 'POST',
6161
body: JSON.stringify({
6262
apikey: process.env.API_KEY,
6363
secretapikey: process.env.API_SECRET,
64-
content: repo,
64+
content: host,
6565
})
6666
})
6767

Diff for: domain/sync.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function syncBlogs() {
1717
const updates = local.filter(
1818
blog => live.some(
1919
liveBlog => liveBlog.name === blog.name &&
20-
liveBlog.repo !== blog.repo
20+
liveBlog.host !== blog.host
2121
)
2222
)
2323
const deletions = live.filter(liveBlog => !local.some(localBlog => localBlog.name === liveBlog.name))
@@ -29,7 +29,7 @@ export async function syncBlogs() {
2929

3030
for (const blog of additions) {
3131
try {
32-
await addLiveBlog(blog.name, blog.repo)
32+
await addLiveBlog(blog.name, blog.host)
3333
console.log(chalk.hex(ADD_COLOR)(`✨ Added ${blog.name}`))
3434
} catch (error) {
3535
console.log(chalk.hex(ERROR_COLOR)(`Adding ${blog.name} failed: ${error.message}`))
@@ -38,7 +38,7 @@ export async function syncBlogs() {
3838

3939
for (const blog of updates) {
4040
try {
41-
await updateLiveBlog(blog.name, blog.repo)
41+
await updateLiveBlog(blog.name, blog.host)
4242
console.log(chalk.hex(UPDATE_COLOR)(`✏️ Updated ${blog.name}`))
4343
} catch (error) {
4444
console.log(chalk.hex(ERROR_COLOR)(`Updating ${blog.name} failed: ${error.message}`))

0 commit comments

Comments
 (0)