Skip to content

Commit

Permalink
feat!: Rewrite component variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo-Messi committed Aug 7, 2024
1 parent 951d7ad commit 17bed4c
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 114 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ dist
*.swp
*.swo
._*
scss/
vue/

# Node.js模块
node_modules/
npm-debug.log
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineConfig({
]
},
define: {
FooterData: JSON.stringify(require('./data/FooterData').sections)
FooterData: JSON.stringify(require('./data/FooterData').Footer_Data)
}
},
themeConfig: {
Expand Down
16 changes: 2 additions & 14 deletions docs/.vitepress/data/AsideData.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
// src/banners.ts
export interface Banner {
link: string
icon: string
Activity?: string
name: string
hide1?: string
hide2?: string
info1?: string
info2?: string
}

export const banners: Banner[] = [
export const Aside_Data = [
// {
// link: 'https://fbinv01.fbaff.cc/auth/register?code=RZP3',
// icon: 'https://flyingbirdlimo.com/wp-content/uploads/2022/03/Flying-Bird-Logo-cropped.png',
// Activity: 'FlyingBird 618活动来了',
// info1: '月付 85折 优惠码 2461885',
// info2: '年付 64折 优惠码 2461880',
// info2: '年付 64折 优惠码 2461880'
// },
{
link: 'https://xx.theojs.cn/',
Expand Down
167 changes: 83 additions & 84 deletions docs/.vitepress/data/FooterData.ts
Original file line number Diff line number Diff line change
@@ -1,86 +1,85 @@
// src/footerData.ts
export interface Link {
name: string
href: string
}

export interface Section {
title: string
links: Link[]
internal?: boolean
}

export const sections: Section[] = [
{
title: 'GitHub Source',
links: [
{
name: 'Theo-Docs',
href: 'https://github.com/Theo-Messi/Theo-Docs'
},
{
name: '玄学宝典',
href: 'https://github.com/Theo-Messi/xx.theojs.cn'
},
{
name: '阿里云盘资源分享',
href: 'https://github.com/Theo-Messi/share.theojs.cn'
},
{
name: '常用配置文件',
href: 'https://github.com/Theo-Messi/dotfiles'
}
]
export const Footer_Data = {
beian: {
icp: '鄂ICP备2024060426号',
police: '粤公网安备44200102445449号'
},
{
title: '合作伙伴',
links: [
{ name: '银河录像局', href: 'https://nf.video/kaIuE' },
{ name: '奈飞小铺', href: 'https://ihezu.love/UKTer6' },
{
name: 'FlyingBird',
href: 'https://fbinv01.fbaff.cc/auth/register?code=RZP3'
},
{
name: 'Bridge The Wise',
href: 'https://patriot.ninja/aff.php?aff=1471'
},
{
name: 'SMS-Activate',
href: 'https://sms-activate.org/?ref=8170513'
}
]
author: {
name: 'Theo-Messi',
link: 'https://github.com/Theo-Messi',
time: 2019
},
{
title: '观影指南',
links: [
{
name: 'Netflix',
href: 'https://doc.theojs.cn/streaming/Netflix-guide'
},
{
name: 'Disney+',
href: 'https://doc.theojs.cn/streaming/Disney-introduce'
},
{
name: 'Spotify Premium',
href: 'https://doc.theojs.cn/streaming/Spotify'
},
{
name: 'YouTube Premium',
href: 'https://doc.theojs.cn/streaming/YouTube'
},
{ name: 'Hulu', href: 'https://doc.theojs.cn/streaming/Hulu' },
{ name: 'HBO Max', href: 'https://doc.theojs.cn/streaming/HBO-Max' }
]
},
{
title: '相关链接',
links: [
{ name: 'Theo-Docs', href: 'https://doc.theojs.cn/' },
{ name: '玄学宝典', href: 'https://xx.theojs.cn/' },
{ name: '阿里云盘资源分享', href: 'https://share.theojs.cn/' },
{ name: 'VitePress', href: 'https://vitepress.dev/' }
]
}
]
group: [
{
title: 'GitHub Source',
links: [
{
name: 'Theo-Docs',
href: 'https://github.com/Theo-Messi/Theo-Docs'
},
{
name: '玄学宝典',
href: 'https://github.com/Theo-Messi/xx.theojs.cn'
},
{
name: '阿里云盘资源分享',
href: 'https://github.com/Theo-Messi/share.theojs.cn'
},
{
name: '常用配置文件',
href: 'https://github.com/Theo-Messi/dotfiles'
}
]
},
{
title: '合作伙伴',
links: [
{ name: '银河录像局', href: 'https://nf.video/kaIuE' },
{ name: '奈飞小铺', href: 'https://ihezu.love/UKTer6' },
{
name: 'FlyingBird',
href: 'https://fbinv01.fbaff.cc/auth/register?code=RZP3'
},
{
name: 'Bridge The Wise',
href: 'https://patriot.ninja/aff.php?aff=1471'
},
{
name: 'SMS-Activate',
href: 'https://sms-activate.org/?ref=8170513'
}
]
},
{
title: '观影指南',
links: [
{
name: 'Netflix',
href: 'https://doc.theojs.cn/streaming/Netflix-guide'
},
{
name: 'Disney+',
href: 'https://doc.theojs.cn/streaming/Disney-introduce'
},
{
name: 'Spotify Premium',
href: 'https://doc.theojs.cn/streaming/Spotify'
},
{
name: 'YouTube Premium',
href: 'https://doc.theojs.cn/streaming/YouTube'
},
{ name: 'Hulu', href: 'https://doc.theojs.cn/streaming/Hulu' },
{ name: 'HBO Max', href: 'https://doc.theojs.cn/streaming/HBO-Max' }
]
},
{
title: '相关链接',
links: [
{ name: 'Theo-Docs', href: 'https://doc.theojs.cn/' },
{ name: '玄学宝典', href: 'https://xx.theojs.cn/' },
{ name: '阿里云盘资源分享', href: 'https://share.theojs.cn/' },
{ name: 'VitePress', href: 'https://vitepress.dev/' }
]
}
]
}
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {
DocAsideLogo,
HomeUnderline
} from '../../../package/vue'
import { banners } from '../data/AsideData'
import { Aside_Data } from '../data/AsideData'
export default {
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
'home-hero-info-before': () => h(Announcement),
'aside-ads-before': () => h(DocAsideLogo, { banners })
'aside-ads-before': () => h(DocAsideLogo, { Aside_Data })
})
},
enhanceApp: ({ app }) => {
Expand Down
6 changes: 3 additions & 3 deletions package/vue/DocAsideLogo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { defineComponent, PropType } from 'vue'
export default defineComponent({
name: 'DocAsideLogo',
props: {
banners: {
Aside_Data: {
type: Array as PropType<
Array<{
link: string
icon: string
name: string
name?: string
Activity?: string
hide1?: string
info1?: string
Expand All @@ -26,7 +26,7 @@ export default defineComponent({
<template>
<div>
<a
v-for="(banner, index) in banners"
v-for="(banner, index) in Aside_Data"
:key="index"
:href="banner.link"
:name="banner.Activity || banner.name"
Expand Down
20 changes: 12 additions & 8 deletions package/vue/HomeFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ import { defineComponent } from 'vue'
export default defineComponent({
name: 'Footer',
setup() {
const sections = FooterData
return { sections }
const Footer_Data = FooterData
return { Footer_Data }
}
})
</script>

<template>
<footer class="ba">
<div class="ff">
<div class="sc" v-for="(section, index) in sections" :key="index">
<div
class="sc"
v-for="(section, index) in Footer_Data.group"
:key="index"
>
<div class="st">{{ section.title }}</div>
<ul>
<li v-for="(link, idx) in section.links" :key="idx">
Expand All @@ -40,7 +44,7 @@ export default defineComponent({
name="ICP备案"
title="ICP备案"
>
<i class="fas fa-earth-americas"></i>鄂ICP备2024060426号
<i class="fas fa-earth-americas"></i>{{ Footer_Data.beian.icp }}
</a>
</span>
<span>
Expand All @@ -50,20 +54,20 @@ export default defineComponent({
name="公安备案"
title="公安备案"
>
<i class="fas fa-shield"></i>粤公网安备44200102445449号
<i class="fas fa-shield"></i>{{ Footer_Data.beian.police }}
</a>
</span>
</div>
<div class="flex" style="display: inline-block">
<span>
Copyright<i class="far fa-copyright"></i>2019 -
Copyright<i class="far fa-copyright"></i>{{ Footer_Data.author.time }} -
{{ new Date().getFullYear() }}
<a
target="_blank"
name="GitHub"
title="GitHub"
href="https://github.com/Theo-Messi"
>Theo-Messi</a
:href="Footer_Data.author.link"
>{{ Footer_Data.author.name }}</a
>. All Rights Reserved
</span>
</div>
Expand Down

0 comments on commit 17bed4c

Please sign in to comment.