Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
zihu97 committed Jun 22, 2024
1 parent 19f10f5 commit d73f866
Show file tree
Hide file tree
Showing 25 changed files with 6,479 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

name: 部署博客

on:
push:
branches:
# 确保这是你正在使用的分支名称
- main

jobs:
deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# 如果你文档需要 Git 子模块,取消注释下一行
# submodules: true



- name: 设置 Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: 安装依赖
run: yarn install --frozen-lockfile

- name: 构建文档
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
yarn run docs:build
> src/.vuepress/dist/.nojekyll
- name: 部署文档
uses: JamesIves/github-pages-deploy-action@v4
with:
# 这是文档部署到的分支名称
branch: gh-pages
folder: src/.vuepress/dist
token: ${{ secrets.TITLE }}
repository-name: zihu97/zihu.github.io
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# zihu.github.io
show zihu
# my-blog-giscus
这是一个vuepress-theme-hope主题驱动的博客
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "zihu-blog",
"version": "2.0.0",
"description": "personal blog",
"license": "MIT",
"type": "module",
"scripts": {
"docs:build": "vuepress build src",
"docs:clean-dev": "vuepress dev src --clean-cache",
"docs:dev": "vuepress dev src",
"docs:update-package": "yarn dlx vp-update"
},
"devDependencies": {
"@vuepress/client": "2.0.0-beta.61",
"reveal.js": "^5.0.2",
"vue": "^3.2.47",
"vuepress": "2.0.0-beta.61",
"vuepress-plugin-search-pro": "^2.0.0-beta.197",
"vuepress-theme-hope": "2.0.0-beta.197"
}
}
58 changes: 58 additions & 0 deletions src/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import {defineUserConfig} from "vuepress";
import theme from "./theme.js";
import {searchProPlugin} from "vuepress-plugin-search-pro";

// @ts-ignore
// @ts-ignore
// @ts-ignore
export default defineUserConfig({
base: "/",
head: [
[
"link",
{rel: "icon", href: "/favicon.ico"},
],
[
`script`, {}, `
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?87276829dc72e9eeef7c53e10550b458";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
`
]
],
locales: {
"/": {
lang: "zh-CN",
title: "紫狐",
description: "紫狐的个人博客",
},
},

theme,
plugins: [
searchProPlugin({
// 索引全部内容
indexContent: true,
// 为分类和标签添加索引
customFields: [
{
//@ts-ignore
getter: (page) => page.frontmatter.category,
formatter: "分类:$content",
},
{
//@ts-ignore
getter: (page) => page.frontmatter.tag,
formatter: "标签:$content",
},
],
}),
]

// Enable it with pwa
// shouldPrefetch: false,
});
1 change: 1 addition & 0 deletions src/.vuepress/navbar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./zh.js";
25 changes: 25 additions & 0 deletions src/.vuepress/navbar/zh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {navbar} from "vuepress-theme-hope";

export const zhNavbar = navbar([
{
text: "技术文章",
icon: "build",
link: "/category/技术日志/",
},
{
text: "其它分类",
icon: "guide",
children: [
{
text: "Linux",
icon: "linux",
link: "/category/Linux/"
},
]
},
{
text: "时间轴",
icon: "time",
link: "/timeline",
},
]);
Binary file added src/.vuepress/public/favicon.ico
Binary file not shown.
Binary file added src/.vuepress/public/giscus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/.vuepress/public/golang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/.vuepress/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/.vuepress/public/snow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/.vuepress/public/vuepress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/.vuepress/sidebar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./zh.js";
13 changes: 13 additions & 0 deletions src/.vuepress/sidebar/zh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { sidebar } from "vuepress-theme-hope";

export const zhSidebar = sidebar({
"/NaN": [
{
text: "文章",
icon: "note",
prefix: "posts/",
children: "structure",
},
"intro",
],
});
3 changes: 3 additions & 0 deletions src/.vuepress/styles/config.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// you can change config here
$colors: #c0392b, #d35400, #f39c12, #27ae60, #16a085, #2980b9, #8e44ad, #2c3e50,
#7f8c8d !default;
18 changes: 18 additions & 0 deletions src/.vuepress/styles/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// place your custom styles here
// 文章摘要样式修改,确保文字永远在图片下面
.article-excerpt {
p {
display: flex;
justify-content: center;
flex-direction: column;
}
img {
margin-bottom: 5px;
border-radius: 1%;
}
}

// 解决文章过少时个人信息卡片顶入导航栏的问题
.page .blog-info-wrapper {
margin-top: 0.5rem;
}
2 changes: 2 additions & 0 deletions src/.vuepress/styles/palette.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// you can change colors here
$theme-color: #096dd9;
105 changes: 105 additions & 0 deletions src/.vuepress/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import {hopeTheme} from "vuepress-theme-hope";
import {zhNavbar} from "./navbar";
import {zhSidebar} from "./sidebar";

export default hopeTheme({
hostname: "https://zihu.github.io",

author: {
name: "Mr.Hope",
url: "https://mister-hope.com",
},

iconAssets: "iconfont",

logo: "/logo.png",

docsDir: "docs",
editLink: false,
blog: {
medias: {
GitHub: "https://github.com/zihu97",
Email: "mailto:[email protected]",
},
},

locales: {
"/": {
navbar: zhNavbar,

sidebar: zhSidebar,

footer: "哈哈哈哈",

displayFooter: false,

blog: {
description: "一个内核爱好者",
intro: "/intro.html",
},

// page meta
metaLocales: {
editLink: "在 GitHub 上编辑此页",
},
},
},

plugins: {
comment: {
provider: "Giscus",
repo: "zihu97/zihu.github.io",
repoId: "R_kgDOMMvIMA",
category: "Announcements",
categoryId: "DIC_kwDOMMvIMM4CgSKR",
inputPosition: "top",
lazyLoading: true,
},
readingTime: {
wordPerMinute: 150
},
feed: {
rss: true,
},
blog: true,
// all features are enabled for demo, only preserve features you need here
mdEnhance: {
align: true,
attrs: true,
chart: true,
codetabs: true,
demo: true,
echarts: true,
figure: true,
flowchart: true,
gfm: true,
imgLazyload: true,
imgSize: true,
include: true,
katex: true,
mark: true,
mermaid: true,
presentation: {
plugins: ["highlight", "math", "search", "notes", "zoom"],
},
stylize: [
{
matcher: "Recommended",
replacer: ({tag}) => {
if (tag === "em")
return {
tag: "Badge",
attrs: {type: "tip"},
content: "Recommended",
};
},
},
],
sub: true,
sup: true,
tabs: true,
vPre: true,
vuePlayground: true,
},
},
});
21 changes: 21 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
home: true
layout: BlogHome
icon: home
title: 博客主页
heroImage: /logo.png
heroText: 紫狐
bgImage: /snow.png
heroFullScreen: true
tagline: 大家好啊
projects:
- icon: /golang.png
name: Go学习文档站
desc: Go爱好者驱动的学习文档站
link: https://golang.halfiisland.com/

- icon: /giscus.png
name: Giscus
desc: 由 GitHub Discussions 驱动的评论系统
link: https://giscus.app/zh-CN
---
9 changes: 9 additions & 0 deletions src/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
icon: profile
article: false
---

# 我的路

路漫漫其修远兮,吾将上下而求索
<!-- more -->
Loading

0 comments on commit d73f866

Please sign in to comment.