Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Dec 12, 2024
0 parents commit b912e21
Show file tree
Hide file tree
Showing 244 changed files with 13,058 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/deploy-docs-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: deploy-docs-site

on:
# 每当 push 到 main 分支时触发部署
push:
branches: [main]
# 手动触发部署
workflow_dispatch:

jobs:
docs-github:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
# 选择要使用的 node 版本
node-version: 20
registry-url: https://registry.npmmirror.com/

- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install antfu/ni
run: npm i -g @antfu/ni

- name: Install dependencies
run: ni --frozen

# 运行构建脚本
- name: Build VitePress site
run: nr build

# 查看 workflow 的文档来获取更多信息
# @see https://github.com/crazy-max/ghaction-github-pages
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v3
with:
# 部署到 gh-pages 分支
target_branch: gh-pages
# 部署目录为 VitePress 的默认输出目录
build_dir: .vitepress/dist
env:
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.vitepress/cache
.vitepress/dist
.eslintcache
190 changes: 190 additions & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
import { defineConfig } from 'vitepress'

export default defineConfig({
title: 'Fantastic-admin 官方文档',
description: '一款开箱即用的 Vue 中后台管理系统框架,采用 Vue3 + Vite 技术栈。',
lang: 'zh-CN',
base: '/v4-docs/',
head: [
['link', { rel: 'icon', href: './favicon.ico' }],
['meta', { 'http-equiv': 'Expires', 'content': '0' }],
['meta', { 'http-equiv': 'Pragma', 'content': 'no-cache' }],
['meta', { 'http-equiv': 'Cache-control', 'content': 'no-cache' }],
['meta', { 'http-equiv': 'Cache', 'content': 'no-cache' }],
['meta', { name: 'keywords', content: 'fantastic-admin,后台系统,管理后台,后台模版,vue后台,vue-admin,vue-element-admin,vue-admin-template' }],
['keywords', { content: 'fantastic-admin,后台系统,管理后台,后台模版,vue后台,vue-admin,vue-element-admin,vue-admin-template' }],
['description', { content: '一款开箱即用的 Vue 中后台管理系统框架,采用 Vue3 + Vite 技术栈。' }],
],
themeConfig: {
logo: '/logo.png',
footer: {
copyright: 'Copyright © 2020-present Fantastic-admin',
},
nav: [
{
text: '文档',
items: [
{
text: '指南',
link: '/guide/intro',
},
{
text: '组件',
link: '/components/index',
},
],
},
],
socialLinks: [
{
icon: {
svg: '<svg t="1663266323098" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2880" width="200" height="200"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z" p-id="2881"></path></svg>',
},
link: 'https://gitee.com/fantastic-admin/basic',
},
{
icon: 'github',
link: 'https://github.com/fantastic-admin/basic',
},
],
sidebar: {
'/guide/': [
{
text: '指引',
items: [
{ text: '文档说明', link: '/guide/intro' },
{ text: '更新日志', link: '/guide/changelog' },
],
collapsed: false,
},
{
text: '入门',
items: [
{ text: '准备工作', link: '/guide/ready' },
{ text: '开始', link: '/guide/start' },
{ text: '代码规范', link: '/guide/coding-standard' },
{ text: '术语', link: '/guide/term' },
{ text: '配置', link: '/guide/configure' },
{ text: '开发者工具', link: '/guide/devtools' },
{ text: '路由(导航)', link: '/guide/router' },
{ text: '与服务端交互', link: '/guide/axios' },
{ text: '全局状态管理', link: '/guide/store' },
{ text: '资源', link: '/guide/resources' },
{ text: '图标', link: '/guide/svg-icon' },
{ text: '构建与预览', link: '/guide/build' },
],
collapsed: false,
},
{
text: '进阶',
items: [
{ text: '登录', link: '/guide/login' },
{ text: '权限', link: '/guide/permission' },
{ text: '主页', link: '/guide/home' },
{ text: '布局', link: '/guide/layout' },
{ text: '主题', link: '/guide/theme' },
{ text: '动态标题', link: '/guide/title' },
{ text: '导航菜单', link: '/guide/menu' },
{ text: '顶栏', link: '/guide/topbar' },
{ text: '标签栏', link: '/guide/tabbar' },
{ text: '工具栏', link: '/guide/toolbar' },
{ text: '收藏夹', link: '/guide/favorites' },
{ text: '面包屑导航', link: '/guide/breadcrumb' },
{ text: '快捷键', link: '/guide/hotkeys' },
{ text: '版权信息', link: '/guide/copyright' },
],
collapsed: false,
},
{
text: '高级',
items: [
{ text: '页面缓存', link: '/guide/keep-alive' },
{ text: '国际化', link: '/guide/i18n' },
{ text: 'RTL 模式', link: '/guide/rtl' },
{ text: '代码文件自动生成', link: '/guide/plop' },
{ text: '标准模块', link: '/guide/plop-module' },
{ text: '常用 API', link: '/guide/api' },
{ text: '私有 Storage 数据', link: '/guide/storage' },
{ text: '首屏 Loading', link: '/guide/loading' },
{ text: '页面水印', link: '/guide/watermark' },
{ text: '错误日志', link: '/guide/error-log' },
{ text: '自定义字体', link: '/guide/font' },
{ text: '用户偏好设置', link: '/guide/preferences' },
{ text: 'JSX', link: '/guide/jsx' },
{ text: '基于文件系统的路由', link: '/guide/file-system-route' },
{ text: '使用 Composition API 开发', link: '/guide/vue3-composition-api' },
{ text: '高级 position:fixed', link: '/guide/position-fixed' },
{
text: '替换 UI 组件库',
items: [
{ text: '替换为 Ant Design Vue', link: '/guide/replace-to-antd' },
{ text: '替换为 Arco Design Vue', link: '/guide/replace-to-arco' },
{ text: '替换为 Naive UI', link: '/guide/replace-to-naive' },
{ text: '替换为 TDesign', link: '/guide/replace-to-tdesign' },
{ text: '替换为 Vexip UI', link: '/guide/replace-to-vexip' },
{ text: '替换为 iDux', link: '/guide/replace-to-idux' },
],
collapsed: true,
},
],
collapsed: false,
},
{
text: '其它',
items: [
{ text: '框架更新', link: '/guide/upgrade' },
{ text: '从 vue-element-admin 迁移', link: '/guide/vea-to-fa' },
{ text: '常见问题', link: '/guide/q-a' },
],
collapsed: false,
},
],
'/components/': [
{
text: '组件',
items: [
{ text: '介绍', link: '/components/' },
],
},
{
text: '扩展组件',
items: [
{ text: 'Auth 鉴权', link: '/components/auth' },
{ text: 'PageHeader 页头', link: '/components/page-header' },
{ text: 'PageMain 内容块', link: '/components/page-main' },
{ text: 'FixedActionBar 固定底部操作栏', link: '/components/fixed-action-bar' },
{ text: 'SearchBar 搜索面板', link: '/components/search-bar' },
{ text: 'ImageUpload 单图上传', link: '/components/image-upload' },
{ text: 'ImagesUpload 多图上传', link: '/components/images-upload' },
{ text: 'FileUpload 文件上传', link: '/components/file-upload' },
{ text: 'ImagePreview 图片预览', link: '/components/image-preview' },
{ text: 'SvgIcon SVG图标', link: '/components/svg-icon' },
{ text: 'Trend 趋势标记', link: '/components/trend' },
{ text: 'PcasCascader 省市区街道联动', link: '/components/pcas-cascader' },
{ text: 'LayoutContainer 布局容器', link: '/components/layout-container' },
{ text: 'Chip 纸片', link: '/components/chip' },
{ text: 'ColorfulCard 多彩渐变卡片', link: '/components/colorful-card' },
{ text: 'IconPicker 图标选择器', link: '/components/icon-picker' },
{ text: 'Sparkline 迷你图', link: '/components/sparkline' },
{ text: 'I18nSelector 国际化选择器', link: '/components/i18n-selector' },
{ text: 'StorageBox 储存箱', link: '/components/storage-box' },
],
},
],
},
outline: 'deep',
search: {
provider: 'local',
options: {
translations: {
button: { buttonText: '搜索文档', buttonAriaLabel: '搜索文档' },
modal: {
noResultsText: '无法找到相关结果',
resetButtonTitle: '清除查询条件',
footer: { selectText: '选择', navigateText: '切换', closeText: '关闭' },
},
},
},
},
},
})
114 changes: 114 additions & 0 deletions .vitepress/theme/components/Activity.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
const isVisible = ref(false)
const nameStorage = 'ACTIVITY-FANTASTIC-MOBILE-1'
function go() {
window.location.href = 'https://fantastic-mobile.hurui.me/'
}
function closeBanner() {
isVisible.value = false
localStorage.setItem(nameStorage, String(true))
document.documentElement.classList.remove('mirror-site-menu-fixed')
}
onMounted(() => {
isVisible.value = !localStorage.getItem(nameStorage)
if (isVisible.value)
document.documentElement.classList.add('mirror-site-menu-fixed')
})
</script>

<template>
<div v-if="isVisible" class="banner-wrapper" role="banner">
<div id="banner" @click="go">
<div class="content">
全新移动端 H5 框架 Fantastic-mobile 正式发布,点击查看详情
</div>
<button id="banner-close" @click.stop="closeBanner">
<span class="close">&times;</span>
</button>
</div>
</div>
</template>

<style scoped>
.banner-wrapper {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 61;
width: 100%;
height: 100%;
max-height: 40px;
background: linear-gradient(45deg, #0a2b4e, #835ec2);
overflow: hidden;
margin: 0;
transition: background-size 0.25s cubic-bezier(0.39, 0.575, 0.565, 1);
}
#banner {
position: relative;
width: 100%;
height: 100%;
text-decoration: none;
color: white;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
cursor: pointer;
}
#banner .content {
margin: 0;
padding: 0;
font-weight: bold;
font-size: 18px;
letter-spacing: 2px;
text-align: center;
background: linear-gradient(145deg, #c3ffac, #86ec87);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
#banner-close {
position: absolute;
width: 40px;
height: 100%;
top: 0;
right: 0;
color: #fff;
font-size: 20px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
}
#banner-close:hover > .close {
color: #86ec87;
}
#banner-close > .close {
font-size: 20px;
font-weight: 600;
}
@media screen and (max-width: 767px) {
#banner .content {
font-size: 14px;
}
}
</style>

<style>
html.mirror-site-menu-fixed {
--vp-layout-top-height: 40px;
}
</style>
Loading

0 comments on commit b912e21

Please sign in to comment.