更新文档

This commit is contained in:
Super Manito
2025-04-04 13:15:39 +08:00
parent cf0fccaa92
commit 421e0a42aa
21 changed files with 489 additions and 342 deletions

View File

@@ -1,13 +1,11 @@
<p align="center">
<a href="https://linuxmirrors.cn">
<img src="./docs/assets/images/logo.png" width="120">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/images/brand/dark/2.png" width="320">
<img alt="文本" src="docs/assets/images/brand/light/2.png" width="320">
</picture>
</a>
</p>
<p align="center">
<strong>
LinuxMirrors
</strong>
</p>
<p align="center">
GNU/Linux 更换系统软件源脚本及 Docker 安装脚本
</p>
@@ -19,95 +17,95 @@
<table align="center">
<tr>
<td><a href="https://www.debian.org" target="_blank"><img src="./docs/assets/images/icon/debian.svg" width="16" height="16" style="vertical-align: -0.45em"></a>&nbsp;Debian</td>
<td><a href="https://www.debian.org" target="_blank"><sub><img src="docs/assets/images/icon/debian.svg" width="16" height="16"></sub></a>&nbsp;Debian</td>
<td align="center">8 ~ 13</td>
</tr>
<tr>
<td><a href="https://cn.ubuntu.com" target="_blank"><img src="./docs/assets/images/icon/ubuntu.svg" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Ubuntu</td>
<td><a href="https://cn.ubuntu.com" target="_blank"><sub><img src="docs/assets/images/icon/ubuntu.svg" width="16" height="16"></sub></a>&nbsp;Ubuntu</td>
<td align="center">14 ~ 24</td>
</tr>
<tr>
<td><a href="https://www.kali.org" target="_blank"><img src="./docs/assets/images/icon/kali-linux.svg" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Kali Linux</td>
<td><a href="https://www.kali.org" target="_blank"><sub><img src="docs/assets/images/icon/kali-linux.svg" width="16" height="16"></sub></a>&nbsp;Kali Linux</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://linuxmint.com" target="_blank"><img src="./docs/assets/images/icon/linux-mint.ico" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Linux Mint</td>
<td><a href="https://linuxmint.com" target="_blank"><sub><img src="docs/assets/images/icon/linux-mint.ico" width="16" height="16"></sub></a>&nbsp;Linux Mint</td>
<td align="center">19 ~ 22 / LMDE 6</td>
</tr>
<tr>
<td><a href="https://www.deepin.org" target="_blank"><img src="./docs/assets/images/icon/deepin.png" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Deepin深度</td>
<td><a href="https://www.deepin.org" target="_blank"><sub><img src="docs/assets/images/icon/deepin.png" width="16" height="16"></sub></a>&nbsp;Deepin深度</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://zorin.com/os" target="_blank"><img src="./docs/assets/images/icon/zorin-os.png" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Zorin OS</td>
<td><a href="https://zorin.com/os" target="_blank"><sub><img src="docs/assets/images/icon/zorin-os.png" width="16" height="16"></sub></a>&nbsp;Zorin OS</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://www.armbian.org" target="_blank"><img src="./docs/assets/images/icon/armbian.png" width="16" height="16" style="vertical-align: -0.2em"></a>&nbsp;Armbian</td>
<td><a href="https://www.armbian.org" target="_blank"><sub><img src="docs/assets/images/icon/armbian.png" width="16" height="16"></sub></a>&nbsp;Armbian</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://www.proxmox.com" target="_blank"><img src="./docs/assets/images/icon/proxmox.svg" width="16" height="16" style="vertical-align: -0.2em"></a>&nbsp;Proxmox VE</td>
<td><a href="https://www.proxmox.com" target="_blank"><sub><img src="docs/assets/images/icon/proxmox.svg" width="16" height="16"></sub></a>&nbsp;Proxmox VE</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://www.raspberrypi.com" target="_blank"><img src="./docs/assets/images/icon/raspberry-pi.png" width="16" height="16" style="vertical-align: -0.2em"></a>&nbsp;Raspberry Pi OS</td>
<td><a href="https://www.raspberrypi.com" target="_blank"><sub><img src="docs/assets/images/icon/raspberry-pi.png" width="16" height="16"></sub></a>&nbsp;Raspberry Pi OS</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://access.redhat.com/products/red-hat-enterprise-linux" target="_blank"><img src="./docs/assets/images/icon/redhat.svg" width="16" height="16" style="vertical-align: -0.1em"></a>&nbsp;Red Hat Enterprise Linux</td>
<td><a href="https://access.redhat.com/products/red-hat-enterprise-linux" target="_blank"><sub><img src="docs/assets/images/icon/redhat.svg" width="16" height="16"></sub></a>&nbsp;Red Hat Enterprise Linux</td>
<td align="center">7 ~ 9</td>
</tr>
<tr>
<td><a href="https://fedoraproject.org/zh-Hans" target="_blank"><img src="./docs/assets/images/icon/fedora.ico" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Fedora</td>
<td><a href="https://fedoraproject.org/zh-Hans" target="_blank"><sub><img src="docs/assets/images/icon/fedora.ico" width="16" height="16"></sub></a>&nbsp;Fedora</td>
<td align="center">30 ~ 41</td>
</tr>
<tr>
<td><a href="https://www.centos.org" target="_blank"><img src="./docs/assets/images/icon/centos.svg" width="16" height="16" style="vertical-align: -0.1em"></a>&nbsp;CentOS</td>
<td><a href="https://www.centos.org" target="_blank"><sub><img src="docs/assets/images/icon/centos.svg" width="16" height="16"></sub></a>&nbsp;CentOS</td>
<td align="center">7 ~ 8 / Stream 8 ~ 10</td>
</tr>
<tr>
<td><a href="https://rockylinux.org" target="_blank"><img src="./docs/assets/images/icon/rocky-linux.svg" width="16" height="16" style="vertical-align: -0.25em"></a>&nbsp;Rocky Linux</td>
<td><a href="https://rockylinux.org" target="_blank"><sub><img src="docs/assets/images/icon/rocky-linux.svg" width="16" height="16"></sub></a>&nbsp;Rocky Linux</td>
<td align="center">8 ~ 9</td>
</tr>
<tr>
<td><a href="https://almalinux.org/zh-hans" target="_blank"><img src="./docs/assets/images/icon/almalinux.svg" width="16" height="16" style="vertical-align: -0.25em"></a>&nbsp;AlmaLinux</td>
<td><a href="https://almalinux.org/zh-hans" target="_blank"><sub><img src="docs/assets/images/icon/almalinux.svg" width="16" height="16"></sub></a>&nbsp;AlmaLinux</td>
<td align="center">8 ~ 9</td>
</tr>
<tr>
<td><a href="https://www.openeuler.org/zh" target="_blank"><img src="./docs/assets/images/icon/openeuler.ico" width="16" height="16" style="vertical-align: -0.2em"></a>&nbsp;openEuler开源欧拉</td>
<td><a href="https://www.openeuler.org/zh" target="_blank"><sub><img src="docs/assets/images/icon/openeuler.ico" width="16" height="16"></sub></a>&nbsp;openEuler开源欧拉</td>
<td align="center">21 ~ 24</td>
</tr>
<tr>
<td><a href="https://www.opencloudos.org" target="_blank"><img src="./docs/assets/images/icon/opencloudos.png" width="16" height="16" style="vertical-align: -0.25em"></a>&nbsp;OpenCloudOS鸥栖</td>
<td><a href="https://www.opencloudos.org" target="_blank"><sub><img src="docs/assets/images/icon/opencloudos.png" width="16" height="16"></sub></a>&nbsp;OpenCloudOS鸥栖</td>
<td align="center">8.6 ~ 9 / Stream 23</td>
</tr>
<tr>
<td><a href="https://www.openkylin.top" target="_blank"><img src="./docs/assets/images/icon/openkylin.ico" width="16" height="16" style="vertical-align: -0.25em"></a>&nbsp;openKylin开放麒麟</td>
<td><a href="https://www.openkylin.top" target="_blank"><sub><img src="docs/assets/images/icon/openkylin.ico" width="16" height="16"></sub></a>&nbsp;openKylin开放麒麟</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://openanolis.cn" target="_blank"><img src="./docs/assets/images/icon/anolis.png" width="16" height="16" style="vertical-align: -0.1em"></a>&nbsp;Anolis OS龙蜥</td>
<td><a href="https://openanolis.cn" target="_blank"><sub><img src="docs/assets/images/icon/anolis.png" width="16" height="16"></sub></a>&nbsp;Anolis OS龙蜥</td>
<td align="center">8 / 23</td>
</tr>
<tr>
<td><a href="https://www.opensuse.org" target="_blank"><img src="./docs/assets/images/icon/opensuse.svg" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;openSUSE</td>
<td><a href="https://www.opensuse.org" target="_blank"><sub><img src="docs/assets/images/icon/opensuse.svg" width="16" height="16"></sub></a>&nbsp;openSUSE</td>
<td align="center">Leep 15 / Tumbleweed</td>
</tr>
<tr>
<td><a href="https://archlinux.org" target="_blank"><img src="./docs/assets/images/icon/arch-linux.ico" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Arch Linux</td>
<td><a href="https://archlinux.org" target="_blank"><sub><img src="docs/assets/images/icon/arch-linux.ico" width="16" height="16"></sub></a>&nbsp;Arch Linux</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://www.alpinelinux.org" target="_blank"><img src="./docs/assets/images/icon/alpine.png" width="16" height="16" style="vertical-align: -0.15em"/></a>&nbsp;Alpine Linux</td>
<td><a href="https://www.alpinelinux.org" target="_blank"><sub><img src="docs/assets/images/icon/alpine.png" width="16" height="16"></sub></a>&nbsp;Alpine Linux</td>
<td align="center">v3 / edge</td>
</tr>
<tr>
<td><a href="https://www.gentoo.org" target="_blank"><img src="./docs/assets/images/icon/gentoo.svg" width="16" height="16" style="vertical-align: -0.2em"/></a>&nbsp;Gentoo</td>
<td><a href="https://www.gentoo.org" target="_blank"><sub><img src="docs/assets/images/icon/gentoo.svg" width="16" height="16"></sub></a>&nbsp;Gentoo</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://nixos.org" target="_blank"><img src="./docs/assets/images/icon/nixos.svg" width="16" height="16" style="vertical-align: -0.15em"/></a>&nbsp;NixOS</td>
<td><a href="https://nixos.org" target="_blank"><sub><img src="docs/assets/images/icon/nixos.svg" width="16" height="16"></sub></a>&nbsp;NixOS</td>
<td align="center">19 ~ 24</td>
</tr>
</table>
@@ -120,12 +118,12 @@
***
这是一个完全开源的项目,旨在为从事计算机相关行业的朋友们提供便利,使换源更简单
### LICENSE
Copyright © 2025, [SuperManito](https://github.com/SuperManito). Released under the [MIT](https://github.com/SuperManito/LinuxMirrors/blob/main/LICENSE).
这是一个完全开源的项目,旨在为从事计算机相关行业的朋友们提供便利,使换源更简单
<a href="https://star-history.com/#SuperManito/LinuxMirrors&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=SuperManito/LinuxMirrors&type=Date&theme=dark" />

122
docs/assets/js/common.js Normal file
View File

@@ -0,0 +1,122 @@
// 防抖
function debounce(func, wait) {
let timeout
return function () {
const context = this
const args = arguments
clearTimeout(timeout)
timeout = setTimeout(() => func.apply(context, args), wait)
}
}
// 组件管理系统(每个组件都是一个 Vue 实例)
const ComponentSystem = {
// 组件状态数据
components: {},
// 注册组件
register: function (componentId, componentDef) {
// 为每个组件创建自己的状态
this.components[componentId] = {
id: componentId,
instance: null,
isInitializing: false,
lastInitTime: 0,
def: componentDef,
debouncedInit: null,
}
// 创建组件初始化函数
const initFunc = function () {
const component = ComponentSystem.components[componentId]
// 如果正在初始化或者距离上次初始化时间太短,则跳过
const now = Date.now()
if (component.isInitializing || now - component.lastInitTime < 1000) {
return
}
// 使用缓存,如果没有则查询
if (!component.instance) {
component.instance = document.getElementById(componentId)
}
// 如果找不到容器,不执行后续操作
if (!component.instance) {
return
}
// 如果组件已经初始化过且DOM没有变化则跳过
if (component.instance.hasAttribute('data-initialized')) {
return
}
// console.log(`找到组件 ${componentId} 容器,开始初始化`)
component.isInitializing = true
component.lastInitTime = now
try {
// 清空容器内容,防止重复初始化
while (component.instance.firstChild) {
component.instance.removeChild(component.instance.firstChild)
}
// 确保容器有适当的尺寸
if (!component.instance.style.width) {
component.instance.style.width = '100%'
}
// 确保 Vue 和 TDesign 已加载
if (typeof Vue !== 'undefined' && typeof TDesign !== 'undefined') {
// 创建 Vue 应用
const App = Vue.createApp(component.def)
// 注册 TDesign 组件
App.use(TDesign.default)
// 挂载应用
App.mount(component.instance)
// console.log(`组件 ${componentId} 初始化成功`)
// 标记组件已初始化
component.instance.setAttribute('data-initialized', 'true')
// 立即更新主题
updateTDesignGlobalTheme()
} else if (typeof Vue !== 'undefined') {
console.error('Vue 未找到')
const errorDiv = document.createElement('div')
errorDiv.innerHTML = `<div class="admonition failure"><p class="admonition-title">组件 ${componentId} 加载失败,请检查 Vue 是否存在!</p></div>`
component.instance.appendChild(errorDiv)
} else if (typeof TDesign !== 'undefined') {
console.error('TDesign UI 未找到')
const errorDiv = document.createElement('div')
errorDiv.innerHTML = `<div class="admonition failure"><p class="admonition-title">组件 ${componentId} 加载失败,请检查 TDesign UI 是否存在!</p></div>`
component.instance.appendChild(errorDiv)
}
} catch (error) {
console.error(`组件 ${componentId} 初始化时发生错误:${error}`)
} finally {
component.isInitializing = false
}
}
// 为每个组件创建防抖初始化函数
this.components[componentId].debouncedInit = debounce(initFunc, 300)
return this.components[componentId].debouncedInit
},
// 初始化所有组件
initAll: function () {
Object.values(this.components).forEach((component) => {
if (component.debouncedInit) {
component.debouncedInit()
}
})
},
// 重新初始化组件
reinitialize: function (componentId) {
const component = this.components[componentId]
if (component) {
component.instance = document.getElementById(componentId)
if (component.instance) {
component.instance.removeAttribute('data-initialized')
setTimeout(component.debouncedInit, 300)
}
}
},
// 重新初始化所有组件
reinitializeAll: function () {
Object.keys(this.components).forEach((id) => {
this.reinitialize(id)
})
},
}

View File

@@ -0,0 +1,15 @@
// 使用 mkdocs-material 与第三方 JavaScript 库集成的方法
document$.subscribe(function () {
// 重新初始化组件
ComponentSystem.reinitializeAll()
// 延迟初始化以确保DOM完全渲染
setTimeout(() => {
ComponentSystem.initAll()
}, 300)
})
// 首次加载事件
window.addEventListener('load', function () {
// 初始化所有组件
ComponentSystem.initAll()
})

View File

@@ -1,3 +1,4 @@
// 表格数据
const mirrorsTableData = [
{
name: '阿里云',
@@ -322,3 +323,26 @@ const mirrorsTableData = [
raspberry: true,
},
]
// 表格列配置
const mirrorsTableColumns = [
{ colKey: 'name', title: '镜像站', align: 'center', width: '160', fixed: 'left' },
{ colKey: 'ipv6', title: 'IPv6', align: 'center' },
{ colKey: 'epel', title: 'EPEL', align: 'center', tooltip: 'Extra Packages for Enterprise Linux (EPEL) 是由 Fedora 组织维护的一个附加软件包仓库,它主要适用于除 Fedora 操作系统以外的红帽系 Linux 发行版。' },
{ colKey: 'archlinux', title: 'Arch Linux', align: 'center' },
{ colKey: 'kalilinux', title: 'Kali Linux', align: 'center' },
{ colKey: 'armbian', title: 'Armbian', align: 'center' },
{ colKey: 'deepin', title: 'Deepin', align: 'center' },
{ colKey: 'raspberry', title: 'Raspberry Pi OS', align: 'center', width: '130' },
{ colKey: 'linuxmint', title: 'Linux Mint', align: 'center' },
{ colKey: 'proxmox', title: 'Proxmox VE', align: 'center' },
{ colKey: 'fedora', title: 'Fedora', align: 'center' },
{ colKey: 'rockylinux', title: 'Rocky Linux', align: 'center' },
{ colKey: 'almalinux', title: 'AlmaLinux', align: 'center' },
{ colKey: 'opencloudos', title: 'OpenCloudOS', align: 'center', width: '120' },
{ colKey: 'anolis', title: 'Anolis OS', align: 'center' },
{ colKey: 'openkylin', title: 'openKylin', align: 'center' },
{ colKey: 'alpinelinux', title: 'Alpine Linux', align: 'center' },
{ colKey: 'gentoo', title: 'Gentoo', align: 'center' },
{ colKey: 'nix', title: 'NixOS', align: 'center' },
]

View File

@@ -0,0 +1,51 @@
ComponentSystem.register('mirrors-table', {
template: `
<div>
<t-table
:columns="columns"
:data="data"
row-key="name"
size="small"
>
<template v-for="col in columns" :key="col.colKey" #[col.title]>
<div v-if="col.tooltip" class="t-table__th-cell-inner">
<t-space style="gap: 4px">
{{ col.title }}
<t-tooltip :content="col.tooltip" placement="bottom" :show-arrow="false">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"><path fill="currentColor" d="M11.95 18q.525 0 .888-.363t.362-.887t-.362-.888t-.888-.362t-.887.363t-.363.887t.363.888t.887.362m.05 4q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m.1-12.3q.625 0 1.088.4t.462 1q0 .55-.337.975t-.763.8q-.575.5-1.012 1.1t-.438 1.35q0 .35.263.588t.612.237q.375 0 .638-.25t.337-.625q.1-.525.45-.937t.75-.788q.575-.55.988-1.2t.412-1.45q0-1.275-1.037-2.087T12.1 6q-.95 0-1.812.4T8.975 7.625q-.175.3-.112.638t.337.512q.35.2.725.125t.625-.425q.275-.375.688-.575t.862-.2"/></svg>
</t-tooltip>
</t-space>
</div>
<div v-else class="t-table__th-cell-inner">{{ col.title }}</div>
</template>
<template v-for="col in columns" :key="col.colKey" #[col.colKey]="{ row }">
<template v-if="col.colKey === 'name'">
<t-popup placement="bottom" :show-arrow="false">
<template #content>
<a :href="row.url" target="_blank" style="color: var(--md-typeset-a-color)">{{ row.domain }}</a>
</template>
<a :href="row.url" target="_blank">{{ row.name }}</a>
</t-popup>
</template>
<template v-else>
<t-tag v-if="typeof row[col.colKey] === 'boolean'" :theme="row[col.colKey] ? 'success' : 'danger'" variant="light" size="small" style="background-color: transparent; height: 100%">
<template #icon>
<svg v-if="row[col.colKey]" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59L21 7Z" /></svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" style="vertical-align: -0.2em"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z"/></svg>
</template>
</t-tag>
<t-tag v-else theme="warning" variant="light" size="small" style="background-color: transparent">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" style="vertical-align: -0.3em"><path fill="#F6B604" d="M22.11 21.46L2.39 1.73L1.11 3l2.95 2.95A9.95 9.95 0 0 0 2 12c0 5.5 4.5 10 10 10c2.28 0 4.37-.77 6.05-2.06l2.79 2.79l1.27-1.27M12 20c-4.42 0-8-3.58-8-8c0-1.73.56-3.32 1.5-4.62L16.62 18.5A7.78 7.78 0 0 1 12 20M8.17 4.97L6.72 3.5C8.25 2.56 10.06 2 12 2c5.5 0 10 4.5 10 10c0 1.94-.56 3.75-1.5 5.28l-1.47-1.45c.62-1.14.97-2.44.97-3.83c0-4.42-3.58-8-8-8c-1.39 0-2.69.35-3.83.97Z"/></svg>
</t-tag>
</template>
</template>
</t-table>
</div>
`,
data() {
return {
columns: mirrorsTableColumns,
data: mirrorsTableData,
}
},
})

View File

@@ -1,248 +0,0 @@
const appId = 'mirrors-table' // 表格容器ID
let appInstance = null // 缓存表格容器引用
let vueApp = null // Vue 应用实例
let isInitializing = false // 是否正在初始化
let lastInitTime = 0 // 上次初始化时间
const INIT_COOLDOWN = 1000 // 初始化冷却时间(毫秒)
// 更新表格主题
function updateTableTheme() {
const scheme = document.querySelector('[data-md-color-scheme]')?.getAttribute('data-md-color-scheme')
const isDarkMode = scheme === 'slate' || scheme === 'dark'
// 设置 TDesign 的主题模式
if (isDarkMode) {
document.documentElement.setAttribute('theme-mode', 'dark')
} else {
document.documentElement.removeAttribute('theme-mode')
}
}
// 初始化表格的函数
function initTables() {
// 如果正在初始化或者距离上次初始化时间太短,则跳过
const now = Date.now()
if (isInitializing || now - lastInitTime < INIT_COOLDOWN) {
return
}
// 使用缓存的引用,如果没有则查询
if (!appInstance) {
appInstance = document.getElementById(appId)
}
// 如果找不到容器,不执行后续操作
if (!appInstance) {
return
}
// 如果表格已经初始化过且DOM没有变化则跳过
if (appInstance.hasAttribute('data-initialized')) {
return
}
// console.log('找到表格容器,初始化表格')
isInitializing = true
lastInitTime = now
try {
// 清空容器内容,防止重复初始化
while (appInstance.firstChild) {
appInstance.removeChild(appInstance.firstChild)
}
// 确保容器有适当的尺寸
if (!appInstance.style.width) {
appInstance.style.width = '100%'
}
// 确保 Vue 和 TDesign 已加载
if (typeof Vue !== 'undefined' && typeof TDesign !== 'undefined') {
// 创建 Vue 应用
const App = Vue.createApp(app)
// 注册 TDesign 组件
App.use(TDesign.default)
// 挂载应用
vueApp = App.mount(appInstance)
// console.log('表格初始化成功')
// 标记表格已初始化
appInstance.setAttribute('data-initialized', 'true')
// 立即更新主题
updateTableTheme()
} else {
console.error('Vue 或 TDesign 未加载')
// 显示错误消息
const errorDiv = document.createElement('div')
errorDiv.style.padding = '20px'
errorDiv.style.color = 'red'
errorDiv.textContent = 'Vue 或 TDesign 未加载,请在 mkdocs.yml 中添加相应 CDN 链接'
appInstance.appendChild(errorDiv)
}
} catch (error) {
console.error('初始化表格时发生错误:', error)
} finally {
isInitializing = false
}
}
// 初始化
function reinitializeTable() {
appInstance = document.getElementById(appId)
if (appInstance) {
appInstance.removeAttribute('data-initialized')
setTimeout(debouncedInit, 300) // 使用更短的延迟
}
}
// 设置主题监听器
function setupThemeObserver() {
// 监听主题变化
const observer = new MutationObserver(() => {
updateTableTheme()
})
const element = document.querySelector('[data-md-color-scheme]')
if (element) {
observer.observe(element, {
attributes: true,
attributeFilter: ['data-md-color-scheme'],
})
} else {
// 如果元素不存在,等待页面加载完成后重试
setTimeout(setupThemeObserver, 1000)
}
}
// 使用防抖函数包装初始化逻辑
function debounce(func, wait) {
let timeout
return function () {
const context = this
const args = arguments
clearTimeout(timeout)
timeout = setTimeout(() => func.apply(context, args), wait)
}
}
// 列定义
const columns = [
{ colKey: 'name', title: '镜像站', align: 'center', width: '160', fixed: 'left' },
{ colKey: 'ipv6', title: 'IPv6', align: 'center' },
{ colKey: 'epel', title: 'EPEL', align: 'center', tooltip: 'Extra Packages for Enterprise Linux (EPEL) 是由 Fedora 组织维护的一个附加软件包仓库,它主要适用于除 Fedora 操作系统以外的红帽系 Linux 发行版。' },
{ colKey: 'archlinux', title: 'Arch Linux', align: 'center' },
{ colKey: 'kalilinux', title: 'Kali Linux', align: 'center' },
{ colKey: 'armbian', title: 'Armbian', align: 'center' },
{ colKey: 'deepin', title: 'Deepin', align: 'center' },
{ colKey: 'raspberry', title: 'Raspberry Pi OS', align: 'center', width: '130' },
{ colKey: 'linuxmint', title: 'Linux Mint', align: 'center' },
{ colKey: 'proxmox', title: 'Proxmox VE', align: 'center' },
{ colKey: 'fedora', title: 'Fedora', align: 'center' },
{ colKey: 'rockylinux', title: 'Rocky Linux', align: 'center' },
{ colKey: 'almalinux', title: 'AlmaLinux', align: 'center' },
{ colKey: 'opencloudos', title: 'OpenCloudOS', align: 'center', width: '120' },
{ colKey: 'anolis', title: 'Anolis OS', align: 'center' },
{ colKey: 'openkylin', title: 'openKylin', align: 'center' },
{ colKey: 'alpinelinux', title: 'Alpine Linux', align: 'center' },
{ colKey: 'gentoo', title: 'Gentoo', align: 'center' },
{ colKey: 'nix', title: 'NixOS', align: 'center' },
]
// 修改 app 对象的模板部分,添加自定义表头渲染
const app = {
template: `
<div>
<t-table
:columns="columns"
:data="data"
row-key="name"
size="small"
>
<template v-for="col in columns" :key="col.colKey" #[col.title]>
<div v-if="col.tooltip" class="t-table__th-cell-inner">
<t-space style="gap: 4px">
{{ col.title }}
<t-tooltip :content="col.tooltip" placement="bottom" :show-arrow="false">
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"><path fill="currentColor" d="M11.95 18q.525 0 .888-.363t.362-.887t-.362-.888t-.888-.362t-.887.363t-.363.887t.363.888t.887.362m.05 4q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m.1-12.3q.625 0 1.088.4t.462 1q0 .55-.337.975t-.763.8q-.575.5-1.012 1.1t-.438 1.35q0 .35.263.588t.612.237q.375 0 .638-.25t.337-.625q.1-.525.45-.937t.75-.788q.575-.55.988-1.2t.412-1.45q0-1.275-1.037-2.087T12.1 6q-.95 0-1.812.4T8.975 7.625q-.175.3-.112.638t.337.512q.35.2.725.125t.625-.425q.275-.375.688-.575t.862-.2"/></svg>
</t-tooltip>
</t-space>
</div>
<div v-else class="t-table__th-cell-inner">{{ col.title }}</div>
</template>
<template v-for="col in columns" :key="col.colKey" #[col.colKey]="{ row }">
<template v-if="col.colKey === 'name'">
<t-popup placement="bottom" :show-arrow="false">
<template #content>
<a :href="row.url" target="_blank" style="color: var(--md-typeset-a-color)">{{ row.domain }}</a>
</template>
<a :href="row.url" target="_blank">{{ row.name }}</a>
</t-popup>
</template>
<template v-else>
<t-tag v-if="typeof row[col.colKey] === 'boolean'" :theme="row[col.colKey] ? 'success' : 'danger'" variant="light" size="small" style="background-color: transparent; height: 100%">
<template #icon>
<svg v-if="row[col.colKey]" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59L21 7Z" /></svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" style="vertical-align: -0.2em"><path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z"/></svg>
</template>
</t-tag>
<t-tag v-else theme="warning" variant="light" size="small" style="background-color: transparent">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" style="vertical-align: -0.3em"><path fill="#F6B604" d="M22.11 21.46L2.39 1.73L1.11 3l2.95 2.95A9.95 9.95 0 0 0 2 12c0 5.5 4.5 10 10 10c2.28 0 4.37-.77 6.05-2.06l2.79 2.79l1.27-1.27M12 20c-4.42 0-8-3.58-8-8c0-1.73.56-3.32 1.5-4.62L16.62 18.5A7.78 7.78 0 0 1 12 20M8.17 4.97L6.72 3.5C8.25 2.56 10.06 2 12 2c5.5 0 10 4.5 10 10c0 1.94-.56 3.75-1.5 5.28l-1.47-1.45c.62-1.14.97-2.44.97-3.83c0-4.42-3.58-8-8-8c-1.39 0-2.69.35-3.83.97Z"/></svg>
</t-tag>
</template>
</template>
</t-table>
</div>
`,
data() {
return {
columns,
data: mirrorsTableData,
}
},
}
// 防抖处理的初始化函数
const debouncedInit = debounce(initTables, 300)
// 仅在导航完成后监听URL变化
let lastUrl = location.href
const urlObserver = new MutationObserver(() => {
const url = location.href
if (url !== lastUrl) {
lastUrl = url
// 重置初始化状态
appInstance = document.getElementById(appId)
if (appInstance) {
appInstance.removeAttribute('data-initialized')
}
// 延迟初始化
setTimeout(debouncedInit, 400)
}
})
urlObserver.observe(document, { subtree: true, childList: true })
// 页面加载事件
window.addEventListener('load', function () {
debouncedInit()
// 尝试找到 MkDocs 内容容器来精确监听
const contentContainer = document.querySelector('.md-content') || document.querySelector('.md-main__inner') || document.querySelector('article') || document.body
// 只监听这个元素的子元素变化
urlObserver.observe(contentContainer, {
childList: true, // 监听子节点添加或删除
subtree: false, // 不监听所有后代变化,降低开销
attributes: false, // 不监听属性变化
})
// 监听 iframe 情况下的 hashchange 和 popstate 事件
window.addEventListener('hashchange', function () {
if (location.href !== lastUrl) {
lastUrl = location.href
appInstance = null
reinitializeTable()
}
})
window.addEventListener('popstate', function () {
if (location.href !== lastUrl) {
lastUrl = location.href
appInstance = null
reinitializeTable()
}
})
})
document.addEventListener('DOMContentLoaded', function () {
// 设置主题观察器
setupThemeObserver()
})
// MkDocs 页面切换事件
document.addEventListener('DOMContentSwitch', function () {
reinitializeTable()
})

View File

@@ -0,0 +1,32 @@
// 更新 TDesign 主题
function updateTDesignGlobalTheme() {
const scheme = document.querySelector('[data-md-color-scheme]')?.getAttribute('data-md-color-scheme')
const isDarkMode = scheme === 'slate' || scheme === 'dark'
if (isDarkMode) {
document.documentElement.setAttribute('theme-mode', 'dark')
} else {
document.documentElement.removeAttribute('theme-mode')
}
}
// 主题监听器
function setupThemeObserver() {
// 监听主题变化
const observer = new MutationObserver(() => {
updateTDesignGlobalTheme()
})
const element = document.querySelector('[data-md-color-scheme]')
if (element) {
observer.observe(element, {
attributes: true,
attributeFilter: ['data-md-color-scheme'],
})
} else {
// 如果元素不存在,等待页面加载完成后重试
setTimeout(setupThemeObserver, 1000)
}
}
document.addEventListener('DOMContentLoaded', function () {
setupThemeObserver()
})

View File

@@ -131,15 +131,15 @@ hide:
</div>
<div class="sponsor-wrapper sponsor-flex-wrapper">
<a class="sponsor-item sponsor-flex-item" target="_blank" href="https://1panel.cn" title="1Panel · 新一代的 Linux 服务器运维管理面板">
<img src="/assets/images/sponsor/1panel.png" alt="1Panel · 新一代的 Linux 服务器运维管理面板" style="width: 60%" />
<img src="/assets/images/sponsor/1panel.png" alt="1Panel" style="width: 60%" />
</a>
<a class="sponsor-item sponsor-flex-item" target="_blank" href="https://www.dkdun.cn/aff/VAWGETUL" title="林枫云">
<a class="sponsor-item sponsor-flex-item" target="_blank" href="https://www.dkdun.cn/aff/VAWGETUL" title="林枫云 · 专注独立IP高频VPSR9/i9系列定制">
<img src="/assets/images/sponsor/linfengyun-light.png#only-light" alt="林枫云" style="width: 60%" />
<img src="/assets/images/sponsor/linfengyun-dark.png#only-dark" alt="林枫云" style="width: 60%" />
</a>
<a class="sponsor-item sponsor-flex-item" target="_blank" href="https://arcadia.cool" title="Arcadia 一站式代码运维平台">
<img src="/assets/images/sponsor/arcadia-light.png#only-light" alt="Arcadia 一站式代码运维平台" style="width: 60%" />
<img src="/assets/images/sponsor/arcadia-dark.png#only-dark" alt="Arcadia 一站式代码运维平台" style="width: 60%" />
<img src="/assets/images/sponsor/arcadia-light.png#only-light" alt="Arcadia" style="width: 60%" />
<img src="/assets/images/sponsor/arcadia-dark.png#only-dark" alt="Arcadia" style="width: 60%" />
</a>
</div>
</div>

View File

@@ -10,7 +10,7 @@ hide:
> 下方列表中的镜像站均支持 `Debian` `Ubuntu` `CentOS` `openSUSE` `openEuler` 软件源,列表根据单位性质、地理位置、名称长度进行排序,与实际速度无关
<div id="mirrors-table"><p>正在加载表格 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" style="vertical-align: -0.1rem"><g stroke="currentColor"><circle cx="12" cy="12" r="9.5" fill="none" stroke-linecap="round" stroke-width="3"><animate attributeName="stroke-dasharray" calcMode="spline" dur="1.5s" keySplines="0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1" keyTimes="0;0.475;0.95;1" repeatCount="indefinite" values="0 150;42 150;42 150;42 150"/><animate attributeName="stroke-dashoffset" calcMode="spline" dur="1.5s" keySplines="0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1" keyTimes="0;0.475;0.95;1" repeatCount="indefinite" values="0;-16;-59;-59"/></circle><animateTransform attributeName="transform" dur="2s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></g></svg></p></div>
<div id="mirrors-table"><p>正在加载表格 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" style="vertical-align: -0.15rem"><g stroke="currentColor"><circle cx="12" cy="12" r="9.5" fill="none" stroke-linecap="round" stroke-width="3"><animate attributeName="stroke-dasharray" calcMode="spline" dur="1.5s" keySplines="0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1" keyTimes="0;0.475;0.95;1" repeatCount="indefinite" values="0 150;42 150;42 150;42 150"/><animate attributeName="stroke-dashoffset" calcMode="spline" dur="1.5s" keySplines="0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1" keyTimes="0;0.475;0.95;1" repeatCount="indefinite" values="0;-16;-59;-59"/></circle><animateTransform attributeName="transform" dur="2s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></g></svg></p></div>
<!-- | 镜像站 | IPv6 | Arch Linux | Kali Linux | Deepin | Rocky Linux | AlmaLinux | EPEL :material-information-outline:{ title="Extra Packages for Enterprise Linux (EPEL) 是由 Fedora 组织维护的一个附加软件包仓库,它主要适用于除 Fedora 操作系统以外的红帽系 Linux 发行版。" } | Fedora | OpenCloudOS | Alpine Linux | Armbian | Proxmox VE | Linux Mint | Gentoo | Anolis OS | openKylin | NixOS | Raspberry Pi OS |
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
@@ -35,7 +35,7 @@ hide:
如果这里没有想使用的镜像站那可以看看其它运行模式和命令选项。软件源的速度区分刷新速度和下行速率,后者才是关键,具体请结合实际地理位置选择尝试,还可以通过[辅助工具网站](#工具网站)进行一些测试
:material-thumb-up-outline: 使用建议:速度上推荐 `中科大``字节跳动(火山引擎)`,地域兼容性上推荐 `阿里云``腾讯云`,软件源种类上推荐 `南京大学`,境外、海外或复杂网络环境下不建议使用 `清华(TUNA)` 等容易阻断的镜像站
:material-thumb-up-outline: 使用建议:速度上推荐 `中科大``字节(火山引擎)`,地域兼容性上推荐 `阿里云``腾讯云`,软件源种类上推荐 `南京大学``中科院`,境外、海外或复杂网络环境下不建议使用 `清华(TUNA)` 等容易阻断的镜像站
??? note "中国大陆教育网(点击展开查看)"
@@ -270,4 +270,6 @@ hide:
<button class="md-button" title="https://tools.ipip.net/traceroute.php" onclick="window.open('https://tools.ipip.net/traceroute.php')">Tracert 路由追踪测试</button>
<button class="md-button" title="https://ipw.cn/ipv6webcheck" onclick="window.open('https://ipw.cn/ipv6webcheck')">IPv6 接入测试</button>
!!! tip "该页面展示的均为脚本默认提供可供选择的软件源地址,如果没有找到你想使用的也没有关系,脚本支持命令选项可自定义使用,详见[高级用法](../use/index.md#命令选项高级用法)</br>特此声明:本页面涉及的旗帜图标仅用于快速区分地理位置不代表作者的任何政治立场,请不要过度解读!"
!!! tip "该页面展示的均为脚本默认提供可供选择的软件源地址,如果没有找到你想使用的也没有关系,脚本支持命令选项可自定义使用,详见[高级用法](../use/index.md#命令选项高级用法)"
> 特此声明:本页面涉及的旗帜图标仅用于快速区分地理位置不代表作者的任何政治立场,请不要过度解读。

View File

@@ -7,7 +7,7 @@ hide:
> 如果觉得这个项目不错对您有所帮助的话,请点击仓库右上角的 Star 并分享给更多的朋友 :octicons-heart-fill-24:{ .heart style="color: red" }
## :fontawesome-brands-docker:{style="color: #086dd7"} Docker 安装脚本
## :simple-docker:{style="color: #1d63ed"} Docker 安装脚本
<table>
<tr>
@@ -48,29 +48,31 @@ hide:
</tr>
</table>
=== ":linuxmirrors: 官网(推荐)"
!!! quote ""
``` bash
bash <(curl -sSL https://linuxmirrors.cn/docker.sh)
```
=== ":linuxmirrors: 官网(推荐)"
=== ":simple-github: GitHub"
``` bash
bash <(curl -sSL https://linuxmirrors.cn/docker.sh)
```
``` bash
bash <(curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/DockerInstallation.sh)
```
=== ":simple-github: GitHub"
=== ":simple-gitee: Gitee 码云"
``` bash
bash <(curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/DockerInstallation.sh)
```
``` bash
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh)
```
=== ":simple-gitee: Gitee 码云"
=== ":simple-jsdelivr: jsDelivrCDN"
``` bash
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh)
```
``` bash
bash <(curl -sSL https://cdn.jsdelivr.net/gh/SuperManito/LinuxMirrors@main/DockerInstallation.sh)
```
=== ":simple-jsdelivr: jsDelivrCDN"
``` bash
bash <(curl -sSL https://cdn.jsdelivr.net/gh/SuperManito/LinuxMirrors@main/DockerInstallation.sh)
```
集成安装 [`Docker Engine`](https://docs.docker.com/engine) 和 [`Docker Compose (插件)`](https://docs.docker.com/compose/install/linux),支持选择或更换软件源以及镜像仓库、安装指定版本、重装等功能,支持 ARM 架构处理器
@@ -137,7 +139,7 @@ hide:
- #### 指定 Docker CE 软件源仓库
一般无需指定,脚本默认会自动判断
脚本默认会自动判断一般无需指定,除非你有特殊需求
``` { .bash .no-copy }
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --branch centos

View File

@@ -12,15 +12,15 @@ hide:
</div>
<div class="sponsor-wrapper sponsor-flex-wrapper">
<a class="sponsor-item sponsor-flex-item" target="_blank" href="https://1panel.cn" title="1Panel · 新一代的 Linux 服务器运维管理面板">
<img src="/assets/images/sponsor/1panel.png" alt="1Panel · 新一代的 Linux 服务器运维管理面板" style="width: 60%" />
<img src="/assets/images/sponsor/1panel.png" alt="1Panel" style="width: 60%" />
</a>
<a class="sponsor-item sponsor-flex-item" target="_blank" href="https://www.dkdun.cn/aff/VAWGETUL" title="林枫云">
<a class="sponsor-item sponsor-flex-item" target="_blank" href="https://www.dkdun.cn/aff/VAWGETUL" title="林枫云 · 专注独立IP高频VPSR9/i9系列定制">
<img src="/assets/images/sponsor/linfengyun-light.png#only-light" alt="林枫云" style="width: 60%" />
<img src="/assets/images/sponsor/linfengyun-dark.png#only-dark" alt="林枫云" style="width: 60%" />
</a>
<a class="sponsor-item sponsor-flex-item" target="_blank" href="https://arcadia.cool" title="Arcadia 一站式代码运维平台">
<img src="/assets/images/sponsor/arcadia-light.png#only-light" alt="Arcadia 一站式代码运维平台" style="width: 60%" />
<img src="/assets/images/sponsor/arcadia-dark.png#only-dark" alt="Arcadia 一站式代码运维平台" style="width: 60%" />
<img src="/assets/images/sponsor/arcadia-light.png#only-light" alt="Arcadia" style="width: 60%" />
<img src="/assets/images/sponsor/arcadia-dark.png#only-dark" alt="Arcadia" style="width: 60%" />
</a>
</div>
</div>

View File

@@ -8,6 +8,7 @@
.md-header {
background-color: hsla(240, 9%, 75%, 0.33);
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
z-index: 999 !important;
}
@@ -27,7 +28,7 @@
[data-md-color-scheme="default"] .md-logo img {
content: url(/assets/images/brand/svg/logo-light.svg);
}
[data-md-color-scheme="slate"] .md-logo img {
content: url(/assets/images/brand/svg/logo-dark.svg);
}
@@ -146,6 +147,7 @@
}
}
/* TDesign 组件相关 */
.t-tag .t-icon {
margin-right: 0 !important;
}
@@ -166,3 +168,32 @@
[theme-mode="dark"] .t-table--hoverable tbody tr:hover {
background-color: rgba(240, 241, 244, 0.016) !important;
}
/* termynal 插件 */
.termy {
padding: 65px 25px 35px !important;
}
/* 切换主题动画 */
::view-transition-old(root),
::view-transition-new(root) {
animation: none;
mix-blend-mode: normal;
}
.dark::view-transition-old(root) {
z-index: 999;
}
.dark::view-transition-new(root) {
z-index: 1;
}
/* 浅色主题下的设置 */
::view-transition-old(root) {
z-index: 1;
}
::view-transition-new(root) {
z-index: 999;
}

1
docs/theme/netlify.svg vendored Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="#014847" d="M29.39 13.98L18.02 2.61l-.42-.42l-.47-.19h-2.26l-.47.2l-.42.41L2.61 13.98l-.42.42l-.19.47v2.26l.2.47l.41.42l11.37 11.37l.42.42l.47.19h2.26l.47-.2l.42-.41l11.37-11.37l.42-.42l.19-.47v-2.26l-.2-.47z"/><path fill="#32E6E2" d="M14.99 27.38v-5.46l.14-.15h1.74l.14.15v5.46l-.14.14h-1.74zm0-17.3V4.62l.14-.14h1.74l.14.14v5.46l-.14.15h-1.74zM10.4 23.33h-.24l-1.2-1.2v-.23l1.6-1.6h1.26l.17.18v1.26l-1.6 1.6ZM8.96 10.16v-.24l1.2-1.2h.24l1.59 1.6v1.26l-.17.17h-1.26zm-4.8 4.82h6.14l.14.15v1.74l-.14.14H4.16L4 16.87v-1.74l.15-.15Z"/><path fill="#fff" d="M19.26 19.62h-1.74l-.15-.15v-4.06c0-.73-.28-1.29-1.15-1.3c-.45-.02-.97 0-1.51.02l-.09.08v5.26l-.14.15h-1.74l-.14-.15v-6.94l.14-.15h3.9a2.75 2.75 0 0 1 2.76 2.75v4.34l-.15.15Z"/><path fill="#32E6E2" d="M27.84 17.02H21.7l-.14-.15v-1.74l.14-.14h6.14l.15.14v1.74z"/></svg>

After

Width:  |  Height:  |  Size: 917 B

View File

@@ -25,22 +25,28 @@
<script>
var giscus = document.querySelector("script[src*=giscus]")
/* Set palette on initial load */
// Set palette on initial load
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate" ? "dark" : "light"
var theme = palette.color.scheme === "slate"
? "transparent_dark"
: "light"
// Instruct Giscus to set theme
giscus.setAttribute("data-theme", theme)
}
/* Register event handlers after documented loaded */
// Register event handlers after documented loaded
document.addEventListener("DOMContentLoaded", function() {
var ref = document.querySelector("[data-md-component=palette]")
ref.addEventListener("change", function() {
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate" ? "dark" : "light"
var theme = palette.color.scheme === "slate"
? "transparent_dark"
: "light"
/* Instruct Giscus to change theme */
// Instruct Giscus to change theme
var frame = document.querySelector(".giscus-frame")
frame.contentWindow.postMessage(
{ giscus: { setConfig: { theme } } },

105
docs/theme/partials/palette.html vendored Normal file
View File

@@ -0,0 +1,105 @@
<form class="md-header__option" data-md-component="palette">
{% for option in config.theme.palette %} {% set scheme = option.scheme | d("default", true) %} {% set primary = option.primary | d("indigo", true) %} {% set accent = option.accent | d("indigo", true) %}
<input class="md-option" data-md-color-media="{{ option.media }}" data-md-color-scheme="{{ scheme | replace(' ', '-') }}" data-md-color-primary="{{ primary | replace(' ', '-') }}" data-md-color-accent="{{ accent | replace(' ', '-') }}" {% if option.toggle %} aria-label="{{ option.toggle.name }}" {% else %} aria-hidden="true" {% endif %} type="radio" name="__palette" id="__palette_{{ loop.index0 }}" />
{% if option.toggle %}
<label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index % loop.length }}" hidden> {% include ".icons/" ~ option.toggle.icon ~ ".svg" %} </label>
{% endif %} {% endfor %}
</form>
<script>
var palette = __md_get('__palette')
if (palette && palette.color) {
/* Retrieve color palette for system preference */
if (palette.color.media === '(prefers-color-scheme)') {
var media = matchMedia('(prefers-color-scheme: light)')
var input = document.querySelector(media.matches ? "[data-md-color-media='(prefers-color-scheme: light)']" : "[data-md-color-media='(prefers-color-scheme: dark)']")
/* Retrieve colors for system preference */
;(palette.color.media = input.getAttribute('data-md-color-media')), (palette.color.scheme = input.getAttribute('data-md-color-scheme')), (palette.color.primary = input.getAttribute('data-md-color-primary')), (palette.color.accent = input.getAttribute('data-md-color-accent'))
}
/* Set color palette */
for (var [key, value] of Object.entries(palette.color)) document.body.setAttribute('data-md-color-' + key, value)
}
document.addEventListener('DOMContentLoaded', function () {
if (typeof document.startViewTransition !== 'function') {
return // 不支持 View Transitions API 的浏览器直接返回
}
// 获取所有主题切换按钮
const themeToggles = document.querySelectorAll('.md-header__button.md-icon')
themeToggles.forEach((toggle) => {
toggle.addEventListener(
'click',
function (e) {
// 阻止默认点击事件
e.preventDefault()
e.stopPropagation()
// 获取目标输入元素
const targetId = this.getAttribute('for')
const targetInput = document.getElementById(targetId)
if (!targetInput) return
// 获取当前存储的主题信息和即将切换到的主题信息
const currentPalette = __md_get('__palette')
const currentScheme = currentPalette?.color?.scheme || ''
const currentMedia = currentPalette?.color?.media || ''
// 获取新主题信息
const newScheme = targetInput.getAttribute('data-md-color-scheme')
const newMedia = targetInput.getAttribute('data-md-color-media')
// 判断当前浏览器/系统主题
const isSystemDark = window.matchMedia('(prefers-color-scheme: dark)').matches
// 判断是否切换到暗色主题
const isDark = newScheme != 'default'
// 确定当前主题的实际暗色状态
let isCurrentDark = currentScheme.includes('slate')
if (currentMedia === '(prefers-color-scheme)') {
isCurrentDark = isSystemDark
}
// 确定新主题的实际暗色状态
let isNewDark = newScheme.includes('slate')
if (newMedia === '(prefers-color-scheme)') {
isNewDark = isSystemDark
}
// 如果当前主题和目标主题相同,则不需要动画
if (isCurrentDark === isNewDark) {
targetInput.click()
return
}
// 动画参数
const x = e.clientX
const y = e.clientY
const endRadius = Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y))
// 设置动画路径
const clipPath = [`circle(0px at ${x}px ${y}px)`, `circle(${endRadius}px at ${x}px ${y}px)`]
// 启动视图过渡
document
.startViewTransition(async () => {
// 切换主题
targetInput.click()
// 添加暗/亮模式类,用于动画控制
document.documentElement.classList.remove(isDark ? 'light' : 'dark')
document.documentElement.classList.add(isDark ? 'dark' : 'light')
// 等待主题变化完成
await new Promise((resolve) => setTimeout(resolve, 100))
})
.ready.then(() => {
// 视图过渡准备就绪,开始动画
document.documentElement.animate(
{
clipPath: isDark ? [...clipPath].reverse() : clipPath,
},
{
duration: 500,
easing: 'ease-in',
pseudoElement: isDark ? '::view-transition-old(root)' : '::view-transition-new(root)',
}
)
})
},
{ capture: true }
)
})
// 初始化主题状态类
const currentPalette = __md_get('__palette')
const currentScheme = currentPalette?.color?.scheme || ''
const isDark = currentScheme.includes('slate')
document.documentElement.classList.add(isDark ? 'dark' : 'light')
})
</script>

View File

@@ -8,27 +8,29 @@
{% for toc_item in toc %} {% include "partials/toc-item.html" %} {% endfor %}
</ul>
<div class="md-nav__sponsor-bottom">
<div class="sponsor-label">
<strong>赞助商</strong>
</div>
<div class="sponsor-wrapper">
<a class="sponsor-item" target="_blank" href="https://1panel.cn" title="1Panel · 新一代的 Linux 服务器运维管理面板">
<img src="/assets/images/sponsor/1panel.png" alt="1Panel · 新一代的 Linux 服务器运维管理面板" style="width: 60%" />
</a>
<a class="sponsor-item" target="_blank" href="https://www.dkdun.cn/aff/VAWGETUL" title="林枫云">
<img src="/assets/images/sponsor/linfengyun-light.png#only-light" alt="林枫云" style="width: 60%" />
<img src="/assets/images/sponsor/linfengyun-dark.png#only-dark" alt="林枫云" style="width: 60%" />
</a>
<a class="sponsor-item" target="_blank" href="https://arcadia.cool" title="Arcadia 一站式代码运维平台">
<img src="/assets/images/sponsor/arcadia-light.png#only-light" alt="Arcadia 一站式代码运维平台" style="width: 60%" />
<img src="/assets/images/sponsor/arcadia-dark.png#only-dark" alt="Arcadia 一站式代码运维平台" style="width: 60%" />
</a>
<a class="sponsor-item" target="_blank" href="/sponsor/">
<span style="font-size: 0.6rem">
<strong>成为赞助商</strong>
</span>
</a>
<div class="md-content" data-md-component="content">
<div class="md-nav__sponsor-bottom">
<div class="sponsor-label">
<strong>赞助商</strong>
</div>
<div class="sponsor-wrapper">
<a class="sponsor-item" target="_blank" href="https://1panel.cn" title="1Panel · 新一代的 Linux 服务器运维管理面板">
<img src="/assets/images/sponsor/1panel.png" alt="1Panel" style="width: 60%" />
</a>
<a class="sponsor-item" target="_blank" href="https://www.dkdun.cn/aff/VAWGETUL" title="林枫云 · 专注独立IP高频VPSR9/i9系列定制">
<img src="/assets/images/sponsor/linfengyun-light.png#only-light" alt="林枫云" style="width: 60%" />
<img src="/assets/images/sponsor/linfengyun-dark.png#only-dark" alt="林枫云" style="width: 60%" />
</a>
<a class="sponsor-item" target="_blank" href="https://arcadia.cool" title="Arcadia 一站式代码运维平台">
<img src="/assets/images/sponsor/arcadia-light.png#only-light" alt="Arcadia" style="width: 60%" />
<img src="/assets/images/sponsor/arcadia-dark.png#only-dark" alt="Arcadia" style="width: 60%" />
</a>
<!-- <a class="sponsor-item" target="_blank" href="/sponsor/">
<span style="font-size: 0.6rem">
<strong>成为赞助商</strong>
</span>
</a> -->
</div>
</div>
</div>
{% endif %}

View File

@@ -341,7 +341,7 @@ hide:
- ### 关于调用脚本的互联网位置
项目利用 [GitHub Action](https://github.com/SuperManito/LinuxMirrors/blob/main/.github/workflows/build-docs.yml#L29) 在每次提交后自动拷贝源码到文档目录作为网站资源发布,网站托管于知名 CDN 云服务商几乎没有被劫持的风险请放心使用。
项目利用 [GitHub Action](https://github.com/SuperManito/LinuxMirrors/blob/main/.github/workflows/build-docs.yml#L29) 在每次提交后自动拷贝源码到文档目录作为网站资源发布,网站托管于 :netlify: Netlify几乎没有被劫持的风险请放心使用。
当然你也可以使用代码托管仓库的原始地址来调用,这里只是想告诉你为什么会有几个不同的地址,默认的官网地址更易于记忆和访问。

View File

@@ -2,13 +2,16 @@ site_name: LinuxMirrors
repo_name: LinuxMirrors
repo_url: https://github.com/SuperManito/LinuxMirrors
edit_uri: edit/main/docs/
copyright: 'Copyright &copy; 2025 <a href="https://github.com/SuperManito" target="_blank"> SuperManito</a> <a href="https://www.netlify.com" target="_blank"><img height="64" width="64" src="/assets/images/icon/netlify.svg" style="vertical-align: -0.6em"></a>'
copyright: 'Copyright &copy; 2025 <a href="https://github.com/SuperManito" target="_blank">SuperManito</a></br>本网站由 <a href="https://www.netlify.com" target="_blank">Netlify</a> 部署并提供全球 CDN 边缘加速服务 <a href="https://www.netlify.com" target="_blank"><img height="64" width="64" src="/assets/images/icon/netlify.svg" style="vertical-align: -0.6em"></a>'
extra_javascript:
- assets/js/vue.global.prod.js
- assets/js/tdesign.min.js
- assets/js/mirrors-table-data.js
- assets/js/mirrors-table.js
- assets/js/modules/vue.global.prod.js
- assets/js/modules/tdesign.min.js
- assets/js/modules/tdesign-theme.js
- assets/js/common.js
- assets/js/component.js
- assets/js/components/mirrors-table/data.js
- assets/js/components/mirrors-table/index.js
extra_css:
- assets/css/tdesign.min.css
- stylesheets/extra.css
@@ -32,13 +35,13 @@ theme:
success: octicons/check-16
question: octicons/question-16
warning: octicons/alert-16
failure: octicons/x-circle-16
danger: octicons/zap-16
bug: octicons/bug-16
example: octicons/beaker-16
quote: octicons/quote-16
palette:
- media: "(prefers-color-scheme)"
scheme: system
toggle:
icon: material/brightness-auto
name: 跟随系统
@@ -60,6 +63,7 @@ theme:
- navigation.tabs
- navigation.path
- navigation.instant
- navigation.instant.progress
- navigation.indexes
- navigation.footer
- navigation.tracking