Skip to content

Commit

Permalink
feat: add test blog
Browse files Browse the repository at this point in the history
  • Loading branch information
RainyNight9 committed Apr 18, 2024
1 parent 7b172cd commit 9e43026
Show file tree
Hide file tree
Showing 71 changed files with 5,592 additions and 1,032 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

name: 部署文档

on:
push:
branches:
- test

permissions:
contents: write

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

- name: 设置 pnpm
uses: pnpm/action-setup@v2
with:
version: 8


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

- name: 安装依赖
run: |
corepack enable
pnpm install --frozen-lockfile
- name: 构建文档
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
pnpm run docs:build
> blog/.vuepress/dist/.nojekyll
- name: 部署文档
uses: JamesIves/github-pages-deploy-action@v4
with:
# 部署文档
branch: gh-pages
folder: blog/.vuepress/dist
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ node_modules
.DS_Store

docs/.vuepress/dist

node_modules/
blog/.vuepress/.cache/
blog/.vuepress/.temp/
blog/.vuepress/dist/
24 changes: 24 additions & 0 deletions blog/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineUserConfig } from "vuepress";
import theme from "./theme.js";

export default defineUserConfig({
base: "/",

locales: {
"/": {
lang: "en-US",
title: "Blog Demo",
description: "A blog demo for vuepress-theme-hope",
},
"/zh/": {
lang: "zh-CN",
title: "博客演示",
description: "vuepress-theme-hope 的博客演示",
},
},

theme,

// Enable it with pwa
// shouldPrefetch: false,
});
2 changes: 2 additions & 0 deletions blog/.vuepress/logo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const MR_HOPE_AVATAR =
'<svg viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient gradientTransform="matrix(.2478 .78133 -2.54797 .63622 910.35 281.58)" gradientUnits="userSpaceOnUse" id="a" x1="37.827" x2="159.988" y1="272.916" y2="274.63"><stop offset=".75" stop-color="#e33939"/><stop offset=".998" stop-color="#fff"/></linearGradient><linearGradient gradientTransform="matrix(.13814 .80797 2.55599 -.6032 34.087 494.369)" gradientUnits="userSpaceOnUse" id="b" x1="37.827" x2="159.988" y1="272.916" y2="274.63"><stop offset=".815" stop-color="#e33939"/><stop offset="1" stop-color="#fff"/></linearGradient></defs><path d="M135.637 588.067c-48.891-201.334 74.605-404.162 275.837-453.028 201.233-48.866 403.998 74.734 452.889 276.068 48.892 201.335-74.606 404.162-275.838 453.029-201.233 48.866-403.997-74.734-452.888-276.069Z" fill="#fde68a" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="10"/><path d="M596.076 197.044c-3.342-56.09 56.897-77.831 89.017-51.361m-410.65 128.819c-22.753-51.377-86.256-43.07-102.659-4.816" fill="none" stroke="#6d5e56" stroke-linecap="round" stroke-linejoin="round" stroke-width="11"/><path d="M833.568 288.02c.05 18.046-12.584 30.699-21.346 32.211-8.762 1.512-17.031-1.099-18.584-1.341 0 0-61.363-6.103-105.627 6.921-44.265 13.026-87.04 47.387-94.637 51.892-6.627 3.928-29.112 7.697-44.462-12.938-15.351-20.636.024-41.526.024-41.526s12.685-18.279 40.771-35.123c28.088-16.844 24.624-13.226 52.326-25.696 15.247-6.865 43.319-14.186 67.429-17.069 25.193-3.011 46.348-1.384 57.673.769 22.165 4.212 28.632 5.93 39.169 9.229 12.451 3.898 27.214 14.516 27.264 32.671Z" fill="#fff" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"/><path d="M558.351 345.632c-3.458-14.237 5.214-28.566 19.367-32.003 14.154-3.437 28.43 5.32 31.887 19.557 3.458 14.238-5.212 28.567-19.367 32.004-14.152 3.437-28.43-5.319-31.887-19.558Z" fill="#6d5e56" fill-rule="evenodd" stroke="#6d5e56" stroke-linecap="round" stroke-linejoin="round" stroke-width="6.268"/><path d="M220.249 483.416c46.81-11.689 91.323-.467 99.42 25.064 8.098 25.532-23.286 55.706-70.097 67.393-46.811 11.689-91.323.467-99.42-25.064-8.097-25.532 23.286-55.706 70.097-67.393Z" fill="url(#a)" fill-rule="evenodd" opacity=".261"/><path d="M739.9 357.226c-46.959 11.082-81.367 41.469-76.853 67.871 4.514 26.402 46.241 38.821 93.198 27.738 46.958-11.081 81.366-41.467 76.853-67.869-4.514-26.403-46.241-38.821-93.198-27.74Z" fill="url(#b)" fill-rule="evenodd" opacity=".261"/><path d="M400.934 398.917c-.599 18.034-13.681 30.218-22.494 31.409-8.812 1.192-16.982-1.716-18.526-2.014 0 0-61.109-8.334-105.819 3.07-44.709 11.404-88.696 44.181-96.452 48.406-6.763 3.683-29.372 6.632-43.972-14.546-14.6-21.18 1.519-41.494 1.519-41.494s13.335-17.803 42.013-33.612c28.677-15.809 25.085-12.319 53.222-23.772 15.484-6.304 43.803-12.598 68.005-14.6 25.288-2.093 46.373.305 57.616 2.867 22 5.016 28.401 6.968 38.813 10.649 12.304 4.348 26.677 15.496 26.075 33.637Z" fill="#fff" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="8"/><path d="M129.05 445.546c-3.458-14.239 5.213-28.566 19.367-32.003 14.153-3.437 28.429 5.318 31.887 19.557 3.458 14.238-5.213 28.566-19.367 32.003-14.153 3.437-28.43-5.318-31.887-19.557Z" fill="#6d5e56" fill-rule="evenodd" stroke="#6d5e56" stroke-linecap="round" stroke-linejoin="round" stroke-width="6.268"/><path d="M424.381 696.386s64.427 13.646 101.996 5.757C640.653 678.146 690.8 521.894 690.8 521.894" fill="none" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="11"/><path d="M796.04 666.774s-10.734-44.165-41.405-11.348c-9.681 10.359-10.438 40.604-28.217 81.89-15.942 37.02-39.564 60.728-42.938 76.063-3.374 15.335.451 35.992 26.352 41.537 25.902 5.545 41.967-23.381 41.967-23.381l44.241-164.761Z" fill="#fde68a" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="10"/><path d="M793.337 664.734c-37.075 160.045-51.73 163.145-40.343 184.845 11.387 21.701 51.417 33.716 71.876-7.313 6.734-13.505-1.31-43.317-1.511-78.077-.307-53.06 16.865-86.111 10.403-98.1-15.332-28.452-39.377-5.875-40.425-1.355Z" fill="#fde68a" fill-rule="evenodd" stroke="#d08819" stroke-linecap="round" stroke-linejoin="round" stroke-width="10"/></svg>';
52 changes: 52 additions & 0 deletions blog/.vuepress/navbar/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { navbar } from "vuepress-theme-hope";

export const enNavbar = navbar([
"/",
"/demo/",
{
text: "Posts",
icon: "pen-to-square",
prefix: "/posts/",
children: [
{
text: "Apple",
icon: "pen-to-square",
prefix: "apple/",
children: [
{ text: "Apple1", icon: "pen-to-square", link: "1" },
{ text: "Apple2", icon: "pen-to-square", link: "2" },
"3",
"4",
],
},
{
text: "Banana",
icon: "pen-to-square",
prefix: "banana/",
children: [
{
text: "Banana 1",
icon: "pen-to-square",
link: "1",
},
{
text: "Banana 2",
icon: "pen-to-square",
link: "2",
},
"3",
"4",
],
},
{ text: "Cherry", icon: "pen-to-square", link: "cherry" },
{ text: "Dragon Fruit", icon: "pen-to-square", link: "dragonfruit" },
"tomato",
"strawberry",
],
},
{
text: "V2 Docs",
icon: "book",
link: "https://theme-hope.vuejs.press/",
},
]);
2 changes: 2 additions & 0 deletions blog/.vuepress/navbar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./en.js";
export * from "./zh.js";
52 changes: 52 additions & 0 deletions blog/.vuepress/navbar/zh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { navbar } from "vuepress-theme-hope";

export const zhNavbar = navbar([
"/zh/",
"/zh/demo/",
{
text: "博文",
icon: "pen-to-square",
prefix: "/zh/posts/",
children: [
{
text: "苹果",
icon: "pen-to-square",
prefix: "apple/",
children: [
{ text: "苹果1", icon: "pen-to-square", link: "1" },
{ text: "苹果2", icon: "pen-to-square", link: "2" },
"3",
"4",
],
},
{
text: "香蕉",
icon: "pen-to-square",
prefix: "banana/",
children: [
{
text: "香蕉 1",
icon: "pen-to-square",
link: "1",
},
{
text: "香蕉 2",
icon: "pen-to-square",
link: "2",
},
"3",
"4",
],
},
{ text: "樱桃", icon: "pen-to-square", link: "cherry" },
{ text: "火龙果", icon: "pen-to-square", link: "dragonfruit" },
"tomato",
"strawberry",
],
},
{
text: "V2 文档",
icon: "book",
link: "https://theme-hope.vuejs.press/zh/",
},
]);
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 blog/.vuepress/public/assets/icon/chrome-192.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 blog/.vuepress/public/assets/icon/chrome-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 blog/.vuepress/public/assets/icon/ms-icon-144.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 blog/.vuepress/public/assets/images/cover1.jpg
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 blog/.vuepress/public/assets/images/cover2.jpg
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 blog/.vuepress/public/assets/images/cover3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9e43026

Please sign in to comment.