Skip to content

Commit

Permalink
feat: 项目迁移初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxing409 committed Jun 2, 2024
1 parent 7f16583 commit 7353cad
Show file tree
Hide file tree
Showing 30 changed files with 3,504 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Deploy Pages

# 触发条件,push到main分支或者pull request到main分支
on:
push:
branches: [main]
pull_request:
branches: [main]

# 支持手动在工作流上触发
workflow_dispatch:

# 设置时区
env:
TZ: Asia/Shanghai

# 权限设置
permissions:
# 允许读取仓库内容的权限。
contents: read
# 允许写入 GitHub Pages 的权限。
pages: write
# 允许写入 id-token 的权限。
id-token: write

# 并发控制配置
concurrency:
group: pages
cancel-in-progress: false

# 定义执行任务
jobs:
# 构建任务
build:

runs-on: ubuntu-latest

# node v20 运行
strategy:
matrix:
node-version: [20]

steps:
# 拉取代码
- name: Checkout
uses: actions/checkout@v3
with:
# 保留 Git 信息
fetch-depth: 0

# 设置使用 Node.js 版本
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# 使用 最新的 PNPM
# 你也可以指定为具体的版本
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: latest
# version: 9
run_install: false

# 安装依赖
- name: Install dependencies
run: pnpm install --frozen-lockfile

# 构建项目
- name: Build blog project
run: |
echo ${{ github.workspace }}
pnpm build
# 资源拷贝
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./docs/.vitepress/dist
destination: ./_site

# 上传 _site 的资源,用于后续部署
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# 部署任务
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
cache
.temp
.DS_Store
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependencies=false
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
// Disable the default formatter
"prettier.enable": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
}
114 changes: 114 additions & 0 deletions docs/.vitepress/blog-theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// 主题独有配置
import { getThemeConfig } from '@sugarat/theme/node'

// 开启RSS支持(RSS配置)
// import type { Theme } from '@sugarat/theme'

// const baseUrl = 'https://sugarat.top'
// const RSS: Theme.RSSOptions = {
// title: '是柠新呀',
// baseUrl,
// copyright: 'Copyright (c) 2018-present, 是柠新呀',
// description: '你的指尖,拥有改变世界的力量(大前端相关技术分享)',
// language: 'zh-cn',
// image: 'https://img.cdn.sugarat.top/mdImg/MTY3NDk5NTE2NzAzMA==674995167030',
// favicon: 'https://sugarat.top/favicon.ico',
// }

// 所有配置项,详见文档: https://theme.sugarat.top/
const blogTheme = getThemeConfig({
article: {
/**
* 是否展示文章的预计阅读时间
*/
readingTime: true,
/**
* 是否隐藏文章页的封面展示
*/
hiddenCover: false,
/**
* 阅读时间分析展示位置
*/
readingTimePosition: 'inline'
},
// 开启RSS支持
// RSS,

// 搜索
// 默认开启pagefind离线的全文搜索支持(如使用其它的可以设置为false)
// 如果npx pagefind 时间过长,可以手动将其安装为项目依赖 pnpm add pagefind
// search: false,

// 页脚
footer: {
// message 字段支持配置为HTML内容,配置多条可以配置为数组
// message: '下面 的内容和图标都是可以修改的噢(当然本条内容也是可以隐藏的)',
copyright: 'MIT License | 是柠新呀'
// icpRecord: {
// name: '蜀ICP备19011724号',
// link: 'https://beian.miit.gov.cn/'
// },
// securityRecord: {
// name: '公网安备xxxxx',
// link: 'https://www.beian.gov.cn/portal/index.do'
// },
},

// 主题色修改
themeColor: 'el-blue',

// 文章默认作者
author: '是柠新呀',

// 友链
friend: [
{
nickname: 'Vitepress',
des: 'Vite & Vue Powered Static Site Generator',
avatar: 'https://vitepress.dev/vitepress-logo-large.webp',
url: 'https://vitepress.dev/'
}
],
recommend: {
showSelf: true,
nextText: '下一页',
style: 'sidebar'
},

// 公告
// popover: {
// title: '公告',
// body: [
// { type: 'text', content: '👇公众号👇---👇 微信 👇' },
// {
// type: 'image',
// src: 'https://img.cdn.sugarat.top/mdImg/MTYxNTAxODc2NTIxMA==615018765210~fmt.webp'
// },
// {
// type: 'text',
// content: '欢迎大家加群&私信交流'
// },
// {
// type: 'text',
// content: '文章首/文尾有群二维码',
// style: 'padding-top:0'
// },
// {
// type: 'button',
// content: '作者博客',
// link: 'https://sugarat.top'
// },
// {
// type: 'button',
// content: '加群交流',
// props: {
// type: 'success'
// },
// link: 'https://theme.sugarat.top/group.html'
// }
// ],
// duration: 0
// }
})

export { blogTheme }
74 changes: 74 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { defineConfig } from 'vitepress'

// 导入主题的配置
import { blogTheme } from './blog-theme'

// 如果使用 GitHub/Gitee Pages 等公共平台部署
// 通常需要修改 base 路径,通常为“/仓库名/”
// const base = process.env.GITHUB_ACTIONS === 'true'
// ? '/vitepress-blog-sugar-template/'
// : '/'

// Vitepress 默认配置
// 详见文档:https://vitepress.dev/reference/site-config
export default defineConfig({
// 继承博客主题(@sugarat/theme)
extends: blogTheme,
// base,
lang: 'zh-cn',
title: '是柠新呀的知识库',
description: '是柠新呀的博客主题,基于 vitepress 实现',
lastUpdated: true,
// 详见:https://vitepress.dev/zh/reference/site-config#head
head: [
// 配置网站的图标(显示在浏览器的 tab 上)
// ['link', { rel: 'icon', href: `${base}favicon.ico` }], // 修改了 base 这里也需要同步修改
['link', { rel: 'icon', href: '/favicon.ico' }]
],
themeConfig: {
// 展示 2,3 级标题在目录中
outline: {
level: [2, 3]
},
// 默认文案修改
returnToTopLabel: '回到顶部',
sidebarMenuLabel: '相关文章',
lastUpdatedText: '上次更新于',

// 设置logo
logo: '/logo.jpg',
// editLink: {
// pattern:
// 'https://github.com/ATQQ/sugar-blog/tree/master/packages/blogpress/:path',
// text: '去 GitHub 上编辑内容'
// },
nav: [
// { text: '首页', link: '/' },
{
text: '大前端',
items: [
{ text: 'javascript', link: '/bigFE/js/' },
{ text: 'vue', link: '/bigFE/vue/' },
{ text: 'electron', link: '/bigFE/electron/' },
{ text: 'node', link: '/bigFE/node/' }
// { text: 'html', link: '/bigWeb/html/' },
// { text: 'css', link: '/bigWeb/css/' },
// { text: '🌏浏览器专题', link: '/bigWeb/browser/' },
// { text: 'Web性能优化', link: '/bigWeb/performance/' },
// { text: 'regexp', link: '/bigWeb/regexp/' },
]
},
{
text: '关于我',
link: '/about'
},
{ text: 'External', link: 'https://google.com' }
],
socialLinks: [
{
icon: 'github',
link: 'https://github.com/xuxing409'
}
]
}
})
Binary file added docs/.vitepress/theme/assets/bg.webp
Binary file not shown.
9 changes: 9 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import BlogTheme from '@sugarat/theme'

// 自定义样式重载
// import './style.scss'

// 自定义主题色
// import './user-theme.css'

export default BlogTheme
14 changes: 14 additions & 0 deletions docs/.vitepress/theme/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.VPHome {
// 自定义首页背景图
&::before {
// 图片来源:https://zhuanlan.zhihu.com/p/54060187
background-image: url(./assets/bg.webp);
background-size: cover;
}
// 定义遮罩样式
background: radial-gradient(
ellipse,
rgba(var(--bg-gradient-home), 1) 0%,
rgba(var(--bg-gradient-home), 0) 150%
);
}
26 changes: 26 additions & 0 deletions docs/.vitepress/theme/user-theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* 所有变量:https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css */
/* 自定义主题色示例,如下 */

/* 浅色模式使用的变量 */
html[theme] {
--vp-c-user-1:red;
--vp-c-user-2:blue;
--vp-c-user-3:green;
--vp-c-user-soft:rgba(255,0,0,.5);
}

/* 深色模式使用的变量 */
html[theme].dark {
--vp-c-user-1:yellow;
--vp-c-user-2:purple;
--vp-c-user-3:orange;
--vp-c-user-soft:rgba(255,255,0,.5);
}

/* 覆盖默认变量 */
html[theme],html[theme].dark {
--vp-c-brand-1: var(--vp-c-user-1);
--vp-c-brand-2: var(--vp-c-user-2);
--vp-c-brand-3: var(--vp-c-user-3);
--vp-c-brand-soft: var(--vp-c-user-soft);
}
12 changes: 12 additions & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
sidebar: false
title: 关于自己
date: 2021-04-24
tags:
- 其它
---
# 关于我

一位有代码洁癖的前端程序员

搭建于2021.04.24
10 changes: 10 additions & 0 deletions docs/bigFE/electron/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
hidden: true
---
# Electron专题
## 目录
* [介绍](./介绍.md)
* [快速搭建](./快速搭建.md)
* [主进程与渲染进程通信](./主进程与渲染进程通信.md)
* [自定义标题栏](./自定义标题栏.md)
* [区分代码运行环境](./区分代码运行环境.md)
Loading

0 comments on commit 7353cad

Please sign in to comment.