Merge branch 'master' of github.com:yi-ge/blog-client
This commit is contained in:
commit
8e29b12d41
@ -107,7 +107,6 @@ export default {
|
|||||||
}, 3000)
|
}, 3000)
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
console.log(this.searchVal)
|
|
||||||
if (this.searchVal !== '') this.$router.push({ path: 'search?q=' + this.searchVal })
|
if (this.searchVal !== '') this.$router.push({ path: 'search?q=' + this.searchVal })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,11 @@ module.exports = {
|
|||||||
hid: 'description',
|
hid: 'description',
|
||||||
name: 'description',
|
name: 'description',
|
||||||
content: '一个全栈程序员的技术博客。'
|
content: '一个全栈程序员的技术博客。'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
hid: 'keywords',
|
||||||
|
name: 'keywords',
|
||||||
|
content: '轶哥,王轶,全栈,程序员,技术博客'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
link: [{
|
link: [{
|
||||||
|
34
package.json
34
package.json
@ -7,37 +7,37 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
|
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
|
||||||
"build": "nuxt build",
|
"build": "nuxt build",
|
||||||
"start": "cross-env NODE_ENV=production HOST=0.0.0.0 PORT=8888 node server/index.js",
|
"start": "cross-env NODE_ENV=production HOST=0.0.0.0 PORT=80 node server/index.js",
|
||||||
"generate": "nuxt generate",
|
"generate": "nuxt generate",
|
||||||
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --ignore-path .eslintignore .",
|
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --ignore-path .eslintignore .",
|
||||||
"precommit": "npm run lint"
|
"precommit": "npm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-svg-core": "^1.2.14",
|
"@fortawesome/fontawesome-svg-core": "^1.2.15",
|
||||||
"@fortawesome/free-brands-svg-icons": "^5.7.1",
|
"@fortawesome/free-brands-svg-icons": "^5.7.2",
|
||||||
"@fortawesome/free-regular-svg-icons": "^5.7.1",
|
"@fortawesome/free-regular-svg-icons": "^5.7.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "^5.7.1",
|
"@fortawesome/free-solid-svg-icons": "^5.7.2",
|
||||||
"@fortawesome/vue-fontawesome": "^0.1.5",
|
"@fortawesome/vue-fontawesome": "^0.1.5",
|
||||||
"@nuxtjs/axios": "^5.3.6",
|
"@nuxtjs/axios": "^5.4.0",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
"highlight.js": "^9.14.2",
|
"highlight.js": "^9.15.6",
|
||||||
"koa": "^2.6.2",
|
"koa": "^2.7.0",
|
||||||
"moment": "^2.24.0",
|
"moment": "^2.24.0",
|
||||||
"nuxt": "^2.3.4"
|
"nuxt": "^2.4.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxtjs/eslint-config": "^0.0.1",
|
"@nuxtjs/eslint-config": "^0.0.1",
|
||||||
"babel-eslint": "^8.2.1",
|
"babel-eslint": "^10.0.1",
|
||||||
"eslint": "^5.0.1",
|
"eslint": "^5.15.0",
|
||||||
"eslint-config-standard": ">=12.0.0",
|
"eslint-config-standard": ">=12.0.0",
|
||||||
"eslint-loader": "^2.0.0",
|
"eslint-loader": "^2.1.2",
|
||||||
"eslint-plugin-import": ">=2.14.0",
|
"eslint-plugin-import": ">=2.16.0",
|
||||||
"eslint-plugin-jest": ">=21.24.1",
|
"eslint-plugin-jest": "^22.3.0",
|
||||||
"eslint-plugin-node": ">=7.0.1",
|
"eslint-plugin-node": ">=8.0.1",
|
||||||
"eslint-plugin-promise": ">=4.0.1",
|
"eslint-plugin-promise": ">=4.0.1",
|
||||||
"eslint-plugin-standard": ">=4.0.0",
|
"eslint-plugin-standard": ">=4.0.0",
|
||||||
"eslint-plugin-vue": "^5.0.0",
|
"eslint-plugin-vue": "^5.2.2",
|
||||||
"nodemon": "^1.18.9",
|
"nodemon": "^1.18.10",
|
||||||
"pug": "^2.0.3",
|
"pug": "^2.0.3",
|
||||||
"pug-plain-loader": "^1.0.0",
|
"pug-plain-loader": "^1.0.0",
|
||||||
"stylus": "^0.54.5",
|
"stylus": "^0.54.5",
|
||||||
|
@ -26,10 +26,10 @@ div
|
|||||||
nuxt-link(:to="Articels.last ? '/post/' + Articels.last.ID : ''")
|
nuxt-link(:to="Articels.last ? '/post/' + Articels.last.ID : ''")
|
||||||
.btnFooter.btnPrevt(:style="'color: ' + (Articels.last ? '#333' : '#ccc')")
|
.btnFooter.btnPrevt(:style="'color: ' + (Articels.last ? '#333' : '#ccc')")
|
||||||
Icon(:icon="['fas', 'chevron-left']")
|
Icon(:icon="['fas', 'chevron-left']")
|
||||||
| 上一篇 {{ Articels.last ? '(' + decodeURIComponent(Articels.last.post_name) + ')' : ''}}
|
| 上一篇 {{ Articels.last ? '(' + decodeTitle(Articels.last.post_name) + ')' : ''}}
|
||||||
nuxt-link(:to="Articels.next ? '/post/' + Articels.next.ID : ''")
|
nuxt-link(:to="Articels.next ? '/post/' + Articels.next.ID : ''")
|
||||||
.btnFooter.btnNext(:style="'color: ' + (Articels.next ? '#333' : '#ccc')")
|
.btnFooter.btnNext(:style="'color: ' + (Articels.next ? '#333' : '#ccc')")
|
||||||
| 下一篇 {{ Articels.next ? '(' + decodeURIComponent(Articels.next.post_name) + ')' : ''}}
|
| 下一篇 {{ Articels.next ? '(' + decodeTitle(Articels.next.post_name) + ')' : ''}}
|
||||||
Icon(:icon="['fas', 'chevron-right']")
|
Icon(:icon="['fas', 'chevron-right']")
|
||||||
.comment
|
.comment
|
||||||
|
|
||||||
@ -98,7 +98,6 @@ export default {
|
|||||||
tocIdsTop.push(tTop)
|
tocIdsTop.push(tTop)
|
||||||
tocIdsTopMap.set(tTop, '#' + this.tocIds[n])
|
tocIdsTopMap.set(tTop, '#' + this.tocIds[n])
|
||||||
}
|
}
|
||||||
console.log(tocIdsTop)
|
|
||||||
|
|
||||||
const findInIds = (arr, num) => { for (let x = 0; x < arr.length; x++) { if (arr[x] > num) { return x - 1 } } }
|
const findInIds = (arr, num) => { for (let x = 0; x < arr.length; x++) { if (arr[x] > num) { return x - 1 } } }
|
||||||
|
|
||||||
@ -136,6 +135,60 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
decodeTitle(name) {
|
||||||
|
try {
|
||||||
|
return this.urldecode(name)
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
},
|
||||||
|
urldecode(encodedString) {
|
||||||
|
let output = encodedString
|
||||||
|
let binVal, thisString
|
||||||
|
const myregexp = /(%[^%]{2})/
|
||||||
|
function utf8to16(str) {
|
||||||
|
let c
|
||||||
|
let char2, char3
|
||||||
|
|
||||||
|
let out = ''
|
||||||
|
const len = str.length
|
||||||
|
let i = 0
|
||||||
|
while (i < len) {
|
||||||
|
c = str.charCodeAt(i++)
|
||||||
|
switch (c >> 4) {
|
||||||
|
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
|
||||||
|
out += str.charAt(i - 1)
|
||||||
|
break
|
||||||
|
case 12: case 13:
|
||||||
|
char2 = str.charCodeAt(i++)
|
||||||
|
out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F))
|
||||||
|
break
|
||||||
|
case 14:
|
||||||
|
char2 = str.charCodeAt(i++)
|
||||||
|
char3 = str.charCodeAt(i++)
|
||||||
|
out += String.fromCharCode(((c & 0x0F) << 12) |
|
||||||
|
((char2 & 0x3F) << 6) |
|
||||||
|
((char3 & 0x3F) << 0))
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
let match = null
|
||||||
|
while ((match = myregexp.exec(output)) != null &&
|
||||||
|
match.length > 1 &&
|
||||||
|
match[1] !== '') {
|
||||||
|
binVal = parseInt(match[1].substr(1), 16)
|
||||||
|
thisString = String.fromCharCode(binVal)
|
||||||
|
output = output.replace(match[1], thisString)
|
||||||
|
}
|
||||||
|
|
||||||
|
output = output.replace(/\\+/g, ' ')
|
||||||
|
output = utf8to16(output)
|
||||||
|
return output
|
||||||
|
},
|
||||||
articelRightTocClick() {
|
articelRightTocClick() {
|
||||||
const windowWidth = window.innerWidth || document.documentElement.clientWidth
|
const windowWidth = window.innerWidth || document.documentElement.clientWidth
|
||||||
if (windowWidth < 768) {
|
if (windowWidth < 768) {
|
||||||
|
13
push.sh
13
push.sh
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
if [ $1 ]; then
|
|
||||||
git add .
|
|
||||||
git commit -m $1
|
|
||||||
git push origin master
|
|
||||||
else
|
|
||||||
git add .
|
|
||||||
git commit -m "update - `date '+%Y-%m-%d %T'`"
|
|
||||||
git push origin master
|
|
||||||
fi
|
|
||||||
|
|
||||||
yarn run build
|
|
||||||
rsync -avr --delete-after --exclude ".git" . root@139.129.130.191:/root/site/wyrme && ssh root@139.129.130.191 'docker restart wyrme'
|
|
3
release.sh
Executable file
3
release.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
yarn run build
|
||||||
|
rsync -avr --delete-after --exclude ".git" . root@139.129.130.191:/root/site/blog-client && ssh root@139.129.130.191 'docker restart blog-client && docker restart blog-client1 && docker restart blog-client2 && docker restart blog-client3'
|
Loading…
Reference in New Issue
Block a user