Compare commits
51 Commits
v1.12.1-v1
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
a1cb764503 | |
|
|
e8fd9c7c82 | |
|
|
26fbc5a078 | |
|
|
77bdf60a33 | |
|
|
e438e31d4e | |
|
|
5c3393118c | |
|
|
91b52adcfc | |
|
|
3e9c399a74 | |
|
|
1e5042c61a | |
|
|
6bfc99dc50 | |
|
|
82938e5d71 | |
|
|
76f5b5435b | |
|
|
0989c4f9f5 | |
|
|
877e49e3e3 | |
|
|
99b3d4b6c9 | |
|
|
63588e1951 | |
|
|
93a033ddc7 | |
|
|
2a590518a8 | |
|
|
316cbf996e | |
|
|
85260f5cbe | |
|
|
70db98e0aa | |
|
|
97666191a4 | |
|
|
6dbd428d35 | |
|
|
21f74b4ff9 | |
|
|
87370e0be1 | |
|
|
a2b103c239 | |
|
|
d1876d35d6 | |
|
|
a086d6eba4 | |
|
|
039eafddab | |
|
|
597734c792 | |
|
|
35a032e268 | |
|
|
6c36c2d8be | |
|
|
ed4be73eb2 | |
|
|
83c002300c | |
|
|
d6d01e8581 | |
|
|
946319aa6d | |
|
|
d4be4e8679 | |
|
|
4b930d634b | |
|
|
3d09961b23 | |
|
|
df3fad4349 | |
|
|
47eaf6b34b | |
|
|
8c1d787797 | |
|
|
15cbf13723 | |
|
|
07f93f17b1 | |
|
|
1ac26b3189 | |
|
|
555d2fdf41 | |
|
|
9eee1524a0 | |
|
|
07eefcca83 | |
|
|
6a400169ca | |
|
|
5141505df0 | |
|
|
82c001732b |
|
|
@ -9,7 +9,7 @@ on:
|
|||
- master
|
||||
|
||||
env: # 设置环境变量
|
||||
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用时区时间)
|
||||
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用该时区时间)
|
||||
|
||||
jobs:
|
||||
build: # 自定义名称
|
||||
|
|
@ -17,20 +17,32 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
node-version: [18.x]
|
||||
|
||||
steps:
|
||||
- name: Checkout # 步骤1
|
||||
uses: actions/checkout@v1 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions
|
||||
- name: Use Node.js ${{ matrix.node-version }} # 步骤2
|
||||
uses: actions/setup-node@v1 # 作用:安装nodejs
|
||||
uses: actions/setup-node@v3 # 作用:安装nodejs
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }} # 版本
|
||||
- name: run deploy.sh # 步骤3
|
||||
env: # 设置环境变量
|
||||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
CODING_TOKEN: ${{ secrets.CODING_TOKEN }}
|
||||
run: npm install && npm run deploy
|
||||
|
||||
# 如只提交到github pages可以使用github-pages-deploy-action,详见: https://github.com/JamesIves/github-pages-deploy-action
|
||||
|
||||
- name: Build-and-deploy # 步骤3
|
||||
run: |
|
||||
remote_addr=`git remote get-url --push origin`
|
||||
commit_info=`git describe --all --always --long`
|
||||
user_name=`git log -1 --pretty=format:'%an'`
|
||||
user_email=`git log -1 --pretty=format:'%ae'`
|
||||
deploy_branch=gh-pages
|
||||
yarn
|
||||
yarn build
|
||||
cd docs/.vuepress/dist
|
||||
git config --global init.defaultBranch $deploy_branch
|
||||
git init
|
||||
git config user.name ${user_name}
|
||||
git config user.email ${user_email}
|
||||
git add -A
|
||||
git commit -m "auto deploy, $commit_info"
|
||||
remote_addr=`echo $remote_addr | awk -F'://' '{print $2}'`
|
||||
remote_addr=https://${user_name}:${{secrets.GITHUB_TOKEN}}@${remote_addr}
|
||||
git remote add origin ${remote_addr}
|
||||
git push origin HEAD:$deploy_branch --force # 推送到github $deploy_branch分支
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ node_modules
|
|||
|
||||
# yarn
|
||||
yarn.lock
|
||||
yarn-error.log
|
||||
|
||||
# pnpm
|
||||
pnpm-lock.yaml
|
||||
|
||||
# vscode
|
||||
|
|
|
|||
30
README.MD
30
README.MD
|
|
@ -1,4 +1,4 @@
|
|||
<p align="center"><a href="https://xugaoyi.com/" target="_blank" rel="noopener noreferrer"><img width="180" src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200409124835.png" alt="logo"></a></p>
|
||||
<p align="center"><a href="https://xugaoyi.com/" target="_blank" rel="noopener noreferrer"><img width="180" src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200409124835.png" alt="logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.npmjs.com/package/vuepress-theme-vdoing"><img alt="npm" src="https://img.shields.io/npm/v/vuepress-theme-vdoing"></a>
|
||||
|
|
@ -6,17 +6,26 @@
|
|||
<a href="https://github.com/xugaoyi/vuepress-theme-vdoing/stargazers"><img src="https://img.shields.io/github/stars/xugaoyi/vuepress-theme-vdoing?logo=ReverbNation&logoColor=rgba(255,255,255,.6)" alt="GitHub stars"></a>
|
||||
<a href="https://github.com/xugaoyi/vuepress-theme-vdoing/actions?query=workflow%3ACI"><img src="https://github.com/xugaoyi/vuepress-theme-vdoing/workflows/CI/badge.svg" alt="CI"></a>
|
||||
<a href="https://github.com/xugaoyi/vuepress-theme-vdoing/actions?query=workflow%3AbaiduPush"><img src="https://github.com/xugaoyi/vuepress-theme-vdoing/workflows/baiduPush/badge.svg" alt="baiduPush"></a>
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
<h2 align="center">vuepress-theme-vdoing</h2>
|
||||
|
||||
|
||||
|
||||
[文档](https://doc.xugaoyi.com/) |
|
||||
[效果](https://xugaoyi.com/) |
|
||||
[本仓库的gitee镜像](https://gitee.com/xugaoyi/vuepress-theme-vdoing)
|
||||
|
||||
<br/>
|
||||
<p align="center" style="color: #999;">
|
||||
赞助商
|
||||
</p>
|
||||
<p align="center">
|
||||
<!-- <a href="http://apifox.cn/a103xugaoyi" target="_blank"><img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/blog-gitalk-comment@master/img/Apifox-860x320.ic7tz1417sw.png" alt="赞助商" style="width: 400px;border-radius: 2px;"></a> -->
|
||||
<a href="http://apifox.cn/a103xugaoyi" target="_blank"><img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/blog-gitalk-comment@master/img/441669861566_.2bedplbm21hc.jpg" alt="赞助商" style="width: 400px;border-radius: 2px;"></a>
|
||||
</p>
|
||||
|
||||
<p align="center" style="color: #999; font-size:13px;">(进入赞助商扫码注册可为本项目作者充电~)</p>
|
||||
|
||||
## 介绍
|
||||
1. 这个主题的初衷是打造一个好用的、面向程序员的`知识管理工具`
|
||||
|
|
@ -48,12 +57,13 @@ npm install # or yarn install
|
|||
# develop
|
||||
npm run dev # or yarn dev
|
||||
```
|
||||
## ⚡️未来...
|
||||
|
||||
<!-- ## ⚡️未来...
|
||||
|
||||
|
||||
期待 [VuePress v2.0](https://github.com/vuepress/vuepress-next) 以及 [VitePress](https://github.com/vuejs/vitepress) 的正式发布...
|
||||
|
||||
届时,VuePress 1.x 编译慢的缺点将得到极大的改善。我将会视情况把主题升级至 VuePress v2.0 或 VitePress,也可能两个都升级。目前(2020.10.29)来看还需要一段时间才能让大家使用上基于它们的新版本,还希望大家多多 [:sparkling_heart:支持](https://doc.xugaoyi.com/pages/1b12ed/) 哟,持续关注吧~
|
||||
届时,VuePress 1.x 编译慢的缺点将得到极大的改善。我将会视情况把主题升级至 VuePress v2.0 或 VitePress,也可能两个都升级。目前(2020.10.29)来看还需要一段时间才能让大家使用上基于它们的新版本,还希望大家多多 [:sparkling_heart:支持](https://doc.xugaoyi.com/pages/1b12ed/) 哟,持续关注吧~ -->
|
||||
|
||||
## :sparkling_heart:支持这个项目
|
||||
|
||||
|
|
@ -69,7 +79,7 @@ npm run dev # or yarn dev
|
|||
|
||||
| 微信赞赏 | 微信 | 支付宝 |
|
||||
| :---: | :---: | :---: |
|
||||
| <img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200523131533.jpg" alt="赞赏码" width=150> | <img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200410113708.jpg" alt="Wechat QRcode" width=150>| <img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200410113707.jpg" alt="Alipay QRcode" width=150> |
|
||||
| <img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200523131533.jpg" alt="赞赏码" width=150> | <img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200410113708.jpg" alt="Wechat QRcode" width=150>| <img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200410113707.jpg" alt="Alipay QRcode" width=150> |
|
||||
|
||||
二维码没有正常显示?点 [这里😎](https://doc.xugaoyi.com/pages/1b12ed/)
|
||||
|
||||
|
|
@ -84,11 +94,11 @@ npm run dev # or yarn dev
|
|||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="middle">
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store2@master/img/mmqrcode1646409021986.5m4pb5hehz80.png" class="no-zoom" style="width:120px;margin: 10px;">
|
||||
<p>vdoing微信群(添加我的微信进群)</p>
|
||||
<img src="https://mmbiz.qpic.cn/sz_mmbiz_jpg/SaV6d0YfaAS0naAeQWibGVkSt6DxSaqGxdkJaeEqoJJ6M1NV1kq9aUqE3lGo7BuroTAoMg4rgibIIay1ibfvqXEiaA/0?wx_fmt=jpeg" class="no-zoom" style="width:120px;margin: 10px;">
|
||||
<p>vdoing微信群(添加我微信备注"加群")</p>
|
||||
</td>
|
||||
<td align="center" valign="middle">
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/qq.3ugglfuuwz00.webp" alt="群号: 694387113" class="no-zoom" style="width:120px;margin: 10px;">
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/qq.3ugglfuuwz00.webp" alt="群号: 694387113" class="no-zoom" style="width:120px;margin: 10px;">
|
||||
<p>vdoing QQ群: 694387113</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
39
deploy.sh
39
deploy.sh
|
|
@ -3,41 +3,22 @@
|
|||
# 确保脚本抛出遇到的错误
|
||||
set -e
|
||||
|
||||
|
||||
push_addr=`git remote get-url --push origin` # git提交地址,也可以手动设置,比如:push_addr=git@github.com:xugaoyi/vuepress-theme-vdoing.git
|
||||
commit_info=`git describe --all --always --long`
|
||||
dist_path=docs/.vuepress/dist # 打包生成的文件夹路径
|
||||
push_branch=gh-pages # 推送的分支
|
||||
|
||||
# 生成静态文件
|
||||
npm run build
|
||||
|
||||
# 进入生成的文件夹
|
||||
cd docs/.vuepress/dist
|
||||
cd $dist_path
|
||||
|
||||
# deploy to github pages
|
||||
echo 'b.xugaoyi.com' > CNAME
|
||||
|
||||
if [ -z "$GITHUB_TOKEN" ]; then
|
||||
msg='deploy'
|
||||
githubUrl=git@github.com:xugaoyi/vuepress-theme-vdoing.git
|
||||
else
|
||||
msg='来自github actions的自动部署'
|
||||
githubUrl=https://xugaoyi:${GITHUB_TOKEN}@github.com/xugaoyi/vuepress-theme-vdoing.git
|
||||
git config --global user.name "xugaoyi"
|
||||
git config --global user.email "894072666@qq.com"
|
||||
fi
|
||||
git init
|
||||
git add -A
|
||||
git commit -m "${msg}"
|
||||
git push -f $githubUrl master:gh-pages # 推送到github gh-pages分支
|
||||
|
||||
# deploy to coding pages
|
||||
# echo 'www.xugaoyi.com\nxugaoyi.com' > CNAME # 自定义域名
|
||||
# echo 'google.com, pub-7828333725993554, DIRECT, f08c47fec0942fa0' > ads.txt # 谷歌广告相关文件
|
||||
|
||||
# if [ -z "$CODING_TOKEN" ]; then # -z 字符串 长度为0则为true;$CODING_TOKEN来自于github仓库`Settings/Secrets`设置的私密环境变量
|
||||
# codingUrl=git@e.coding.net:xgy/xgy.git
|
||||
# else
|
||||
# codingUrl=https://HmuzsGrGQX:${CODING_TOKEN}@e.coding.net/xgy/xgy.git
|
||||
# fi
|
||||
# git add -A
|
||||
# git commit -m "${msg}"
|
||||
# git push -f $codingUrl master # 推送到coding
|
||||
git commit -m "deploy, $commit_info"
|
||||
git push -f $push_addr HEAD:$push_branch
|
||||
|
||||
cd -
|
||||
rm -rf docs/.vuepress/dist
|
||||
rm -rf $dist_path
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ import dayjs from 'dayjs'
|
|||
import baiduCode from './config/baiduCode' // 百度统计hm码
|
||||
import htmlModules from './config/htmlModules' // 自定义插入的html块
|
||||
|
||||
const DOMAIN_NAME = 'xugaoyi.com' // 域名 (不带https)
|
||||
const WEB_SITE = `https://${DOMAIN_NAME}` // 网址
|
||||
|
||||
export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
||||
theme: 'vdoing', // 使用npm主题包
|
||||
// theme: resolve(__dirname, '../../vdoing'), // 使用本地主题包
|
||||
|
|
@ -134,9 +137,9 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
|||
// pageStyle: 'line', // 页面风格,可选值:'card'卡片 | 'line' 线(未设置bodyBgImg时才生效), 默认'card'。 说明:card时背景显示灰色衬托出卡片样式,line时背景显示纯色,并且部分模块带线条边框
|
||||
|
||||
// bodyBgImg: [
|
||||
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175828.jpeg',
|
||||
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175845.jpeg',
|
||||
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175846.jpeg'
|
||||
// 'https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200507175828.jpeg',
|
||||
// 'https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200507175845.jpeg',
|
||||
// 'https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200507175846.jpeg'
|
||||
// ], // body背景大图,默认无。 单张图片 String | 多张图片 Array, 多张图片时隔bodyBgImgInterval切换一张。
|
||||
// bodyBgImgOpacity: 0.5, // body背景图透明度,选值 0.1~1.0, 默认0.5
|
||||
// bodyBgImgInterval: 15, // body多张背景图时的切换间隔, 默认15,单位s
|
||||
|
|
@ -148,7 +151,7 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
|||
// contentBgStyle: 1, // 文章内容块的背景风格,默认无. 1 方格 | 2 横线 | 3 竖线 | 4 左斜线 | 5 右斜线 | 6 点状
|
||||
|
||||
// updateBar: { // 最近更新栏
|
||||
// showToArticle: false, // 显示到文章页底部,默认true
|
||||
// showToArticle: true, // 显示到文章页底部,默认true
|
||||
// moreArticle: '/archives' // “更多文章”跳转的页面,默认'/archives'
|
||||
// },
|
||||
// rightMenuBar: false, // 是否显示右侧文章大纲栏,默认true (屏宽小于1300px下无论如何都不显示)
|
||||
|
|
@ -169,7 +172,7 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
|||
|
||||
// 博主信息 (显示在首页侧边栏)
|
||||
blogger: {
|
||||
avatar: 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg',
|
||||
avatar: 'https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200103123203.jpg',
|
||||
name: 'Evan Xu',
|
||||
slogan: '前端界的小学生',
|
||||
},
|
||||
|
|
@ -200,7 +203,7 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
|||
footer: {
|
||||
createYear: 2019, // 博客创建年份
|
||||
copyrightInfo:
|
||||
'Evan Xu | <a href="https://github.com/xugaoyi/vuepress-theme-vdoing/blob/master/LICENSE" target="_blank">MIT License</a>', // 博客版权信息,支持a标签或换行标签</br>
|
||||
'Evan Xu | <a href="https://github.com/xugaoyi/vuepress-theme-vdoing/blob/master/LICENSE" target="_blank">MIT License</a>', // 博客版权信息、备案信息等,支持a标签或换行标签</br>
|
||||
},
|
||||
|
||||
// 扩展自动生成frontmatter。(当md文件的frontmatter不存在相应的字段时将自动添加。不会覆盖已有的数据。)
|
||||
|
|
@ -240,6 +243,12 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
|||
|
||||
// 插件配置
|
||||
plugins: <UserPlugins>[
|
||||
[
|
||||
"sitemap", // 网站地图
|
||||
{
|
||||
hostname: WEB_SITE,
|
||||
},
|
||||
],
|
||||
|
||||
'vuepress-plugin-baidu-autopush', // 百度自动推送
|
||||
|
||||
|
|
@ -277,7 +286,7 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
|||
},
|
||||
{
|
||||
title: '通过百度搜索本站的',
|
||||
frontUrl: 'https://www.baidu.com/s?wd=site%3Axugaoyi.com%20',
|
||||
frontUrl: `https://www.baidu.com/s?wd=site%3A${DOMAIN_NAME}%20`,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
@ -299,7 +308,7 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
|||
settings: {
|
||||
// jsLib: ['http://xxx'], // 在线示例(jsfiddle, codepen)中的js依赖
|
||||
// cssLib: ['http://xxx'], // 在线示例中的css依赖
|
||||
// vue: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖
|
||||
// vue: 'https://jsd.cdn.zzko.cn/npm/vue/dist/vue.min.js', // 在线示例中的vue依赖
|
||||
jsfiddle: false, // 是否显示 jsfiddle 链接
|
||||
codepen: true, // 是否显示 codepen 链接
|
||||
horizontal: false, // 是否展示为横向样式
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
b.xugaoyi.com
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 263 KiB |
|
|
@ -2,7 +2,7 @@
|
|||
pageComponent:
|
||||
name: Catalogue
|
||||
data:
|
||||
key: 01.前端
|
||||
path: 01.前端
|
||||
imgUrl: /img/web.png
|
||||
description: JavaScript、ES6、Vue框架等前端技术
|
||||
title: 前端
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
pageComponent:
|
||||
name: Catalogue
|
||||
data:
|
||||
key: 02.页面
|
||||
path: 02.页面
|
||||
imgUrl: /img/ui.png
|
||||
description: html(5)/css(3),前端页面相关技术
|
||||
title: 页面
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
pageComponent:
|
||||
name: Catalogue
|
||||
data:
|
||||
key: 03.技术
|
||||
path: 03.技术
|
||||
imgUrl: /img/other.png
|
||||
description: 技术文档、教程、技巧、总结等文章
|
||||
title: 技术
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
pageComponent:
|
||||
name: Catalogue
|
||||
data:
|
||||
key: 04.更多
|
||||
path: 04.更多
|
||||
imgUrl: /img/more.png
|
||||
description: 学习、面试、在线工具等更多文章和页面
|
||||
title: 更多
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
title: 将一维数组按指定长度转为二维数组
|
||||
date: 2020-02-23 13:49:31
|
||||
permalink: /pages/f1acb712033ac8da
|
||||
categories:
|
||||
categories:
|
||||
- 前端
|
||||
- JavaScript文章
|
||||
tags:
|
||||
tags:
|
||||
- null
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -38,7 +38,7 @@ console.log(pages(arr, 8)) // [[1, 2, 3, 4, 5, 6, 7, 8], [9]]
|
|||
|
||||
如图,按需求,图标模块中的图标个数是不确定的,每页最多显示8个,超出8个的显示到第二页,实现向左滑动翻页。提供的数据是一个一维数组,这时就可以使用上面的代码按长度为8转为二维数组,再分页渲染到页面。
|
||||
|
||||

|
||||

|
||||
|
||||
```html
|
||||
<template>
|
||||
|
|
@ -75,4 +75,3 @@ console.log(pages(arr, 8)) // [[1, 2, 3, 4, 5, 6, 7, 8], [9]]
|
|||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ pageComponent:
|
|||
name: Catalogue
|
||||
data:
|
||||
path: 《JavaScript教程》笔记
|
||||
imgUrl: https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200112120340.png
|
||||
imgUrl: https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200112120340.png
|
||||
description: 本章内容为博主在原教程基础上添加学习笔记,教程版权归原作者所有。来源:<a href='https://wangdoc.com/javascript/' target='_blank'>JavaScript教程</a>
|
||||
title: 《JavaScript教程》笔记
|
||||
date: 2020-01-12 11:51:53
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ pageComponent:
|
|||
name: Catalogue
|
||||
data:
|
||||
path: 《ES6 教程》笔记
|
||||
imgUrl: https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200112160453.png
|
||||
imgUrl: https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200112160453.png
|
||||
description: 本章内容为博主在原教程基础上添加学习笔记,教程版权归原作者所有。来源:<a href='https://es6.ruanyifeng.com/' target='_blank'>ES6教程</a>
|
||||
title: 《ES6 教程》笔记
|
||||
date: 2020-01-12 15:49:22
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ pageComponent:
|
|||
name: Catalogue
|
||||
data:
|
||||
path: 《Vue》笔记
|
||||
imgUrl: https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200204143633.png
|
||||
imgUrl: https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200204143633.png
|
||||
description: 本章内容是博主的Vue学习笔记,非教程文档,请以官方文档为准。
|
||||
title: 《Vue》笔记
|
||||
date: 2020-02-04 12:16:12
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ pageComponent:
|
|||
name: Catalogue
|
||||
data:
|
||||
path: 《TypeScript 从零实现 axios》
|
||||
imgUrl: https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200105104632.png
|
||||
imgUrl: https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200105104632.png
|
||||
description: 学习使用 TypeScript 从零实现 axios 库
|
||||
title: 《TypeScript 从零实现 axios》
|
||||
date: 2020-01-05 10:40:48
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
title: TypeScript笔记
|
||||
date: 2020-10-08 13:02:48
|
||||
permalink: /pages/51afd6/
|
||||
categories:
|
||||
categories:
|
||||
- 前端
|
||||
- 学习笔记
|
||||
tags:
|
||||
tags:
|
||||
- TypeScript
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -76,6 +76,35 @@ const someValue:any = 'abc'
|
|||
const strLength:number = (someValue as string).length // 断言someValue是字符串类型
|
||||
```
|
||||
|
||||
### 类型断言
|
||||
|
||||
```typescript
|
||||
const el = document.querySelector('#img');
|
||||
(el as HTMLImageElement).src = 'xx' // 断言el就是图片元素类型
|
||||
|
||||
|
||||
// 对象内的类型断言
|
||||
type TestObj = {
|
||||
a: string
|
||||
};
|
||||
const obj = {
|
||||
test: <TestObj>{
|
||||
a: 'aaa'
|
||||
}
|
||||
}
|
||||
|
||||
// 或者
|
||||
const obj = {
|
||||
test: {
|
||||
a: 'aaa'
|
||||
} as TestObj ,
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### 对象的类型
|
||||
|
||||
```typescript
|
||||
|
|
@ -138,7 +167,75 @@ function add({ one, two }: {one: number, two: number}) {
|
|||
}
|
||||
|
||||
const total = add({one: 1, two: 2})
|
||||
|
||||
// 类型别名方式定义函数类型
|
||||
type Callback = (a: string) => string
|
||||
let fn: Callback = (a) => ''
|
||||
|
||||
// 接口方式定义函数类型
|
||||
interface ICallBack {
|
||||
(a: string): string
|
||||
}
|
||||
let fn1: ICallBack = (a) => ''
|
||||
```
|
||||
#### 函数中的this类型
|
||||
|
||||
```typescript
|
||||
interface TestObj {
|
||||
a: number,
|
||||
fn: (x: number) => void
|
||||
}
|
||||
|
||||
// 普通函数的this
|
||||
let obj: TestObj = {
|
||||
a: 1,
|
||||
fn(this: TestObj, x: number){ // 注意这里的this非参数,只是给this类型注解。x还是第一个参数
|
||||
this.a
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 箭头函数的this (this是固定指向当前声明函数所在的作用域)
|
||||
let obj2: TestObj = {
|
||||
a: 1,
|
||||
fn(this: TestObj, x: number) {
|
||||
return () => {
|
||||
this.a
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
#### 函数重载 (函数参数间的组合约定)
|
||||
|
||||
原生js中并没有真正的函数重载,重名函数会被覆盖,但ts中可以有。
|
||||
|
||||
> [浅谈JavaScript函数重载](https://www.cnblogs.com/yugege/p/5539020.html)
|
||||
|
||||
ts支持函数重载,一般用于针对传入不同的参数或参数数量以及返回值之间的类型约定。
|
||||
|
||||
```typescript
|
||||
// 第一套约定(attr是'display'时,value必须是 'block' | 'nonde')
|
||||
function showOrHide(ele: HTMLElement, attr: 'display', value: 'block' | 'nonde');
|
||||
// 第二套约定(attr是'opacity'时,value必须是number)
|
||||
function showOrHide(ele: HTMLElement, attr: 'opacity', value: number);
|
||||
// 函数的实现
|
||||
function showOrHide(ele: HTMLElement, attr: any, value: any) {
|
||||
// ...
|
||||
}
|
||||
|
||||
// interface也可以声明函数重载
|
||||
interface Fn{
|
||||
(name: string): string
|
||||
(name: number): number
|
||||
}
|
||||
const fn: Fn= () =>
|
||||
|
||||
```
|
||||
|
||||
更多 [ts函数重载知识](https://zhuanlan.zhihu.com/p/496792140)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -408,6 +505,87 @@ class SeniorTeacher extends Girls{
|
|||
|
||||
|
||||
|
||||
```typescript
|
||||
// abstract关键字标注为抽象类(没有具体实现,不能用new实例化。子类继承该抽象类必须实现相应方法,用于规范子类)
|
||||
abstract class Component<T1, T2> {
|
||||
props: T1;
|
||||
state: T2;
|
||||
|
||||
constructor(props: T1) {
|
||||
this.props = props
|
||||
}
|
||||
|
||||
// 用abstract标注为抽象类的方法,不能有具体实现
|
||||
abstract render(): string
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 规范类的props和state
|
||||
interface Props {
|
||||
val: number
|
||||
}
|
||||
interface State {
|
||||
x: number
|
||||
}
|
||||
|
||||
// 规范类内部的方法
|
||||
interface Log {
|
||||
getInfo(): string
|
||||
}
|
||||
interface Save {
|
||||
save(): void
|
||||
}
|
||||
|
||||
// <Props, State>通过泛型传入类型. implements 关键字使当前类必须要履行 Log,Storage 接口内定于的契约
|
||||
class MyComponent extends Component<Props, State> implements Log, Save {
|
||||
constructor(props: Props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
x: 1
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
// this.props.val
|
||||
// this.state.x
|
||||
return '<MyComponent>'
|
||||
}
|
||||
|
||||
getInfo(): string {
|
||||
return ''
|
||||
}
|
||||
save() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const myComponent = new MyComponent({ val: 1 })
|
||||
myComponent.render()
|
||||
|
||||
|
||||
/**
|
||||
* 类中的接口使用implements关键字
|
||||
* 1. 如果一个类implements了一个接口,那么就必须实现该接口中定义的契约
|
||||
* 2. 多个接口使用逗号分隔
|
||||
* 3. implements与extends可以同时存在
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* TS中类和接口知识点
|
||||
* 1. 抽象类在编译后会产生实体代码,接口不会
|
||||
* 2. TS只支持继承,即一个子类之能有一个父类
|
||||
* 3. 接口不能有实现,抽象类可以有属性的实现,没有方法实现
|
||||
*/
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 联合类型和类型保护
|
||||
|
||||
**联合类型** 指某个参数可以是多种类型。
|
||||
|
|
@ -583,6 +761,198 @@ console.log(selectGirl2.getGirl(1))
|
|||
|
||||
|
||||
|
||||
## 类型保护
|
||||
|
||||
我们通常在 JavaScript 中通过判断来处理⼀些逻辑,在 TypeScript 中这种条件语句块还有另外⼀
|
||||
|
||||
个特性:根据判断逻辑的结果,缩⼩类型范围(有点类似断⾔),这种特性称为 类型保护 ,触发条
|
||||
|
||||
件:
|
||||
|
||||
- 逻辑条件语句块:if、else、elseif
|
||||
|
||||
- 特定的⼀些关键字:typeof、instanceof、in
|
||||
|
||||
#### typeof
|
||||
|
||||
```typescript
|
||||
function fn(a: string|number) {
|
||||
// error,不能保证 a 就是字符串
|
||||
a.substring(1);
|
||||
if (typeof a === 'string') {
|
||||
// ok
|
||||
a.substring(1);
|
||||
} else {
|
||||
// ok
|
||||
a.toFixed(1);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### instanceof
|
||||
|
||||
```typescript
|
||||
function fn(a: Date|Array<any>) {
|
||||
if (a instanceof Array) {
|
||||
a.push(1);
|
||||
} else {
|
||||
a.getFullYear();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### in
|
||||
|
||||
```typescript
|
||||
interface IA {
|
||||
x: string;
|
||||
y: string; }
|
||||
interface IB {
|
||||
a: string;
|
||||
b: string; }
|
||||
function fn(arg: IA | IB) {
|
||||
if ('x' in arg) {
|
||||
// ok
|
||||
arg.x;
|
||||
// error
|
||||
arg.a;
|
||||
} else {
|
||||
// ok
|
||||
arg.a;
|
||||
// error
|
||||
字⾯量类型保护
|
||||
如果类型为字⾯量类型,那么还可以通过该字⾯量类型的字⾯值进⾏推断
|
||||
⾃定义类型保护
|
||||
有的时候,以上的⼀些⽅式并不能满⾜⼀些特殊情况,则可以⾃定义类型保护规则
|
||||
arg.x;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 字面量类型保护
|
||||
|
||||
```typescript
|
||||
interface IA {
|
||||
type: 'IA';
|
||||
x: string;
|
||||
y: string;
|
||||
}
|
||||
interface IB {
|
||||
type: 'IB';
|
||||
a: string;
|
||||
b: string;
|
||||
}
|
||||
function fn(arg: IA | IB) {
|
||||
if (arg.type === 'IA') {
|
||||
// ok
|
||||
arg.x;
|
||||
// error
|
||||
arg.a;
|
||||
} else {
|
||||
// ok
|
||||
arg.a;
|
||||
// error
|
||||
arg.x;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 自定义类型保护
|
||||
|
||||
```typescript
|
||||
function canEach(data: any): data is Element[]|NodeList {
|
||||
return data.forEach !== undefined;
|
||||
}
|
||||
function fn2(elements: Element[]|NodeList|Element) {
|
||||
if ( canEach(elements) ) {
|
||||
elements.forEach((el: Element)=>{
|
||||
el.classList.add('box');
|
||||
});
|
||||
} else {
|
||||
elements.classList.add('box');
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`data is Element[]|NodeList` 是⼀种类型谓词,格式为: `xx is XX` ,返回这种类型的函数就可以
|
||||
|
||||
被 TypeScript 识别为类型保护
|
||||
|
||||
|
||||
|
||||
## 类型操作
|
||||
|
||||
#### typeof
|
||||
|
||||
获取数据的类型
|
||||
|
||||
```typescript
|
||||
let str = 'kkk'
|
||||
|
||||
let t = typeof str // 使用typeof获取str的类型,返回string给变量t (原生js的typeof使用)
|
||||
|
||||
type myType = typeof str // 使用typeof获取str的类型,返回string给类型myType (TS的typeof使用)
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### keyof
|
||||
|
||||
获取类型的所有`key`的集合
|
||||
|
||||
```typescript
|
||||
// 使用示例1
|
||||
interface Person{
|
||||
name: string;
|
||||
age: number;
|
||||
}
|
||||
|
||||
type PersonKeys = keyof Person
|
||||
// 等同: type PersonKeys = 'name' | 'age'; // 注意是key的集合,不是值的集合
|
||||
```
|
||||
|
||||
```typescript
|
||||
// 使用示例2
|
||||
let p1 = {
|
||||
name: 'xx',
|
||||
age: 28
|
||||
}
|
||||
|
||||
// keyof typeof p1 的作用,首先typeof将p1对象的类型取出,keyof再将类型的key集合取出,结果:'name' | 'age'
|
||||
function getPersonVal(k: keyof typeof p1){
|
||||
return p1[k]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### in
|
||||
|
||||
内部使用`for...in`对类型进行遍历
|
||||
|
||||
```typescript
|
||||
interface Person{
|
||||
name: string;
|
||||
age: number;
|
||||
}
|
||||
|
||||
type PersonKeys = keyof Person; // 'name' | 'age'
|
||||
type NewPerson = {
|
||||
[k in PersonKeys]: string
|
||||
// 也可写成 [k in 'name' | 'age']: string
|
||||
// 或 [k in keyof Person]: string
|
||||
} // {name: string; age: string;}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
title: 常用meta整理
|
||||
date: 2020-02-21 12:20:10
|
||||
permalink: /pages/8309a5b876fc95e3
|
||||
categories:
|
||||
categories:
|
||||
- 页面
|
||||
- HTML
|
||||
tags:
|
||||
tags:
|
||||
- null
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -57,9 +57,9 @@ meta标签提供关于HTML文档的元数据。元数据不会显示在页面上
|
|||
- **浏览器内核控制**:国内浏览器很多都是双内核(webkit和Trident),webkit内核高速浏览,IE内核兼容网页和旧版网站。而添加meta标签的网站可以控制浏览器选择何种内核渲染。[参考文档](http://se.360.cn/v6/help/meta.html)
|
||||
|
||||
```html
|
||||
默认用极速核(Chrome):<meta name="renderer" content="webkit">
|
||||
默认用ie兼容内核(IE6/7):<meta name="renderer" content="ie-comp">
|
||||
默认用ie标准内核(IE9/IE10/IE11/取决于用户的IE):<meta name="renderer" content="ie-stand">
|
||||
默认用极速核(Chrome):<meta name="renderer" content="webkit">
|
||||
默认用ie兼容内核(IE6/7):<meta name="renderer" content="ie-comp">
|
||||
默认用ie标准内核(IE9/IE10/IE11/取决于用户的IE):<meta name="renderer" content="ie-stand">
|
||||
```
|
||||
|
||||
国内双核浏览器默认内核模式如下:
|
||||
|
|
@ -176,7 +176,7 @@ url="url" 后者代表当前PC页所对应的手机页URL,两者必须是一
|
|||
<meta name="theme-color" content="#11a8cd">
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
- **隐藏状态栏/设置状态栏颜色**:只有在开启WebApp全屏模式时才生效。content的值为default | black | black-translucent 。
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ url="url" 后者代表当前PC页所对应的手机页URL,两者必须是一
|
|||
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
- **其他** [参考文档](http://fex.baidu.com/blog/2014/10/html-head-tags/?qq-pf-to=pcqq.c2c)
|
||||
|
||||
|
|
@ -242,4 +242,3 @@ url="url" 后者代表当前PC页所对应的手机页URL,两者必须是一
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimun-scale=1.0,maximum-scale=1.0,user-scalable=no">
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ author:
|
|||
# 如何根据系统主题自动响应CSS深色模式
|
||||
|
||||
<p align="center">
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200427163531.jpg" width="500">
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200427163531.jpg" width="500">
|
||||
</p>
|
||||
|
||||
很多人喜欢选择APP或网站中的深色模式,也许他们更喜欢这样的外观,或者他们想让自己的眼睛免受疲劳。这篇文章将告诉你如何在网站中实现一个自动的CSS深色模式,根据访客的系统主题来自动响应。
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
title: CSS-function汇总
|
||||
date: 2020-05-12 09:36:44
|
||||
permalink: /pages/3da0d7
|
||||
categories:
|
||||
categories:
|
||||
- 页面
|
||||
- CSS
|
||||
tags:
|
||||
tags:
|
||||
- null
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||

|
||||

|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
title: CSS给table的tbody添加滚动条
|
||||
date: 2022-06-29 09:34:23
|
||||
permalink: /pages/55f894/
|
||||
categories:
|
||||
- 页面
|
||||
- CSS
|
||||
tags:
|
||||
-
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
||||
```css
|
||||
table tbody {
|
||||
height: 200px;
|
||||
overflow-y: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
table thead,
|
||||
tbody tr {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
title: 网格布局中的动画
|
||||
date: 2023-09-15 17:30:57
|
||||
permalink: /pages/b35f63/
|
||||
categories:
|
||||
- 页面
|
||||
- CSS
|
||||
tags:
|
||||
-
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
<iframe height="567.2890625" style="width: 100%;" scrolling="no" title="网格布局中的动画" src="https://codepen.io/xugaoyi/embed/zYydzWQ?default-tab=html%2Cresult" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
|
||||
See the Pen <a href="https://codepen.io/xugaoyi/pen/zYydzWQ">
|
||||
Untitled</a> by xugaoyi (<a href="https://codepen.io/xugaoyi">@xugaoyi</a>)
|
||||
on <a href="https://codepen.io">CodePen</a>.
|
||||
</iframe>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
title: Git修改分支名
|
||||
date: 2022-08-11 10:51:18
|
||||
permalink: /pages/922650/
|
||||
categories:
|
||||
- 技术
|
||||
- 技术文档
|
||||
tags:
|
||||
-
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
||||
## 同时修改本地分支名和对应的远程分支名
|
||||
|
||||
修改前要确保本地分支的代码是最新的,并且修改后不会影响到同事的代码。
|
||||
|
||||
1. 修改本地分支名
|
||||
```sh
|
||||
git branch -m oldBranchName newBranchName
|
||||
```
|
||||
|
||||
2. 删除远程分支
|
||||
```sh
|
||||
git push origin :oldBranchName
|
||||
# 或者 git push origin --delete oldBranchName
|
||||
```
|
||||
|
||||
3. 改名后的本地分支推送到远程
|
||||
|
||||
```sh
|
||||
git push --set-upstream origin newBranchName
|
||||
```
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
title: GitHub Actions 实现自动部署静态博客
|
||||
date: 2019-12-27 11:44:41
|
||||
permalink: /pages/6b9d359ec5aa5019
|
||||
categories:
|
||||
categories:
|
||||
- 技术
|
||||
- GitHub技巧
|
||||
tags:
|
||||
tags:
|
||||
- null
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -35,19 +35,19 @@ coding pages在国内的访问速度比github pages要快很多,而且还可
|
|||
|
||||
然后,将这两个token同时储存到github仓库的`Settings/Secrets`里面。变量名可以随便取,但是注意要和后面的`ci.yml`文件内的变量名一致,这里取的是`ACCESS_TOKEN`和`CODING_TOKEN`。
|
||||
|
||||

|
||||

|
||||
|
||||
GitHub Actions 的配置文件叫做 workflow 文件,存放在代码仓库的`.github/workflows`目录。
|
||||
|
||||
workflow 文件采用 [YAML 格式](https://xugaoyi.com/pages/4e8444e2d534d14f/),文件名可以任意取,但是后缀名统一为`.yml`,比如`ci.yml`。一个库可以有多个 workflow 文件。GitHub 只要发现`.github/workflows`目录里面有`.yml`文件,就会自动运行该文件。
|
||||
workflow 文件采用 [YAML 格式](https://xugaoyi.com/pages/4e8444e2d534d14f/),文件名可以任意取,但是后缀名统一为`.yml`,比如`ci.yml`。一个库可以有多个 workflow 文件。GitHub 只要发现`.github/workflows`目录里面有`.yml`文件,就会自动运行该文件。
|
||||
|
||||
我的`ci.yml`文件:
|
||||
我的`ci.yml`文件:
|
||||
|
||||
```yaml
|
||||
name: CI
|
||||
|
||||
# 在master分支发生push事件时触发。
|
||||
on:
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
|
@ -59,7 +59,7 @@ jobs: # 工作流
|
|||
matrix:
|
||||
node-version: [10.x]
|
||||
|
||||
steps:
|
||||
steps:
|
||||
- name: Checkout # 步骤1
|
||||
uses: actions/checkout@v1 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions
|
||||
- name: Use Node.js ${{ matrix.node-version }} # 步骤2
|
||||
|
|
@ -70,7 +70,7 @@ jobs: # 工作流
|
|||
env: # 设置环境变量
|
||||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} # toKen私密变量
|
||||
CODING_TOKEN: ${{ secrets.CODING_TOKEN }} # 腾讯云开发者平台(coding)私密token
|
||||
run: npm install && npm run deploy # 执行的命令
|
||||
run: npm install && npm run deploy # 执行的命令
|
||||
# package.json 中添加 "deploy": "bash deploy.sh"
|
||||
```
|
||||
|
||||
|
|
@ -139,11 +139,10 @@ rm -rf docs/.vuepress/dist
|
|||
|
||||
如下你想查看部署日志,你可以到github仓库的Actions这一项查看。
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
## 相关文章
|
||||
|
||||
[《GitHub Actions 定时运行代码:每天定时百度链接推送》](https://xugaoyi.com/pages/f44d2f9ad04ab8d3/)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
title: GitHub Actions 定时运行代码:每天定时百度链接推送
|
||||
date: 2019-12-30 21:23:00
|
||||
permalink: /pages/f44d2f9ad04ab8d3
|
||||
categories:
|
||||
categories:
|
||||
- 技术
|
||||
- GitHub技巧
|
||||
tags:
|
||||
tags:
|
||||
- github
|
||||
- 博客
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -26,11 +26,11 @@ GitHub Actions 是一个 CI/CD(持续集成/持续部署)工具,但也可
|
|||
|
||||
链接主动推送在百度站长中有介绍,如图。
|
||||
|
||||

|
||||

|
||||
|
||||
具体使用方法就是创建一个文件`urls.txt`,文件内每行一条链接的格式写入提交的多个链接,如图。
|
||||
|
||||

|
||||

|
||||
|
||||
运行命令
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ function main() {
|
|||
const files = readFileList(); // 读取所有md文件数据
|
||||
|
||||
files.forEach( file => {
|
||||
const { data } = matter(fs.readFileSync(file.filePath, 'utf8'));
|
||||
const { data } = matter(fs.readFileSync(file.filePath, 'utf8'));
|
||||
|
||||
if (data.permalink) {
|
||||
const link = `\r\n${DOMAIN}${data.permalink}/`;
|
||||
|
|
@ -111,7 +111,7 @@ GitHub Actions 是一个 CI/CD(持续集成/持续部署)工具,但也可
|
|||
```sh
|
||||
## baiduPush.yml
|
||||
name: 'baiduPush'
|
||||
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
|
|
@ -177,7 +177,7 @@ rm -rf urls.txt # 灭迹
|
|||
|
||||
|
||||
|
||||
写好配置,推送到仓库,就会在每天的早上7点钟,自动运行命令生成一个包含博客所有页面链接的`urls.txt`文件,并把所有链接一次性推送到百度。麻麻再也不用担心我的网站不被收录~~:kissing_heart: :kissing_heart: :kissing_heart:
|
||||
写好配置,推送到仓库,就会在每天的早上7点钟,自动运行命令生成一个包含博客所有页面链接的`urls.txt`文件,并把所有链接一次性推送到百度。麻麻再也不用担心我的网站不被收录~~:kissing_heart: :kissing_heart: :kissing_heart:
|
||||
|
||||
在这个基础上可以扩展,使用GitHub Actions满足你自己的各种定时需求。
|
||||
|
||||
|
|
@ -188,6 +188,3 @@ rm -rf urls.txt # 灭迹
|
|||
[《 GitHub Actions 实现自动部署静态博客》](https://xugaoyi.com/pages/6b9d359ec5aa5019/)
|
||||
|
||||
[《解决百度无法收录搭建在GitHub上的静态博客的问题》](https://xugaoyi.com/pages/41f87d890d0a02af/)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
title: GitHub加速下载项目的方法
|
||||
date: 2020-03-09 10:28:09
|
||||
permalink: /pages/95331c6a9613faf8
|
||||
categories:
|
||||
categories:
|
||||
- 技术
|
||||
- GitHub技巧
|
||||
tags:
|
||||
tags:
|
||||
- null
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -17,7 +17,7 @@ author:
|
|||
|
||||
<!-- more -->
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
|
|
@ -27,17 +27,17 @@ author:
|
|||
|
||||
2. 登录码云之后在页面右上角的加号选择`从GitHub/GitLab导入项目`
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
3. 选择`从URL导入`,粘贴从GitHub复制来的仓库地址,然后导入,这个导入过程一般是很快的。
|
||||
|
||||

|
||||

|
||||
|
||||
4. 从码云克隆刚导入的这个项目,克隆速度会快很多,网速好的能达到几兆每秒(具体速度就看你的网速了,吐槽一下我家网速,总在关键时刻显示"视频加载中"....)
|
||||
|
||||

|
||||

|
||||
|
||||
5. 另外要注意的一点,克隆下来的项目关联的是码云的仓库,如果你需要关联github仓库需要更改远程仓库。
|
||||
|
||||
|
|
@ -50,4 +50,3 @@ author:
|
|||
|
||||
|
||||
这个方法适合用于克隆比较大的项目,如果克隆小项目,20k/s的速度好像还能将就~~
|
||||
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ A:`jsDelivr`是国外的一家优秀的公共 CDN 服务提供商,该平台
|
|||
* 分支名:填写主分支`master`即可
|
||||
* Token:前面生成的token密钥
|
||||
* 存储路径:按你自己的需求填写
|
||||
* 自定义域名:图片上传后,PicGo 会按照 `自定义域名+上传的图片名` 的方式生成访问链接,此处我们填写`jsDelivr`的CDN加速地址,格式:`https://cdn.jsdelivr.net/gh/<用户名>/<仓库名>`
|
||||
* 自定义域名:图片上传后,PicGo 会按照 `自定义域名+上传的图片名` 的方式生成访问链接,此处我们填写`jsDelivr`的CDN加速地址,格式:`https://jsd.cdn.zzko.cn/gh/<用户名>/<仓库名>`
|
||||
|
||||

|
||||

|
||||
|
||||
4. 使用<https://tinypng.cn/>压缩你要上传的图片(如图片已经很小或你有更好的压缩工具可省略这一步)
|
||||
5. 在PigGo的`上传区`上传你的图片,到`相册`一键复制刚刚上传的图片URL,至此,你就可以在你的文章当中愉快的插入图片啦~, 更多功能自己去探索吧~~
|
||||
|
||||

|
||||

|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ title: vdoing主题效果图
|
|||
date: 2020-04-08 11:27:22
|
||||
permalink: /pages/d557b9a89a215d2e
|
||||
article: false
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -13,39 +13,38 @@ author:
|
|||
## PC端
|
||||
|
||||
<br/>
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408125410.png" style="width:48%;"/>
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408120138.png" style="width:48%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408125410.png" style="width:48%;"/>
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408120138.png" style="width:48%;" />
|
||||
<p align="center">首页 & 目录页△</p>
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408120144.png" style="width:48%;" />
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408120145.png" style="width:48%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408120144.png" style="width:48%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408120145.png" style="width:48%;" />
|
||||
<p align="center">文章详情页 & 时间轴页△</p>
|
||||
|
||||
## 首页个性化大图
|
||||
|
||||
<br/>
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408125412.png" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408125412.png" />
|
||||
<p align="center">首页个性化大图△</p>
|
||||
|
||||
## 深色模式和阅读模式
|
||||
|
||||
<br/>
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408125408.png" style="width:48%;" />
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408120139.png" style="width:48%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408125408.png" style="width:48%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408120139.png" style="width:48%;" />
|
||||
<p align="center">深色模式△</p>
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408125409.png" style="width:48%;" />
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408120143.png" style="width:48%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408125409.png" style="width:48%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408120143.png" style="width:48%;" />
|
||||
<p align="center">阅读模式△</p>
|
||||
|
||||
## 移动端
|
||||
|
||||
<br/>
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408120606.png" style="width:24%;" />
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408120147.png" style="width:24%;" />
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408120148.png" style="width:24%;" />
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200408130831.png" style="width:24%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408120606.png" style="width:24%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408120147.png" style="width:24%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408120148.png" style="width:24%;" />
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200408130831.png" style="width:24%;" />
|
||||
<p align="center">移动端效果△</p>
|
||||
|
||||
<style scoped>
|
||||
/* .content__default img{border: 1px solid #ccc;} */
|
||||
</style>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
title: 笔记方法
|
||||
date: 2020-07-16 11:00:55
|
||||
permalink: /pages/e60c81/
|
||||
categories:
|
||||
categories:
|
||||
- 更多
|
||||
- 学习
|
||||
tags:
|
||||
tags:
|
||||
- 笔记方法
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -15,30 +15,30 @@ author:
|
|||
::: center
|
||||
|
||||
## 康奈尔笔记法
|
||||

|
||||

|
||||
|
||||
## 思维导图法
|
||||

|
||||

|
||||
|
||||
## 金三角笔记法
|
||||

|
||||

|
||||
|
||||
## 曼陀罗九宫格笔记法
|
||||

|
||||

|
||||
|
||||
## 记号记录法
|
||||

|
||||

|
||||
|
||||
## 六色笔记法
|
||||

|
||||

|
||||
|
||||
## 加工笔记法
|
||||

|
||||

|
||||
|
||||
## 整理笔记要点1-科学标记重点
|
||||

|
||||

|
||||
|
||||
## 整理笔记要点2-修改不涂改
|
||||

|
||||

|
||||
|
||||
:::
|
||||
:::
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
title: 提高学习效率的策略
|
||||
date: 2020-01-04 11:54:14
|
||||
permalink: /pages/a8692ab3bdcb4588
|
||||
categories:
|
||||
categories:
|
||||
- 更多
|
||||
- 学习
|
||||
tags:
|
||||
tags:
|
||||
- null
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -74,4 +74,4 @@ author:
|
|||
|
||||
——以上内容摘自《认知天性》,结合本人的个人理解,更多内容请查看该书籍。
|
||||
|
||||

|
||||

|
||||
|
|
|
|||
|
|
@ -4,21 +4,21 @@ date: 2021-11-25 14:33:51
|
|||
permalink: /pages/dcebaf/
|
||||
titleTag: 原创
|
||||
sticky: 1
|
||||
categories:
|
||||
categories:
|
||||
- 更多
|
||||
- 实用技巧
|
||||
tags:
|
||||
tags:
|
||||
- JavaScript
|
||||
- css
|
||||
- 实用技巧
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
# 一行代码“黑”掉任意网站
|
||||
|
||||
实用技巧:只需一行代码,轻轻一点就可以把任意网站变成暗黑模式。
|
||||
<p align="center"><img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/blog/QQ20211125-163111.2tmjlvz28n80.png" width="500" style="cursor: zoom-in;"></p>
|
||||
<p align="center"><img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/blog/QQ20211125-163111.2tmjlvz28n80.png" width="500" style="cursor: zoom-in;"></p>
|
||||
|
||||
<!-- more -->
|
||||
|
||||
|
|
@ -51,8 +51,8 @@ javascript: (function () { const docStyle = document.documentElement.style; if
|
|||
```
|
||||
|
||||
然后打开浏览器书签管理器,添加新书签,在网址栏粘贴这段代码并保存:
|
||||
<p align="center"><img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/blog/QQ20211125-154655.1byvlo5a60xs.png" width="600" style="cursor: zoom-in;"></p>
|
||||
<p align="center"><img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/blog/QQ20211125-154655.1byvlo5a60xs.png" width="600" style="cursor: zoom-in;"></p>
|
||||
|
||||
以后在任意网站,只需要轻轻一点`切换模式`书签就可以让它变成85%的暗黑,再点一次就是100%的暗黑,再点一次变回正常模式。
|
||||
|
||||
<p align="center"><img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/blog/QQ20211125-163111.2tmjlvz28n80.png" width="600" style="cursor: zoom-in;"></p>
|
||||
<p align="center"><img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/blog/QQ20211125-163111.2tmjlvz28n80.png" width="600" style="cursor: zoom-in;"></p>
|
||||
|
|
|
|||
|
|
@ -13,81 +13,73 @@ author:
|
|||
普通卡片列表容器,可用于友情链接、项目推荐、古诗词展示等。
|
||||
cardList 后面可跟随一个数字表示每行最多显示多少个,选值范围1~4,默认3。在小屏时会根据屏幕宽度减少每行显示数量。
|
||||
-->
|
||||
|
||||
::: cardList
|
||||
|
||||
```yaml
|
||||
- name: 麋鹿鲁哟
|
||||
desc: 大道至简,知易行难
|
||||
avatar: https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200122153807.jpg # 可选
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200122153807.jpg # 可选
|
||||
link: https://www.cnblogs.com/miluluyo/ # 可选
|
||||
bgColor: '#CBEAFA' # 可选,默认var(--bodyBg)。颜色值有#号时请添加单引号
|
||||
textColor: '#6854A1' # 可选,默认var(--textColor)
|
||||
bgColor: "#CBEAFA" # 可选,默认var(--bodyBg)。颜色值有#号时请添加单引号
|
||||
textColor: "#6854A1" # 可选,默认var(--textColor)
|
||||
- name: XAOXUU
|
||||
desc: '#IOS #Volantis主题作者'
|
||||
avatar: https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avatar.png
|
||||
desc: "#IOS #Volantis主题作者"
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/xaoxuu/assets@master/avatar/avatar.png
|
||||
link: https://xaoxuu.com
|
||||
bgColor: '#B9D59C'
|
||||
textColor: '#3B551F'
|
||||
- name: lookroot的个人空间
|
||||
desc: 寻求理想和显示的平衡
|
||||
avatar: https://www.lookroot.cn/logo.png
|
||||
link: https://www.lookroot.cn/
|
||||
bgColor: '#B7DBFF'
|
||||
textColor: '#294D71'
|
||||
bgColor: "#B9D59C"
|
||||
textColor: "#3B551F"
|
||||
- name: 平凡的你我
|
||||
desc: 理想成为大牛的<br/>小陈同学
|
||||
avatar: https://reinness.com/static/avatar.png
|
||||
avatar: https://qiniu.reinness.com/avatar.png
|
||||
link: https://reinness.com
|
||||
bgColor: '#FFE5B4'
|
||||
textColor: '#A05F2C'
|
||||
bgColor: "#FFE5B4"
|
||||
textColor: "#A05F2C"
|
||||
- name: znote
|
||||
desc: 荷尽已无擎雨盖,<br/>菊残犹有傲霜枝。
|
||||
avatar: https://zpj80231.gitee.io/znote/vuepress/head-fish.jpg
|
||||
link: https://zpj80231.gitee.io/znote/
|
||||
bgColor: '#FCE5BF'
|
||||
textColor: '#7B2532'
|
||||
bgColor: "#FCE5BF"
|
||||
textColor: "#7B2532"
|
||||
- name: 全栈软件开发直通车
|
||||
desc: 全栈软件开发技术博客,<br/>从小白到大神!
|
||||
avatar: https://gitee.com/wangshibiao/blog_picBed2/raw/master/images/20200806151030.png
|
||||
avatar: https://cdn.jsdelivr.net/gh/wangshibiaoFlytiger/blog_picBed1/images/shuaige.jpg
|
||||
link: https://sofineday.com
|
||||
bgColor: '#FBEBEC'
|
||||
textColor: '#603420'
|
||||
bgColor: "#FBEBEC"
|
||||
textColor: "#603420"
|
||||
- name: 易良同学的博客
|
||||
desc: 正在努力!
|
||||
avatar: https://yiliang.site/assets/images/avatar.jpeg
|
||||
avatar: https://yiliang.site/assets/images/avatar.jpg
|
||||
link: https://yiliang.site
|
||||
bgColor: '#FFEFE2'
|
||||
textColor: '#A05F2C'
|
||||
bgColor: "#FFEFE2"
|
||||
textColor: "#A05F2C"
|
||||
- name: 永远的救赎者
|
||||
desc: 知者减半,省者全无。
|
||||
avatar: https://i.loli.net/2020/08/10/PkQMGL6pATW1vBg.jpg
|
||||
link: http://www.yuanchengcheng.vip/
|
||||
bgColor: '#FBEBEC'
|
||||
textColor: '#603420'
|
||||
- name: 辰旭博客
|
||||
desc: 凤鸣初阳,百鸟朝凰
|
||||
avatar: https://s1.ax1x.com/2020/08/09/aoLTDx.png
|
||||
link: https://kareny.cn
|
||||
bgColor: '#FFCEDE'
|
||||
textColor: '#621529'
|
||||
- name: JokerM's Palace
|
||||
desc: Take your heart
|
||||
avatar: https://jokerm.com/wp-content/uploads/2020/09/jmflogo.png
|
||||
link: https://jokerm.com/
|
||||
- name: Saul.J.Wu
|
||||
desc: 立身之本,不在高低。
|
||||
avatar: https://gitee.com/SaulJWu/blog-images/raw/master/images/20210627222322.jpg
|
||||
avatar: https://sauljwu.github.io/img/logo.jpg
|
||||
link: https://sauljwu.github.io/
|
||||
- name: Lake's blog
|
||||
desc: 不积跬步,无以至千里;不积小流,无以成江海。
|
||||
avatar: https://cdn.jsdelivr.net/gh/taixingyiji/image_store@main/blog/logo/img.png
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/taixingyiji/image_store@main/blog/logo/img.png
|
||||
link: https://taixingyiji.com/
|
||||
- name: Cubik的小站
|
||||
desc: RECOMMENDED BY DR.CREATIVE
|
||||
avatar: https://cdn.jsdelivr.net/gh/Cubik65536/cubik-favicons@main/CubikLogo.png
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/Cubik65536/cubik-favicons@main/CubikLogo.png
|
||||
link: https://www.cubik65536.top/
|
||||
- name: x·π
|
||||
desc: 为开发者量身制作的技术博客和知识库管理平台。
|
||||
avatar: https://cdn.jsdelivr.net/gh/Ezuy-Lee/RainzeDrawingBed/media/logo.png
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/Ezuy-Lee/RainzeDrawingBed/media/logo.png
|
||||
link: https://ezuy-lee.github.io/xpai/
|
||||
- name: 眼里有光
|
||||
desc: 道阻且长,行则将至
|
||||
|
|
@ -107,7 +99,7 @@ cardList 后面可跟随一个数字表示每行最多显示多少个,选值
|
|||
link: http://tech.tea-culture.top/
|
||||
- name: 小鱼博客
|
||||
desc: 总是半途而废的废柴
|
||||
avatar: https://cdn.jsdelivr.net/gh/xiaoyu-666/image_store/blog/minion.png
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/xiaoyu-666/image_store/blog/minion.png
|
||||
link: https://xiaoyu-666.github.io/
|
||||
- name: 大胡子
|
||||
desc: 记录你我,分享精彩。
|
||||
|
|
@ -117,11 +109,7 @@ cardList 后面可跟随一个数字表示每行最多显示多少个,选值
|
|||
desc: 流水不争先,争的是滔滔不绝。
|
||||
avatar: https://joy1412.cn/img/dudu.jpeg
|
||||
link: https://joy1412.cn
|
||||
- name: 嶋屿麋鹿
|
||||
desc: 小鹿的知识库
|
||||
avatar: https://www.fongloo.com/img/logo.png
|
||||
link: https://www.fongloo.com/
|
||||
- name: '@小右_'
|
||||
- name: "@小右_"
|
||||
desc: 学而不厌 不耻下问
|
||||
avatar: https://lordblog.cn/upload/2021/05/logo%20(4)-742f1f7e15db44a1b3140035104ea239.png
|
||||
link: https://lordblog.cn/
|
||||
|
|
@ -131,54 +119,81 @@ cardList 后面可跟随一个数字表示每行最多显示多少个,选值
|
|||
link: https://zkpeace.com/
|
||||
- name: Haobo's Blog
|
||||
link: https://discover304.top/
|
||||
avatar: https://discover304.top/img/head.png
|
||||
avatar: https://discover304.top/img/head.jpg
|
||||
desc: 半只脚跨入炼丹师的大门的新人
|
||||
- name: 小胖墩er
|
||||
desc: 迟到总比不到的好,所以好好加油吧。
|
||||
avatar: https://cdn.jsdelivr.net/gh/Chubby-Duner/image-hosting@master/blog/logo.jpeg
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/Chubby-Duner/image-hosting@master/blog/logo.jpeg
|
||||
link: https://chubbyduner.top
|
||||
- name: CloudNative Operations
|
||||
desc: 专注于云原生运维,致敬每个爱学习的你。
|
||||
avatar: https://kubesre.com/img/logo.png
|
||||
link: https://kubesre.com/
|
||||
- name: Joseph Z.
|
||||
desc: Joseph Z.的小站
|
||||
avatar: https://josephz.top/res/joseph.jpg
|
||||
avatar: https://josephz.top/image/avatar.webp
|
||||
link: https://josephz.top/
|
||||
- name: 二丫讲梵 # 昵称
|
||||
desc: 💻学习📝记录🔗分享 # 介绍
|
||||
avatar: https://wiki.eryajf.net/img/logo.png # 头像
|
||||
link: https://wiki.eryajf.net/ # 链接
|
||||
- name: YoungKbt World # 昵称
|
||||
desc: 故事由我书写,旅程由你见证,传奇由她聆听 # 介绍
|
||||
avatar: https://cdn.jsdelivr.net/gh/Kele-Bingtang/static/user/avatar2.png # 头像
|
||||
link: https://notes.youngkbt.cn/ # 链接
|
||||
- name: XuHuaian,s Blog # 昵称
|
||||
desc: 记录自己的工作学习心得,争取当一条有梦想的咸鱼 # 介绍
|
||||
avatar: https://dbsecurity.com.cn/images/logo.jpg # 头像
|
||||
link: https://dbsecurity.com.cn/# 链接
|
||||
link: https://wiki.eryajf.net/ # 链接
|
||||
- name: YoungKbt World # 昵称
|
||||
desc: 故事由我书写,旅程由你见证,传奇由她聆听 # 介绍
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/Kele-Bingtang/static/user/avatar2.png # 头像
|
||||
link: https://notes.youngkbt.cn/ # 链接
|
||||
# - name: XuHuaian,s Blog # 昵称
|
||||
# desc: 记录自己的工作学习心得,争取当一条有梦想的咸鱼 # 介绍
|
||||
# avatar: https://dbsecurity.com.cn/images/logo.jpg # 头像
|
||||
# link: https://dbsecurity.com.cn/# 链接
|
||||
- name: xustudyxu
|
||||
desc: 一起学习编程!
|
||||
avatar: https://cdn.jsdelivr.net/gh/xustudyxu/image-hosting@master/20220423/01.3d9wrma6qlq0.webp
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/xustudyxu/image-hosting@master/20220423/01.3d9wrma6qlq0.webp
|
||||
link: https://frxcat.fun/
|
||||
- name: Yiyang Sun
|
||||
desc: Frontend enthusiast.
|
||||
avatar: https://shaun-logo.oss-cn-beijing.aliyuncs.com/avatar.jpg
|
||||
link: https://blog.syy11.cn
|
||||
- name: ColorPanda
|
||||
desc: 中国語を日本語と英語で勉強。日中家庭の言語教育の悩みを解消したい。
|
||||
avatar: https://colorpanda.aifan.jp/img/logo.png
|
||||
link: https://colorpanda.aifan.jp/
|
||||
- name: 不器小窝
|
||||
desc: 「但知行好事,莫要问前程」
|
||||
avatar: https://avatars.githubusercontent.com/u/866409?v=4
|
||||
link: https://xingcxb.com/
|
||||
# - name: 七鳄の学习格
|
||||
# desc: 如果世界多了精彩,每一位都是创造者,大家都是你的观众
|
||||
# avatar: https://blog.gmcj0816.top/img/SeriousWission_TouXiangPic.jpg
|
||||
# link: https://blog.gmcj0816.top/
|
||||
- name: 从01开始
|
||||
desc: 那就从零开始
|
||||
avatar: https://image.peterjxl.com/blog/re0.jpg
|
||||
link: https://www.peterjxl.com/
|
||||
- name: Gahing's blog # 昵称
|
||||
desc: 生活之珍爱,余缀于技术之间。 # 介绍
|
||||
avatar: https://www.gahing.top/img/avatar.jpeg # 头像
|
||||
link: https://www.gahing.top/ # 链接
|
||||
- name: Howietron # 昵称
|
||||
desc: Java全站技术博客,积跬步以至千里,致敬每个爱学习的你。 # 介绍
|
||||
avatar: https://wiki.howie.top/img/logo.png # 头像
|
||||
link: https://wiki.howie.top/ # 链接
|
||||
- name: 菜园前端 # 昵称
|
||||
desc: 前端学习笔记分享、小白都能看懂的笔记 # 介绍
|
||||
avatar: https://note.noxussj.top/logo.png # 头像
|
||||
link: https://note.noxussj.top/?s=y3 # 链接
|
||||
- name: 坚持住 # 昵称
|
||||
desc: 一个毕业于临床医学专业的挚爱IT技术的喜欢研究英语的人族选手 # 介绍
|
||||
avatar: https://hanginthere.space/hanginthere_logo_update.png # 头像
|
||||
link: Https://hanginthere.space # 链接
|
||||
```
|
||||
:::
|
||||
|
||||
:::
|
||||
|
||||
### 友链申请
|
||||
|
||||
与我[ 联系 ](/about/#联系)或者 在本页面评论区留言您的友链信息,格式:(点击代码块右上角一键复制)
|
||||
|
||||
|
||||
```yaml
|
||||
- name: Evan's blog # 昵称
|
||||
desc: 积跬步以至千里,喜欢学习喜欢你。 # 介绍
|
||||
avatar: https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg # 头像
|
||||
link: https://xugaoyi.com/ # 链接
|
||||
desc: Web前端技术博客,积跬步以至千里 # 介绍
|
||||
avatar: https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200103123203.jpg # 头像
|
||||
link: https://xugaoyi.com/ # 链接
|
||||
```
|
||||
|
||||
申请前记得先添加本站哦~
|
||||
|
|
|
|||
|
|
@ -33,9 +33,12 @@ author:
|
|||
|
||||
本站主题是 [`Vdoing`](https://github.com/xugaoyi/vuepress-theme-vdoing),这是一款简洁高效的VuePress 知识管理&博客 主题。旨在轻松打造一个`结构化`与`碎片化`并存的个人在线知识库&博客,让你的知识海洋像一本本书一样清晰易读。配合多维索引,让每一个知识点都可以快速定位! [Github地址](https://github.com/xugaoyi/vuepress-theme-vdoing) | [在线vscode预览源码](https://github1s.com/xugaoyi/vuepress-theme-vdoing)
|
||||
|
||||
<!-- <a href="https://github.com/xugaoyi/vuepress-theme-vdoing" target="_blank"><img src='https://img.shields.io/github/stars/xugaoyi/vuepress-theme-vdoing' alt='GitHub stars' class="no-zoom"></a>
|
||||
<a href="https://github.com/xugaoyi/vuepress-theme-vdoing" target="_blank"><img src='https://img.shields.io/github/forks/xugaoyi/vuepress-theme-vdoing' alt='GitHub forks' class="no-zoom"></a> -->
|
||||
## 赞助商
|
||||
> 进入以下链接注册一下,赞助商会为博主赞助一笔小费,感谢~
|
||||
|
||||
<p align="center">
|
||||
<a href="http://apifox.cn/a103xugaoyi" target="_blank"><img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/blog-gitalk-comment@master/img/Apifox-860x320.ic7tz1417sw.png" alt="赞助商" style="width: 400px;border-radius: 2px;"></a>
|
||||
</p>
|
||||
|
||||
## 🐼Me
|
||||
web前端小学生
|
||||
|
|
@ -47,7 +50,7 @@ web前端小学生
|
|||
|
||||
<!-- 本人↓↓↓
|
||||
|
||||
<img src='https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200103123203.jpg' alt='本人照片' style="width:106px;"> -->
|
||||
<img src='https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store/blog/20200103123203.jpg' alt='本人照片' style="width:106px;"> -->
|
||||
|
||||
## 前端学习
|
||||
<br/>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ author:
|
|||
* [工具大全](https://www.fly63.com/tool/home.html)
|
||||
|
||||
<p align="center">
|
||||
<img src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/blog/qrcode.zdqv9mlfc0g.jpg" width="200">
|
||||
<img src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/blog/qrcode.zdqv9mlfc0g.jpg" width="200">
|
||||
</p>
|
||||
|
||||
::: center
|
||||
|
|
@ -66,6 +66,7 @@ author:
|
|||
* [高教书苑](https://ebook.hep.com.cn/ebooks/h5/index.html) 高等教育出版社的书籍,包含多种学科。
|
||||
<!-- * [前端电子书收集](http://www.yuanchengcheng.vip/books) -->
|
||||
* [SoBooks](https://sobooks.cc/) 免费的电子书资源网站
|
||||
* [识典古籍](https://www.shidianguji.com/) 古籍数字化平台
|
||||
|
||||
## 优秀文章
|
||||
* [我做系统架构的一些原则](https://coolshell.cn/articles/21672.html) 作者对系统架构的方法论总结
|
||||
|
|
@ -126,6 +127,15 @@ author:
|
|||
* [magic eraser](https://www.magiceraser.io/) AI抠图(抠前景)
|
||||
* [backgroundremover](https://github.com/nadermx/backgroundremover) 又一个抠图的
|
||||
|
||||
## SVG
|
||||
- [svg编辑器-E2.Cool](https://e2.cool/)
|
||||
- [svg编辑器-i排版](https://x.ipaiban.com/login)
|
||||
|
||||
## 音视频工具
|
||||
- [迅捷视频转换器](https://app.xunjieshipin.com/video-converter/) 在线转换各种视频格式
|
||||
- [迅捷音频转换器](https://app.xunjieshipin.com/video-converter/) 在线转换各种音频格式
|
||||
- [修剪音频](https://mp3cut.net/cn/) 在线修剪或剪切任何音频文件
|
||||
|
||||
## 思维导图
|
||||
* [processon在线作图](https://www.processon.com/) 流程图、思维导图、原型图等
|
||||
* [百度脑图](https://naotu.baidu.com) 思维导图
|
||||
|
|
@ -255,6 +265,8 @@ author:
|
|||
- [abbreviations](https://www.abbreviations.com/) 查看一个简写是什么意思的网站
|
||||
- [magi](https://magi.com/) ai 搜索神器,超屌
|
||||
- [在线取名](https://www.qmsjmfb.com/) 解决取名难问题,超多名字生成
|
||||
- [像素画GIF](https://collet66.web.fc2.com/nijisanji/index.html)
|
||||
- [猫咪生成器](https://uchinoko-maker.jp/)
|
||||
|
||||
## 生成器
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ date: 2022-01-28 14:59:51
|
|||
permalink: /pages/829589/
|
||||
titleTag: 原创
|
||||
sidebar: auto
|
||||
categories:
|
||||
categories:
|
||||
- 随笔
|
||||
tags:
|
||||
tags:
|
||||
- null
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -322,13 +322,13 @@ author:
|
|||
crossorigin="anonymous"
|
||||
class="hide-img"
|
||||
id="qrcode"
|
||||
src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store2@master/img/qrcode.zul0pldsuao.png"
|
||||
src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store2@master/img/qrcode.zul0pldsuao.png"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 背景音乐 -->
|
||||
<audio
|
||||
src="https://cdn.jsdelivr.net/gh/xugaoyi/image_store2@master/cjxq.mp3"
|
||||
src="https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store2@master/cjxq.mp3"
|
||||
id="bgm"
|
||||
ref="bgm"
|
||||
loop
|
||||
|
|
@ -424,10 +424,10 @@ export default {
|
|||
duilian: {}, // 当前对联文本对象
|
||||
isRotate: false, // 刷新icon旋转
|
||||
bgList: [
|
||||
'https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/1.4j8qpdnq80i0.jpeg',
|
||||
'https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/4.4460an8ag5o0.jpeg',
|
||||
'https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/5.3axtl4xpvy00.jpeg',
|
||||
'https://cdn.jsdelivr.net/gh/xugaoyi/image_store@master/6.2lnbphdqjaq0.jpeg',
|
||||
'https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/1.4j8qpdnq80i0.jpeg',
|
||||
'https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/4.4460an8ag5o0.jpeg',
|
||||
'https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/5.3axtl4xpvy00.jpeg',
|
||||
'https://jsd.cdn.zzko.cn/gh/xugaoyi/image_store@master/6.2lnbphdqjaq0.jpeg',
|
||||
],
|
||||
isReadImages: false, // 延迟加载图片用
|
||||
isShowShareBtn: false, // 是否显示分享按钮
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ title: 拥抱生活,拥抱快乐
|
|||
date: 2020-06-26 20:40:38
|
||||
permalink: /pages/cd8bde/
|
||||
sidebar: auto
|
||||
categories:
|
||||
categories:
|
||||
- 随笔
|
||||
tags:
|
||||
tags:
|
||||
- 鸡汤
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -27,7 +27,7 @@ author:
|
|||
所有通过捷径所带来的快乐,都是廉价的,以至于所有追求都变得毫无意义,人生就了无生趣。我们需要在每天真实的努力中去拥抱生活,追寻真实的快乐。
|
||||
|
||||
::: center
|
||||

|
||||

|
||||
:::
|
||||
|
||||
> 文章摘录自:B站视频《罗翔说刑法》,链接<https://b23.tv/K8ulrE>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
title: Git变基合并
|
||||
date: 2020-11-18 17:43:57
|
||||
permalink: /pages/c10281/
|
||||
categories:
|
||||
categories:
|
||||
- 《Git》学习笔记
|
||||
tags:
|
||||
tags:
|
||||
- Git
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -52,7 +52,7 @@ git push origin dev # 推送到远程仓库的 dev
|
|||
```
|
||||
|
||||
### 变基要遵守的准则
|
||||
**几个人同时在一个分支上进行开发和提交时,你不要中途执行变基,只有在大家都完成工作之后才可以执行变基。**
|
||||
**几个人同时在一个分支上进行开发和提交时,开发中途请不要私自执行变基,只有在大家都完成工作之后才可以执行变基。**
|
||||
|
||||
### 变基的实质
|
||||
变基操作的实质是丢弃一些现有的提交,然后相应地新建一些内容一样但实际上不同的提交。
|
||||
|
|
@ -104,7 +104,7 @@ dev
|
|||
*v2
|
||||
```
|
||||
|
||||
`2.4-dev` 是基于`dev`切出来的。
|
||||
`v2` 是基于`dev`切出来的。
|
||||
|
||||
提交记录如下:
|
||||
|
||||
|
|
@ -147,11 +147,11 @@ a - b - c - d - e
|
|||
git branch -m dev-copy v2 # 重命名
|
||||
```
|
||||
|
||||
### git cherry-pick
|
||||
## git cherry-pick
|
||||
来源:[《git cherry-pick 教程》](http://www.ruanyifeng.com/blog/2020/04/git-cherry-pick.html)
|
||||
|
||||
用于将单个或几个`[commit]`复制到另一个分支。
|
||||
#### 基本应用
|
||||
### 基本应用
|
||||
|
||||
```sh
|
||||
git cherry-pick <commitHash> # 将commitHash应用于当前分支
|
||||
|
|
@ -160,7 +160,7 @@ git cherry-pick <commitHash> # 将commitHash应用于当前分支
|
|||
|
||||
git cherry-pick命令的参数,不一定是提交的哈希值,分支名也是可以的,表示转移该分支的最新提交。
|
||||
|
||||
#### 转移多个提交
|
||||
### 转移多个提交
|
||||
Cherry pick 支持一次转移多个提交。
|
||||
|
||||
```sh
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
title: Git分支-分支原理
|
||||
date: 2020-11-18 17:43:57
|
||||
permalink: /pages/4bef1a/
|
||||
categories:
|
||||
categories:
|
||||
- 《Git》学习笔记
|
||||
tags:
|
||||
tags:
|
||||
- Git
|
||||
author:
|
||||
author:
|
||||
name: xugaoyi
|
||||
link: https://github.com/xugaoyi
|
||||
---
|
||||
|
|
@ -31,7 +31,7 @@ $ git commit -m 'The initial commit of my project'
|
|||
|
||||
现在,Git 仓库中有五个对象:三个 ***blob* 对象**(保存着文件快照)、一个 **树对象** (记录着目录结构和 blob 对象索引)以及一个 **提交对象**(包含着指向前述树对象的指针和所有提交信息)。
|
||||
|
||||

|
||||

|
||||
|
||||
<p align='center'>图1. 首次提交对象及其树结构 ▲</p>
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ $ git commit -m 'The initial commit of my project'
|
|||
|
||||
做些修改后再次提交,那么这次产生的提交对象会包含一个指向上次提交对象(父对象)的指针。
|
||||
|
||||

|
||||

|
||||
|
||||
<p align='center'>图2. 提交对象及其父对象 ▲</p>
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ $ git commit -m 'The initial commit of my project'
|
|||
|
||||
> Git 的 `master` 分支并不是一个特殊分支。 它就跟其它分支完全没有区别。
|
||||
|
||||

|
||||

|
||||
|
||||
<p align='center'>图3. 分支及其提交历史 ▲</p>
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ $ git branch testing
|
|||
|
||||
这会在当前所在的提交对象上创建一个指针。
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ $ git branch testing
|
|||
|
||||
Git 是怎么知道当前在哪一个分支上呢? 很简单,它有一个**名为 `HEAD` 的特殊指针**,**指向当前所在的本地分支**(译注:**将 `HEAD` 想象为当前分支的别名**)。 在本例中,你仍然在 `master` 分支上。 因为 `git branch` 命令仅仅 **创建** 一个新分支,并不会自动切换到新分支中去。
|
||||
|
||||

|
||||

|
||||
|
||||
<p align='center'>图5. HEAD 指向当前所在的分支 ▲</p>
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ $ git checkout testing # git checkout <分支名>
|
|||
|
||||
这样 `HEAD` 就指向 `testing` 分支了。
|
||||
|
||||

|
||||

|
||||
|
||||
<p align='center'>图6. HEAD 指向当前所在的分支 ▲</p>
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ $ vim test.rb
|
|||
$ git commit -a -m 'made a change'
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
<p align='center'>图7. HEAD 分支随着提交操作自动向前移动 ▲</p>
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ $ git commit -a -m 'made a change'
|
|||
$ git checkout master
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ $ git commit -a -m 'made other changes'
|
|||
|
||||
现在,这个项目的提交历史已经产生了分叉(参见 [项目分叉历史](https://git-scm.com/book/zh/v2/ch00/divergent_history))。 因为刚才你创建了一个新分支,并切换过去进行了一些工作,随后又切换回 master 分支进行了另外一些工作。 上述两次改动针对的是不同分支:你可以在不同分支间不断地来回切换和工作,并在时机成熟时将它们合并起来。 而所有这些工作,你需要的命令只有 `branch`、`checkout` 和 `commit`。
|
||||
|
||||

|
||||

|
||||
|
||||
<p align='center'>图9. 项目分叉历史 ▲</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ axios.interceptors.request.eject(myInterceptor)
|
|||
|
||||
我们先用一张图来展示一下拦截器工作流程:
|
||||
|
||||

|
||||

|
||||
|
||||
整个过程是一个链式调用的方式,并且每个拦截器都可以支持同步和异步处理,我们自然而然地就联想到使用 Promise 链的方式来实现整个调用过程。
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ tags:
|
|||
|
||||
XSRF 又名 [CSRF](https://developer.mozilla.org/en-US/docs/Learn/Server-side/First_steps/Website_security#Cross-Site_Request_Forgery_(CSRF)),跨站请求伪造,它是前端常见的一种攻击方式,我们先通过一张图来认识它的攻击手段。
|
||||
|
||||

|
||||

|
||||
|
||||
CSRF 的防御手段有很多,比如验证请求的 referer,但是 referer 也是可以伪造的,所以杜绝此类攻击的一种方式是服务器端要求每次请求都包含一个 `token`,这个 `token` 不在前端生成,而是在我们每次访问站点的时候生成,并通过 `set-cookie` 的方式种到客户端,然后客户端发送请求的时候,从 `cookie` 中对应的字段读取出 `token`,然后添加到请求 `headers` 中。这样服务端就可以从请求 `headers` 中读取这个 `token` 并验证,由于这个 `token` 是很难伪造的,所以就能区分这个请求是否是用户正常发起的。
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ author:
|
|||
|
||||
MVVM模式,`M`即 model,数据模型;`V`即 view,视图;`VM`即 view-model,视图模型。
|
||||
<!-- more -->
|
||||

|
||||

|
||||
|
||||
**理解**
|
||||
|
||||
|
|
|
|||
|
|
@ -99,4 +99,4 @@ author:
|
|||
|
||||
## 生命周期图示
|
||||
|
||||

|
||||

|
||||
|
|
|
|||
13
package.json
13
package.json
|
|
@ -2,8 +2,12 @@
|
|||
"name": "theme-vdoing-blog",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vuepress dev docs",
|
||||
"build": "vuepress build docs",
|
||||
"dev": "export NODE_OPTIONS=--openssl-legacy-provider && node --max_old_space_size=4096 ./node_modules/vuepress/cli.js dev docs",
|
||||
"build": "export NODE_OPTIONS=--openssl-legacy-provider && node --max_old_space_size=4096 ./node_modules/vuepress/cli.js build docs",
|
||||
"dev:win": "set NODE_OPTIONS=--openssl-legacy-provider && node --max_old_space_size=4096 ./node_modules/vuepress/cli.js dev docs",
|
||||
"build:win": "set NODE_OPTIONS=--openssl-legacy-provider && node --max_old_space_size=4096 ./node_modules/vuepress/cli.js build docs",
|
||||
"predev": "node utils/check.js dev && vdoing",
|
||||
"prebuild": "node utils/check.js build && vdoing",
|
||||
"deploy": "bash deploy.sh",
|
||||
"editFm": "node utils/editFrontmatter.js",
|
||||
"baiduPush": "node utils/baiduPush.js https://xugaoyi.com && bash baiduPush.sh",
|
||||
|
|
@ -15,16 +19,17 @@
|
|||
"dayjs": "^1.9.7",
|
||||
"inquirer": "^7.1.0",
|
||||
"json2yaml": "^1.1.0",
|
||||
"vuepress": "1.9.5",
|
||||
"vuepress": "1.9.9",
|
||||
"vuepress-plugin-baidu-autopush": "^1.0.1",
|
||||
"vuepress-plugin-baidu-tongji": "^1.0.1",
|
||||
"vuepress-plugin-comment": "^0.7.3",
|
||||
"vuepress-plugin-demo-block": "^0.7.2",
|
||||
"vuepress-plugin-fulltext-search": "^2.2.1",
|
||||
"vuepress-plugin-one-click-copy": "^1.0.2",
|
||||
"vuepress-plugin-sitemap": "^2.3.1",
|
||||
"vuepress-plugin-thirdparty-search": "^1.0.2",
|
||||
"vuepress-plugin-zooming": "^1.1.7",
|
||||
"vuepress-theme-vdoing": "^1.12.3",
|
||||
"vuepress-theme-vdoing": "^1.12.9",
|
||||
"yamljs": "^0.3.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
const isWin = process.platform === 'win32';
|
||||
|
||||
// 如果是 windows 平台
|
||||
if (isWin) {
|
||||
const {dev: devScriptStr, build: buildScriptStr} = require('../package.json').scripts
|
||||
const args = process.argv.slice(2)
|
||||
const scriptType = args[0]
|
||||
const fRed = "\x1b[31m"
|
||||
|
||||
const warnFn = (type) => {
|
||||
console.log(fRed,
|
||||
`\n[vdoing] 提示:由于您使用的是 windows 系统,请使用 ${type}:win 运行,否则运行失败。 \n`
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
// 当前运行的是dev脚本 且 脚本前端是'export'
|
||||
if (scriptType === 'dev' && devScriptStr.startsWith('export')) {
|
||||
warnFn('dev')
|
||||
}
|
||||
|
||||
// 当前运行的是build脚本 且 脚本前端是'export'
|
||||
if (scriptType === 'build' && buildScriptStr.startsWith('export')) {
|
||||
warnFn('build')
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const semver = require('semver');
|
||||
const chalk = require('chalk');
|
||||
const requiredVersion = require('../package.json').engines.node;
|
||||
|
||||
// check version
|
||||
if (!semver.satisfies(process.version, requiredVersion)) {
|
||||
console.log(chalk.red(
|
||||
`\n[vdoing] minimum Node version not met:`
|
||||
+ `\nYou are using Node ${process.version}, but vdoing `
|
||||
+ `requires Node ${requiredVersion}.\nPlease upgrade your Node version.\n`
|
||||
+ `请升级你的 Node 版本到 ${requiredVersion}.\n`
|
||||
))
|
||||
process.exit(1)
|
||||
}
|
||||
|
|
@ -206,15 +206,15 @@ dl, dd
|
|||
dd
|
||||
margin-top 0.7rem
|
||||
margin-left 1rem
|
||||
a:not(.header-anchor)
|
||||
margin-bottom 0.5rem
|
||||
display inline-block
|
||||
width 50%
|
||||
&:hover
|
||||
color $activeColor
|
||||
text-decoration none
|
||||
@media (max-width $MQMobileNarrow)
|
||||
width 100%
|
||||
a:not(.header-anchor)
|
||||
margin-bottom 0.5rem
|
||||
display inline-block
|
||||
width 50%
|
||||
&:hover
|
||||
color $activeColor
|
||||
text-decoration none
|
||||
@media (max-width 720px)
|
||||
width 100%
|
||||
.sub-cat-wrap
|
||||
margin 5px 0 8px 0
|
||||
font-size 0.95rem
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
categories () {
|
||||
categories() {
|
||||
if (this.length === 'all') {
|
||||
return this.categoriesData
|
||||
} else {
|
||||
|
|
@ -68,7 +68,7 @@ export default {
|
|||
margin-top 0.6rem
|
||||
a
|
||||
display block
|
||||
padding 8px 0.95rem 7px 0.95rem
|
||||
padding 8px 2.4rem 7px 0.95rem
|
||||
color var(--textColor)
|
||||
opacity 0.8
|
||||
font-size 0.95rem
|
||||
|
|
@ -91,7 +91,7 @@ export default {
|
|||
span
|
||||
opacity 0.8
|
||||
span
|
||||
float right
|
||||
// float right
|
||||
background-color var(--textColor)
|
||||
color var(--mainBg)
|
||||
border-radius 8px
|
||||
|
|
@ -99,10 +99,13 @@ export default {
|
|||
min-width 1rem
|
||||
height 1rem
|
||||
line-height 1rem
|
||||
font-size 0.6rem
|
||||
font-size 12px
|
||||
text-align center
|
||||
opacity 0.6
|
||||
transition opacity 0.3s
|
||||
position absolute
|
||||
right 0.95rem
|
||||
top 8px
|
||||
&.active
|
||||
background $accentColor
|
||||
color var(--mainBg)
|
||||
|
|
|
|||
|
|
@ -99,12 +99,16 @@ export default {
|
|||
@media (max-width $MQMobile)
|
||||
display none
|
||||
.categories
|
||||
padding-right 0.5rem
|
||||
// padding-right 0.3rem
|
||||
max-height calc(100vh - 14rem)
|
||||
min-height 2.2rem
|
||||
overflow-y auto
|
||||
transition all 0.2s
|
||||
position relative
|
||||
a
|
||||
padding-right 1.8rem
|
||||
span
|
||||
right 0.4rem
|
||||
&::-webkit-scrollbar-track-piece
|
||||
background-color rgba(0, 0, 0, 0.05)
|
||||
&::-webkit-scrollbar-thumb:vertical
|
||||
|
|
|
|||
|
|
@ -116,6 +116,9 @@
|
|||
class="card-box"
|
||||
v-if="homeData.postList === 'simple'"
|
||||
:length="homeData.simplePostListLength || 10"
|
||||
:moreArticle="
|
||||
$themeConfig.updateBar && $themeConfig.updateBar.moreArticle
|
||||
"
|
||||
/>
|
||||
|
||||
<!-- 详情版文章列表 -->
|
||||
|
|
@ -224,7 +227,7 @@ export default {
|
|||
} else {
|
||||
return 'background: var(--mainBg);color: var(--textColor)'
|
||||
}
|
||||
} else if (bannerBg.indexOf('background') > -1) { // 自定义背景样式
|
||||
} else if (bannerBg.indexOf('background:') > -1) { // 自定义背景样式
|
||||
return bannerBg
|
||||
} else if (bannerBg.indexOf('.') > -1) { // 大图
|
||||
return `background: url(${this.$withBase(bannerBg)}) center center / cover no-repeat`
|
||||
|
|
|
|||
|
|
@ -107,6 +107,19 @@ export default {
|
|||
+ path
|
||||
)
|
||||
}
|
||||
|
||||
// https://gitee.com/-/ide/project/xxx/xxx/edit/master/-/xxxx
|
||||
const gitee = /gitee.com/
|
||||
if (gitee.test(docsRepo)) {
|
||||
const base = docsRepo
|
||||
return (
|
||||
base.replace(gitee, 'gitee.com/-/ide/project')
|
||||
+ `/edit`
|
||||
+ `/${docsBranch}/-/`
|
||||
+ (docsDir ? docsDir.replace(endingSlashRE, '') + '/' : '')
|
||||
+ path
|
||||
)
|
||||
}
|
||||
|
||||
const base = outboundRE.test(docsRepo)
|
||||
? docsRepo
|
||||
|
|
|
|||
|
|
@ -143,7 +143,16 @@ function getCategories(file, categoryText) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
categories.push(categoryText)
|
||||
// 碎片化文章的分类生成
|
||||
const matchResult = file.filePath.match(/_posts\/(\S*)\//);
|
||||
const resultStr = matchResult ? matchResult[1] : ''
|
||||
const resultArr = resultStr.split('/').filter(Boolean)
|
||||
|
||||
if (resultArr.length) {
|
||||
categories.push(...resultArr)
|
||||
} else {
|
||||
categories.push(categoryText)
|
||||
}
|
||||
}
|
||||
return categories
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vuepress-theme-vdoing",
|
||||
"version": "1.12.3",
|
||||
"version": "1.12.9",
|
||||
"description": "Vdoing theme for VuePress. 一个基于VuePress的知识管理兼博客主题。",
|
||||
"author": {
|
||||
"name": "gaoyi(Evan) Xu"
|
||||
|
|
@ -48,5 +48,11 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@vuepress/types": "^1.9.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"vdoing": "./bin/checkVersion.js"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"headers": [
|
||||
{
|
||||
"source": "/assets/js/(.*)",
|
||||
"headers": [
|
||||
{
|
||||
"key": "Cache-Control",
|
||||
"value": "max-age=31536000, immutable"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "/assets/css/(.*)",
|
||||
"headers": [
|
||||
{
|
||||
"key": "Cache-Control",
|
||||
"value": "max-age=31536000, immutable"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue