Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Jun 17, 2024
1 parent 310eb03 commit f5eb73a
Show file tree
Hide file tree
Showing 61 changed files with 2,274 additions and 554 deletions.
251 changes: 187 additions & 64 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,70 +35,193 @@ _hmt.push(['_requirePlugin', 'UrlChangeTracker', {
footer: {
copyright: 'Copyright © 2024-present Fantastic-mobile',
},
// nav: [
// {
// text: '指南',
// link: '/guide/start',
// },
// {
// text: '技术支持',
// link: '/support',
// },
// ],
// 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-mobile/basic',
// },
// {
// icon: 'github',
// link: 'https://github.com/fantastic-mobile/basic',
// },
// ],
// sidebar: {
// '/guide/': [
// {
// text: '指南',
// items: [
// { text: '开始', link: '/guide/start' },
// { text: '代码规范', link: '/guide/coding-standard' },
// { text: '环境配置', link: '/guide/configure' },
// { text: '全局资源', link: '/guide/global-resources' },
// { text: '图标', link: '/guide/svg-icon' },
// { text: '路由', link: '/guide/router' },
// { text: '全局状态管理', link: '/guide/store' },
// { text: '与服务端交互', link: '/guide/axios' },
// { text: '代码文件自动生成', link: '/guide/plop' },
// { text: '常用 API', link: '/guide/api' },
// { text: '移动端支持', link: '/guide/mobile-support' },
// { text: '构建与预览', link: '/guide/build' },
// ],
// },
// ],
// '/': [
// {
// text: '',
// items: [
// { text: '技术支持', link: '/support' },
// ],
// },
// ],
// },
nav: [
{
text: '指南',
link: '/guide/intro',
},
{
text: '组件',
link: '/components/index',
},
{
text: '在线演示',
items: [
{
text: 'Github',
items: [
{
text: '基础版',
link: 'https://fantastic-mobile.github.io/basic-example',
},
{
text: '专业版',
link: 'https://fantastic-mobile.github.io/pro-example',
},
],
},
{
text: 'Cloudflare',
items: [
{
text: '基础版',
link: 'https://fantastic-mobile.pages.dev/basic-example',
},
{
text: '专业版',
link: 'https://fantastic-mobile.pages.dev/pro-example',
},
],
},
],
},
{
text: '技术支持',
link: '/support',
},
{
text: '下载 / 购买',
items: [
{
text: '下载基础版',
link: 'https://github.com/fantastic-mobile/basic/releases',
},
{
text: '购买专业版 ⭐',
link: '/buy',
},
],
},
],
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-mobile/basic',
},
{
icon: 'github',
link: 'https://github.com/fantastic-mobile/basic',
},
],
sidebar: {
'/guide/': [
{
text: '指引',
items: [
{ text: '文档说明', link: '/guide/intro' },
{ text: '为什么选择我们 ?', link: '/guide/why' },
{ text: '更新日志', link: '/guide/changelog' },
],
collapsed: false,
},
{
text: '入门',
items: [
{ text: '准备工作', link: '/guide/ready' },
{ text: '开始', link: '/guide/start' },
{ text: '代码规范', link: '/guide/coding-standard' },
{ text: '配置', link: '/guide/configure' },
{ text: '开发者工具', link: '/guide/devtools' },
{ text: '路由', link: '/guide/router' },
{ text: '与服务端交互', link: '/guide/axios' },
{ text: '全局状态管理', link: '/guide/store' },
{ text: '全局资源', link: '/guide/global-resources' },
{ text: '图标', link: '/guide/svg-icon' },
{ text: '构建与预览', link: '/guide/build' },
],
collapsed: false,
},
{
text: '进阶',
items: [
{ text: '浏览器适配', link: '/guide/viewport' },
{ text: 'PageLayout 组件', link: '/guide/page-layout' },
{ text: '登录', link: '/guide/login' },
{ text: '权限', link: '/guide/permission' },
{ text: '主题', link: '/guide/theme' },
{ text: '动态标题', link: '/guide/title' },
],
collapsed: false,
},
{
text: '高级',
items: [
{ text: '页面缓存', link: '/guide/keep-alive' },
{ text: '国际化', link: '/guide/i18n' },
{ text: '常用 API', link: '/guide/api' },
{ text: '私有 Storage 数据', link: '/guide/storage' },
{ text: '页面水印', link: '/guide/watermark' },
{ text: '错误日志', link: '/guide/error-log' },
{ text: '自定义字体', link: '/guide/font' },
{ text: '使用 Composition API 开发', link: '/guide/vue3-composition-api' },
// {
// 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: '常见问题', link: '/guide/q-a' },
],
collapsed: false,
},
],
'/components/': [
{
text: '组件',
items: [
{ text: '介绍', link: '/components/' },
],
},
{
text: '扩展组件',
items: [
{ text: 'Auth 鉴权', link: '/components/auth' },
{ text: 'AuthAll 鉴权', link: '/components/auth-all' },
{ text: 'PageMain 内容块', link: '/components/page-main' },
{ text: 'SvgIcon SVG图标', link: '/components/svg-icon' },
{ text: 'Trend 趋势标记', link: '/components/trend' },
{ text: 'Sparkline 迷你图', link: '/components/sparkline' },
],
},
],
'/': [
{
text: '',
items: [
{ text: '购买专业版', link: '/buy' },
{ text: '技术支持', link: '/support' },
],
},
],
},
outline: 'deep',
// search: {
// provider: 'local',
// options: {
// translations: {
// button: { buttonText: '搜索文档', buttonAriaLabel: '搜索文档' },
// modal: {
// noResultsText: '无法找到相关结果',
// resetButtonTitle: '清除查询条件',
// footer: { selectText: '选择', navigateText: '切换', closeText: '关闭' },
// },
// },
// },
// },
search: {
provider: 'local',
options: {
translations: {
button: { buttonText: '搜索文档', buttonAriaLabel: '搜索文档' },
modal: {
noResultsText: '无法找到相关结果',
resetButtonTitle: '清除查询条件',
footer: { selectText: '选择', navigateText: '切换', closeText: '关闭' },
},
},
},
},
},
})
6 changes: 6 additions & 0 deletions .vitepress/theme/components/SponsorsAside.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
作者其他作品
</div>
<div class="sponsor-container special">
<a href="https://hooray.github.io/fantastic-startkit/" target="_blank" class="sponsor-item">
<div class="info">
<div class="main">Fantastic-startkit</div>
<div class="sub">简单好用的 Vue3 项目启动套件</div>
</div>
</a>
<a href="https://fantastic-admin.github.io/" target="_blank" class="sponsor-item">
<img src="https://fantastic-admin.github.io/logo.png">
<div class="info">
Expand Down
13 changes: 13 additions & 0 deletions .vitepress/theme/components/ZoomImg.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script setup lang="ts">
import { withBase } from 'vitepress'
defineProps({
src: String,
})
</script>

<template>
<p v-if="src">
<img data-zoomable :src="withBase(src)" loading="lazy">
</p>
</template>
19 changes: 17 additions & 2 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { h, toRefs } from 'vue'
import Theme from 'vitepress/theme'
import { h, nextTick, onMounted, toRefs, watch } from 'vue'
import Theme, { VPBadge } from 'vitepress/theme'
import giscusTalk from 'vitepress-plugin-comment-with-giscus'
import { useData, useRoute } from 'vitepress'
import './fonts/fira_code/fira_code.css'
import './styles/var.css'
import mediumZoom from 'medium-zoom'
import SponsorsAside from './components/SponsorsAside.vue'
import ZoomImg from './components/ZoomImg.vue'

export default {
...Theme,
Expand All @@ -18,6 +20,15 @@ export default {
const { frontmatter } = toRefs(useData())
const route = useRoute()

const initZoom = () => {
mediumZoom('[data-zoomable]', { background: 'var(--vp-c-bg)' })
}
onMounted(() => initZoom())
watch(
() => route.path,
() => nextTick(() => initZoom()),
)

// 评论组件 - https://giscus.app/
giscusTalk({
repo: 'fantastic-mobile/fantastic-mobile.github.io',
Expand All @@ -40,4 +51,8 @@ export default {
// 可以在页面使用 `comment: true` 前言单独启用
true)
},
enhanceApp({ app }) {
app.component('Badge', VPBadge)
app.component('ZoomImg', ZoomImg)
},
}
29 changes: 29 additions & 0 deletions .vitepress/theme/styles/var.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* 侧边栏 */
:root {
--vp-sidebar-width: 294px;
}
/* 字体 */
:root {
--vp-font-family-mono: ui-monospace, SFMono-Regular, 'Fira Code', 'SF Mono', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
Expand Down Expand Up @@ -39,3 +43,28 @@
left: 85px;
font-size: 18px;
}
/* medium-zoom */
.medium-zoom-overlay {
z-index: 30;
}
.medium-zoom-image {
z-index: 30;
max-height: 500px;
}
/* 专业版 badge */
.VPBadge.pro {
border-color: goldenrod;
color: #333;
background-color: #e7c605;
}
a.cta {
text-align: center;
border-radius: 8px;
}
a.cta:hover {
border-color: var(--vp-c-brand);
background-color: var(--c-bg-accent);
}
a.cta.buy {
border-color: goldenrod;
}
Loading

0 comments on commit f5eb73a

Please sign in to comment.