Skip to content

Commit da0e475

Browse files
committed
fix build
1 parent 3b331f6 commit da0e475

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

_scripts/sync-sponsors.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
const fs = require('fs')
33
const path = require('path')
44
const axios = require('axios')
5-
const yaml = require('yaml')
5+
const yaml = require('js-yaml')
66

77
const configPath = path.resolve(__dirname, '../themes/vue/_config.yml')
88

99
;(async () => {
1010
const { data } = await axios(`https://sponsors.vuejs.org/data.json`)
11-
const yml = yaml.stringify(data)
11+
const yml = yaml.dump(data)
1212
const config = fs.readFileSync(configPath, 'utf-8')
13-
const updated = config
14-
.replace(/(# START SPONSORS)[^]*(# END SPONSORS)/, `$1\n${yml}$2`)
15-
// jp specific logic
16-
.replace(`https://code-dict.com`, `https://jp.code-dict.com`)
17-
13+
const updated = config.replace(
14+
/(# START SPONSORS)[^]*(# END SPONSORS)/,
15+
`$1\n${yml}$2`
16+
)
1817
fs.writeFileSync(configPath, updated)
1918
})()

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"hexo-renderer-stylus": "^0.3.3",
2424
"hexo-server": "^0.3.1",
2525
"hoek": "^6.1.2",
26-
"yaml": "^2.1.1"
26+
"js-yaml": "^4.1.0"
2727
},
2828
"devDependencies": {
2929
"husky": "^2.4.0",

themes/vue/layout/partials/platinum_sponsors.ejs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<div class="main-sponsor">
33
<span>プラチナスポンサー</span>
44
<div>
5-
<%_ for (const sponsor of theme.platinum_sponsors) {_%>
6-
<a href="<%- sponsor.url %>" target="_blank" rel="sponsored noopener" class="logo"<%- sponsor.inline_style ? ` style="${sponsor.inline_style}"` : `` %>>
7-
<img src="<%- url_for(`/images/${sponsor.wide_img || sponsor.img}`) %>" alt="<%-sponsor.name-%>">
5+
<%_ for (const sponsor of theme.platinum) {_%>
6+
<a href="<%- sponsor.url %>" target="_blank" rel="sponsored noopener" class="logo">
7+
<img src="https://sponsors.vuejs.org/images/<%- sponsor.img %>" alt="<%-sponsor.name-%>">
88
</a>
99
<%_ } _%>
1010
</div>

yarn.lock

+12-5
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ argparse@^1.0.7:
217217
dependencies:
218218
sprintf-js "~1.0.2"
219219

220+
argparse@^2.0.1:
221+
version "2.0.1"
222+
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
223+
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
224+
220225
arr-diff@^2.0.0:
221226
version "2.0.0"
222227
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
@@ -2440,6 +2445,13 @@ js-yaml@^3.13.1, js-yaml@^3.2.4, js-yaml@^3.3.1, js-yaml@^3.6.1, js-yaml@^3.9.1:
24402445
argparse "^1.0.7"
24412446
esprima "^4.0.0"
24422447

2448+
js-yaml@^4.1.0:
2449+
version "4.1.0"
2450+
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
2451+
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
2452+
dependencies:
2453+
argparse "^2.0.1"
2454+
24432455
json-parse-better-errors@^1.0.1:
24442456
version "1.0.2"
24452457
resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
@@ -5007,11 +5019,6 @@ yallist@^3.0.0, yallist@^3.1.1:
50075019
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
50085020
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
50095021

5010-
yaml@^2.1.1:
5011-
version "2.1.1"
5012-
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.1.tgz#1e06fb4ca46e60d9da07e4f786ea370ed3c3cfec"
5013-
integrity sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==
5014-
50155022
yargs@^3.32.0:
50165023
version "3.32.0"
50175024
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995"

0 commit comments

Comments
 (0)