Skip to content

Commit 1914e73

Browse files
committed
Format JS using prettier
1 parent f1b312c commit 1914e73

11 files changed

+415
-318
lines changed

create-redirects.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ redirects.forEach(({ path, redirect }) => {
1818
if (exists(target)) return
1919

2020
mkdirSync(dirname(target), { recursive: true })
21-
writeFileSync(target, `<!DOCTYPE html><html><title>Redirect</title><link rel="canonical" href="${redirect}"><script>location="${redirect}"</script><meta http-equiv="refresh" content="0;url=${redirect}"><meta name="robots" content="noindex"><a href="${redirect}">Click here if you are not redirected.</a></html>`)
21+
writeFileSync(
22+
target,
23+
`<!DOCTYPE html><html><title>Redirect</title><link rel="canonical" href="${redirect}"><script>location="${redirect}"</script><meta http-equiv="refresh" content="0;url=${redirect}"><meta name="robots" content="noindex"><a href="${redirect}">Click here if you are not redirected.</a></html>`
24+
)
2225
})

docs/.vuepress/config.js

+129-111
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const sidebarUserGuide = [
2626
['/TryItOut', 'Try it out'],
2727
['/Walkthrough', 'Walkthrough'],
2828
['/UseCase', 'Use Case'],
29-
['/BTCPayVsOthers', 'BTCPay Server vs. Others'],
29+
['/BTCPayVsOthers', 'BTCPay Server vs. Others']
3030
]
3131
},
3232
{
@@ -55,7 +55,7 @@ const sidebarUserGuide = [
5555
}
5656
]
5757
},
58-
['/WhatsNext', '(4) What\'s Next?']
58+
['/WhatsNext', "(4) What's Next?"]
5959
]
6060
},
6161
{
@@ -77,9 +77,7 @@ const sidebarUserGuide = [
7777
{
7878
title: 'Pull Payments',
7979
path: '/PullPayments',
80-
children: [
81-
['/Refund', 'Refunds']
82-
]
80+
children: [['/Refund', 'Refunds']]
8381
},
8482
['/Payouts', 'Payouts'],
8583
['/Apps', 'Apps'],
@@ -88,7 +86,11 @@ const sidebarUserGuide = [
8886
title: 'Payjoin',
8987
path: '/Payjoin',
9088
children: [
91-
['https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki', 'Payjoin specification', { type: 'external' }]
89+
[
90+
'https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki',
91+
'Payjoin specification',
92+
{ type: 'external' }
93+
]
9294
]
9395
}
9496
]
@@ -140,118 +142,122 @@ const sidebarUserGuide = [
140142

141143
const sidebarDeployment = [
142144
{
143-
title: "Deployment",
145+
title: 'Deployment',
144146
collapsable: false,
145147
children: [
146-
"/Deployment/",
147-
"/Deployment/ThirdPartyHosting",
148-
"/Configurator/",
149-
],
148+
'/Deployment/',
149+
'/Deployment/ThirdPartyHosting',
150+
'/Configurator/'
151+
]
150152
},
151153
{
152-
title: "Docker",
154+
title: 'Docker',
153155
collapsable: false,
154156
children: [
155-
["/Docker/", "Introduction"],
157+
['/Docker/', 'Introduction'],
156158
{
157-
title: "Web/Cloud Deployment",
158-
path: "/Deployment/webdeployment",
159+
title: 'Web/Cloud Deployment',
160+
path: '/Deployment/webdeployment',
159161
collapsable: false,
160162
children: [
161-
["/Deployment/LunaNode", "Luna Node"],
162-
["/Deployment/voltagecloud", "Voltage Cloud"],
163-
["/Deployment/DreamlabNetwork", "Dream Lab Network"],
163+
['/Deployment/LunaNode', 'Luna Node'],
164+
['/Deployment/voltagecloud', 'Voltage Cloud'],
165+
['/Deployment/DreamlabNetwork', 'Dream Lab Network'],
164166
{
165-
title: "Azure",
166-
path: "/Deployment/Azure",
167+
title: 'Azure',
168+
path: '/Deployment/Azure',
167169
children: [
168-
["/Deployment/AzurePennyPinching", "Reducing Cost on Azure"],
169-
],
170+
['/Deployment/AzurePennyPinching', 'Reducing Cost on Azure']
171+
]
170172
},
171173
{
172-
title: "Google Cloud",
173-
path: "/Deployment/GoogleCloud",
174-
},
175-
],
174+
title: 'Google Cloud',
175+
path: '/Deployment/GoogleCloud'
176+
}
177+
]
176178
},
177179
{
178-
title: "Hardware Deployment",
179-
path: "/Deployment/Hardware",
180+
title: 'Hardware Deployment',
181+
path: '/Deployment/Hardware',
180182
collapsable: false,
181183
children: [
182184
{
183-
title: "Raspberry Pi Deployment",
184-
path: "/Deployment/RaspberryPi4",
185+
title: 'Raspberry Pi Deployment',
186+
path: '/Deployment/RaspberryPi4'
185187
},
186188
{
187-
title: "Hack0 Deployment",
188-
path: "/Deployment/Hack0",
189+
title: 'Hack0 Deployment',
190+
path: '/Deployment/Hack0'
189191
},
190192
{
191-
title: "LightningInABox Deployment",
192-
path: "/Deployment/LightningInABox",
193+
title: 'LightningInABox Deployment',
194+
path: '/Deployment/LightningInABox'
193195
},
194-
["/Deployment/DynamicDNS", "Dynamic DNS"],
195-
["/Docker/cloudflare-tunnel", "Exposing on clearnet with Cloudflare"],
196+
['/Deployment/DynamicDNS', 'Dynamic DNS'],
197+
['/Docker/cloudflare-tunnel', 'Exposing on clearnet with Cloudflare'],
196198
[
197-
"/Deployment/ReverseSSHtunnel",
198-
"Exposing on clearnet with a reverse SSH Tunnel",
199+
'/Deployment/ReverseSSHtunnel',
200+
'Exposing on clearnet with a reverse SSH Tunnel'
199201
],
200-
["/Deployment/ReverseProxyToTor", "Exposing on Tor"],
202+
['/Deployment/ReverseProxyToTor', 'Exposing on Tor'],
201203
{
202-
title: "Hardware As A Service",
203-
path: "/Deployment/HardwareAsAService",
204-
},
205-
],
204+
title: 'Hardware As A Service',
205+
path: '/Deployment/HardwareAsAService'
206+
}
207+
]
206208
},
207209
{
208-
title: "Docker Plugins",
210+
title: 'Docker Plugins',
209211
children: [
210212
{
211-
title: "Transmuter",
212-
path: "/Transmuter/",
213+
title: 'Transmuter',
214+
path: '/Transmuter/',
213215
children: [
214-
["/Transmuter/DCA", "Dollar Cost Average Preset"],
215-
["/Transmuter/EmailReceiptsPreset", "Email Receipts Preset"],
216-
],
216+
['/Transmuter/DCA', 'Dollar Cost Average Preset'],
217+
['/Transmuter/EmailReceiptsPreset', 'Email Receipts Preset']
218+
]
217219
},
218-
["/ElectrumX", "Electrum X"],
219-
["/ElectrumPersonalServer", "Electrum Personal Server"],
220-
"/Docker/joinmarket",
221-
"/Docker/pihole",
222-
"/Docker/fireflyiii",
223-
"/Docker/ndlc",
224-
"/Docker/lightning-terminal",
225-
"/Docker/tallycoin-connect",
226-
"/Docker/cloudflare-tunnel",
227-
],
220+
['/ElectrumX', 'Electrum X'],
221+
['/ElectrumPersonalServer', 'Electrum Personal Server'],
222+
'/Docker/joinmarket',
223+
'/Docker/pihole',
224+
'/Docker/fireflyiii',
225+
'/Docker/ndlc',
226+
'/Docker/lightning-terminal',
227+
'/Docker/tallycoin-connect',
228+
'/Docker/cloudflare-tunnel'
229+
]
228230
},
229231
{
230-
title: "FastSync",
231-
path: "/Docker/fastsync",
232+
title: 'FastSync',
233+
path: '/Docker/fastsync'
232234
},
233235
{
234-
title: "Backup & Restore",
235-
path: "/Docker/backup-restore",
236-
},
237-
],
236+
title: 'Backup & Restore',
237+
path: '/Docker/backup-restore'
238+
}
239+
]
238240
},
239241
{
240-
title: "Manual Deployment",
242+
title: 'Manual Deployment',
241243
collapsable: false,
242244
children: [
243-
"/Deployment/ManualDeployment",
244-
"/Deployment/ManualDeploymentExtended",
245-
],
246-
},
247-
];
245+
'/Deployment/ManualDeployment',
246+
'/Deployment/ManualDeploymentExtended'
247+
]
248+
}
249+
]
248250

249251
const sidebarDevelopment = [
250252
{
251253
title: 'Greenfield API',
252254
collapsable: false,
253255
children: [
254-
[`${baseUrl}/API/Greenfield/v1`, 'Greenfield API v1', { type: 'external' }],
256+
[
257+
`${baseUrl}/API/Greenfield/v1`,
258+
'Greenfield API v1',
259+
{ type: 'external' }
260+
],
255261
'/BTCPayServer/greenfield-authorization',
256262
'/Development/GreenFieldExample',
257263
'/Development/GreenFieldExample-NodeJS',
@@ -288,9 +294,7 @@ const sidebarDevelopment = [
288294
{
289295
title: 'BTCPay Server Vault',
290296
path: '/Vault/',
291-
children: [
292-
'/Vault/HowToVerify'
293-
]
297+
children: ['/Vault/HowToVerify']
294298
},
295299
['/BTCPayServer/Security', 'Security Disclosures'],
296300
['/Development/TestnetDemo', 'Testnet deployment']
@@ -308,10 +312,7 @@ const sidebarContribute = [
308312
title: 'Code',
309313
path: '/Contribute/Dev',
310314
collapsable: false,
311-
children: [
312-
'/Contribute/DevCode',
313-
'/Contribute/DevTest'
314-
]
315+
children: ['/Contribute/DevCode', '/Contribute/DevTest']
315316
},
316317
{
317318
title: 'Write',
@@ -328,8 +329,7 @@ const sidebarContribute = [
328329
['/Contribute/Misc', 'Miscellaneous'],
329330
['/Contribute/Agenda', 'Open Community Calls']
330331
]
331-
},
332-
332+
}
333333
]
334334

335335
const sidebarFAQ = [
@@ -356,47 +356,65 @@ module.exports = {
356356
title,
357357
description: 'BTCPay Server Official Documentation',
358358
head: [
359-
['meta', { name: 'viewport', content: 'width=device-width,initial-scale=1.0'}],
359+
[
360+
'meta',
361+
{ name: 'viewport', content: 'width=device-width,initial-scale=1.0' }
362+
],
360363
['link', { rel: 'stylesheet', href: '/styles/btcpayserver-variables.css' }]
361364
],
362-
chainWebpack (config) {
365+
chainWebpack(config) {
363366
config.module
364367
.rule('md')
365368
.test(/\.md$/)
366369
.use(preprocessMarkdown)
367-
.loader(preprocessMarkdown)
368-
.end()
370+
.loader(preprocessMarkdown)
371+
.end()
369372
},
370373
plugins: [
371-
['seo', {
372-
siteTitle: (_, $site) => $site.title,
373-
title: $page => $page.title,
374-
description: $page => $page.frontmatter.description || extractDescription($page._strippedContent),
375-
author: (_, $site) => info,
376-
tags: $page => ($page.frontmatter.tags || ['BTCPay Server']),
377-
twitterCard: _ => 'summary',
378-
type: $page => 'article',
379-
url: (_, $site, path) => `${baseUrl}${path.replace('.html', pageSuffix)}`,
380-
image: ($page, $site) => `${baseUrl}/card.png`
381-
}],
382-
['clean-urls', {
383-
normalSuffix: pageSuffix,
384-
indexSuffix: pageSuffix,
385-
notFoundPath: '/404.html',
386-
}],
387-
['code-copy', {
388-
color: '#8F979E',
389-
backgroundTransition: false,
390-
staticIcon: true
391-
}],
392-
['sitemap', {
393-
hostname: baseUrl,
394-
exclude: ['/404.html']
395-
}],
374+
[
375+
'seo',
376+
{
377+
siteTitle: (_, $site) => $site.title,
378+
title: $page => $page.title,
379+
description: $page =>
380+
$page.frontmatter.description ||
381+
extractDescription($page._strippedContent),
382+
author: (_, $site) => info,
383+
tags: $page => $page.frontmatter.tags || ['BTCPay Server'],
384+
twitterCard: _ => 'summary',
385+
type: $page => 'article',
386+
url: (_, $site, path) =>
387+
`${baseUrl}${path.replace('.html', pageSuffix)}`,
388+
image: ($page, $site) => `${baseUrl}/card.png`
389+
}
390+
],
391+
[
392+
'clean-urls',
393+
{
394+
normalSuffix: pageSuffix,
395+
indexSuffix: pageSuffix,
396+
notFoundPath: '/404.html'
397+
}
398+
],
399+
[
400+
'code-copy',
401+
{
402+
color: '#8F979E',
403+
backgroundTransition: false,
404+
staticIcon: true
405+
}
406+
],
407+
[
408+
'sitemap',
409+
{
410+
hostname: baseUrl,
411+
exclude: ['/404.html']
412+
}
413+
],
396414
['@vuepress/medium-zoom']
397415
],
398416
markdown: {
399-
extendMarkdown (md) {
417+
extendMarkdown(md) {
400418
md.use(implicitFigures)
401419
md.use(include, { root: resolve(__dirname, 'includes') })
402420
},

docs/.vuepress/enhanceApp.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ const handleClick = e => {
3030

3131
// Theme Switch
3232
if (typeof process === 'undefined' || process.env.VUE_ENV !== 'server') {
33-
const systemColorMode = window.matchMedia('(prefers-color-scheme: dark)').matches ? COLOR_MODES[1] : COLOR_MODES[0]
33+
const systemColorMode = window.matchMedia('(prefers-color-scheme: dark)')
34+
.matches
35+
? COLOR_MODES[1]
36+
: COLOR_MODES[0]
3437
const userColorMode = window.localStorage.getItem(STORE_ATTR)
35-
const initialColorMode = COLOR_MODES.includes(userColorMode) ? userColorMode : systemColorMode
38+
const initialColorMode = COLOR_MODES.includes(userColorMode)
39+
? userColorMode
40+
: systemColorMode
3641

3742
setColorMode(initialColorMode)
3843
}

0 commit comments

Comments
 (0)