├── index.md ├── .gitignore ├── public └── res │ ├── icon.png │ ├── avatar.png │ ├── favicon.png │ ├── posts │ └── helloworld.jpg │ └── iro │ └── sakura_icon.svg ├── .vitepress ├── theme │ ├── env.d.ts │ ├── iro.data.ts │ ├── template.vue │ ├── components │ │ ├── Home │ │ │ ├── Home.vue │ │ │ ├── CoverSocialButton.vue │ │ │ ├── PostList.vue │ │ │ ├── Cover.vue │ │ │ └── PostListItem.vue │ │ ├── Footer.vue │ │ ├── Header │ │ │ ├── Nav.vue │ │ │ ├── NavSearch.vue │ │ │ ├── NavMo.vue │ │ │ └── NavHeader.vue │ │ ├── Post │ │ │ └── Post.vue │ │ └── Panel.vue │ ├── NotFound.vue │ ├── index.ts │ ├── config │ │ ├── posts.ts │ │ ├── iro.ts │ │ ├── example.ts │ │ └── types.mts │ ├── Iro.vue │ ├── style.scss │ └── Layout.vue └── config.mts ├── posts └── helloworld.md ├── example.md ├── package.json ├── readme.md └── LICENSE.txt /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: home 3 | --- -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vitepress/cache 2 | .vitepress/dist 3 | 4 | node_modules/ 5 | package-lock.json -------------------------------------------------------------------------------- /public/res/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KeqingMoe/sakurairo/HEAD/public/res/icon.png -------------------------------------------------------------------------------- /public/res/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KeqingMoe/sakurairo/HEAD/public/res/avatar.png -------------------------------------------------------------------------------- /public/res/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KeqingMoe/sakurairo/HEAD/public/res/favicon.png -------------------------------------------------------------------------------- /public/res/posts/helloworld.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KeqingMoe/sakurairo/HEAD/public/res/posts/helloworld.jpg -------------------------------------------------------------------------------- /.vitepress/theme/env.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import type { DefineComponent } from 'vue' 3 | const component: DefineComponent<{}, {}, any> 4 | export default component 5 | } 6 | -------------------------------------------------------------------------------- /.vitepress/theme/iro.data.ts: -------------------------------------------------------------------------------- 1 | import { Iro } from "./config/types.mts"; 2 | import iro from "./config/iro"; 3 | 4 | export default { 5 | load() { 6 | return iro; 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /.vitepress/theme/template.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 14 | 15 | 16 | 28 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Home/Home.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /posts/helloworld.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 你好,世界! 3 | --- 4 | 5 | ## 序言 6 | 7 | 在这篇文章里,我们将一起探索“你好,世界!”这个简单而又意义深远的短语。 8 | 9 | ## 起源 10 | 11 | “你好,世界!”的起源可以追溯到 1970 年代,由 Brian Kernighan 编写的 C 语言书籍中首次出现。这个短语很快成为了程序员们的传统,用于测试新语言是否能够成功编译和运行。 12 | 13 | ## 为什么是“你好,世界!”? 14 | 15 | 选择“你好,世界!”作为第一个程序的原因很简单:它足够简单,能够展示基本的输入输出功能,同时又能传达出友好和探索的精神。 16 | 17 | ## 编程语言中的“你好,世界!” 18 | 19 | 几乎所有的编程语言都有“你好,世界!”的版本,以下是一些示例: 20 | 21 | - **C++**: 22 | ```cpp 23 | #include 24 | 25 | int main() { 26 | std::println("你好,世界!"); 27 | } 28 | ``` 29 | 30 | - **JavaScript**: 31 | ```js 32 | console.log("你好,世界!"); 33 | ``` 34 | 35 | ## “你好,世界!”的意义 36 | 37 | 虽然“你好,世界!”看起来只是一个简单的输出语句,但它实际上代表了程序员与计算机之间的第一次交流。它标志着程序员开始探索新语言的旅程。 38 | 39 | ## 结语 40 | 41 | “你好,世界!”不仅仅是一个程序,它是一个传统,一个开始,一个探索未知的邀请。每次我们写下这个短语,我们都在向一个全新的世界问好。 42 | -------------------------------------------------------------------------------- /.vitepress/theme/NotFound.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | 18 | 36 | -------------------------------------------------------------------------------- /.vitepress/theme/index.ts: -------------------------------------------------------------------------------- 1 | import type { Theme } from 'vitepress'; 2 | import DefaultTheme from 'vitepress/theme'; 3 | import { h } from 'vue'; 4 | 5 | import { library } from '@fortawesome/fontawesome-svg-core'; 6 | import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; 7 | import { fas } from '@fortawesome/free-solid-svg-icons'; 8 | import { far } from '@fortawesome/free-regular-svg-icons' 9 | library.add(fas, far); 10 | 11 | import vitepressNprogress from 'vitepress-plugin-nprogress'; 12 | import 'vitepress-plugin-nprogress/lib/css/index.css' 13 | 14 | import IroLayout from './Iro.vue'; 15 | import './style.scss'; 16 | 17 | export default { 18 | extends: DefaultTheme, 19 | Layout: IroLayout, 20 | enhanceApp({ app, router, siteData }) { 21 | app.component('fa-i', FontAwesomeIcon); 22 | vitepressNprogress({ app, router, siteData }); 23 | } 24 | } satisfies Theme; 25 | -------------------------------------------------------------------------------- /example.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 这是一个演示页面 3 | --- 4 | 5 | # 测试一级标题 6 | 7 | ## 测试二级标题 8 | 9 | ### 测试三级标题 10 | 11 | #### 测试四级标题 12 | 13 | ##### 测试五级标题 14 | 15 | ###### 测试六级标题 16 | 17 | 测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落,测试段落。 18 | 19 | 测试无序列表: 20 | - 测试无序列表 21 | - 测试无序列表 22 | - 测试无序列表 23 | 24 | 测试有序列表: 25 | 1. 测试有序列表 26 | 2. 测试有序列表 27 | 3. 测试有序列表 28 | 29 | > 测试引用内容 30 | 31 | [测试超链接](/readme)。 32 | 33 | ```cpp 34 | import std; 35 | 36 | int main() 37 | { 38 | std::println("测试多行代码。"); 39 | } 40 | ``` 41 | 42 | | 测试表格 | 测试表格 | 测试表格 | 测试表格 | 43 | | :--- | :---: | :---: | ---: | 44 | | 测 | 试 | 表 | 格 | 45 | | 测 | 试 | 表 | 格 | 46 | | 测 | 试 | 表 | 格 | 47 | | 测 | 试 | 表 | 格 | 48 | 49 | {测试:cè|shì}{注音符号:振り仮名}。 50 | 51 | 测试 LaTeX: $e^{i\pi}+1=0$ 52 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Home/CoverSocialButton.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sakurairo", 3 | "version": "1.0.0", 4 | "description": "将 WordPress 主题 Sakurairo 移植到 VitePress", 5 | "scripts": { 6 | "dev": "vitepress dev --host 0.0.0.0", 7 | "build": "vitepress build", 8 | "preview": "vitepress preview --host 0.0.0.0" 9 | }, 10 | "author": "keqingmoe", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "@mdit/plugin-ruby": "^0.13.0", 14 | "@types/node": "^22.4.2", 15 | "markdown-it-mathjax3": "^4.3.2", 16 | "sass": "^1.77.8", 17 | "url-polyfill": "^1.1.12", 18 | "vitepress": "^1.3.3", 19 | "vitepress-plugin-nprogress": "^0.0.4", 20 | "vue": "^3.4.38" 21 | }, 22 | "dependencies": { 23 | "@fortawesome/fontawesome-svg-core": "^6.6.0", 24 | "@fortawesome/free-brands-svg-icons": "^6.6.0", 25 | "@fortawesome/free-regular-svg-icons": "^6.6.0", 26 | "@fortawesome/free-solid-svg-icons": "^6.6.0", 27 | "@fortawesome/vue-fontawesome": "^3.0.8" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.vitepress/theme/config/posts.ts: -------------------------------------------------------------------------------- 1 | import { Iro } from "./types.mts"; 2 | 3 | /** 4 | * VitePress 主题 Sakurairo 的配置文件 5 | */ 6 | export default [ 7 | { 8 | title: '你好,世界!', 9 | url: '/posts/helloworld', 10 | thumb: '/res/posts/helloworld.jpg', 11 | date: '2024-10-4', 12 | description: '在这篇文章中,我们深入探讨了“你好,世界!”这一短语的起源、意义以及它的重要性。从最初的 C 语言教科书到今天所有编程语言的入门教程,这个短语已经成为了传统。通过不同编程语言的示例,我们看到了“你好,世界!”的普遍性。这个短语提醒我们,每次我们开始学习新语言时,我们都在向一个充满可能性的新世界问好。' 13 | }, { 14 | title: '演示页面', 15 | url: '/example', 16 | date: '2024-9-6', 17 | description: '该页面通过展示 Markdown 格式的不同元素,包括标题、段落、列表、引用、超链接、代码块、表格和 LaTeX 公式,来呈现 Markdown 的多样化内容展示能力。页面涵盖了从一级到六级的标题、列表、引用内容、超链接、代码示例、表格布局、注音符号,以及 LaTeX 公式的渲染。这些丰富的格式和功能,为内容创建提供了强大支持。' 18 | }, { 19 | title: '自述文件', 20 | url: '/readme', 21 | date: '2024-8-25', 22 | description: 'Sakurairo 是一个从 WordPress 移植到 VitePress 的主题,它利用 Vue3 提高了二次开发的效率和可复用性。该主题适用于静态站点,响应速度快,易于部署。它提供了快速开始指南,包括安装依赖、开发模式运行、构建和本地部署的命令。用户可以自定义主题,包括基本配置和高级自定义,如插槽使用和内部组件重写。此外,它还支持站内搜索功能,并有详细的发展规划,包括更多样式实现、增强可扩展性、优化项目结构等。项目遵循 GPLv2 开源协议,鼓励社区参与和贡献。' 23 | } 24 | ] satisfies Iro.Post[]; -------------------------------------------------------------------------------- /.vitepress/config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfigWithTheme } from 'vitepress'; 2 | import { ruby } from "@mdit/plugin-ruby"; 3 | import iro from './theme/config/iro'; 4 | import { statSync } from 'fs'; 5 | 6 | export default defineConfigWithTheme({ 7 | title: iro.title, 8 | titleTemplate: iro.titleTemplate, 9 | description: iro.description, 10 | cleanUrls: true, 11 | ignoreDeadLinks: true, 12 | markdown: { 13 | config: md => { 14 | md.use(ruby); 15 | }, 16 | math: true 17 | }, 18 | lastUpdated: true, 19 | head: [ 20 | ['link', { rel: 'icon', href: iro.favicon }], 21 | ], 22 | lang: 'zh', 23 | transformPageData(pageData) { 24 | if (pageData.isNotFound) return; 25 | 26 | pageData.lastUpdated = statSync(pageData.filePath).mtimeMs 27 | 28 | if (!('layout' in pageData.frontmatter)) { 29 | pageData.frontmatter.layout = 'post' 30 | } 31 | 32 | const title = '自述文件'; 33 | if (pageData.filePath == 'readme.md') { 34 | pageData.title = title; 35 | pageData.frontmatter.title = title; 36 | } 37 | }, 38 | }); 39 | -------------------------------------------------------------------------------- /.vitepress/theme/Iro.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 38 | -------------------------------------------------------------------------------- /public/res/iro/sakura_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /.vitepress/theme/config/iro.ts: -------------------------------------------------------------------------------- 1 | import { Iro } from "./types.mts"; 2 | import posts from "./posts"; 3 | 4 | /** 5 | * VitePress 主题 Sakurairo 的配置文件 6 | */ 7 | export default { 8 | title: "Sakurairo", 9 | titleTemplate: "Sakurairo 主题演示站点", 10 | description: "正在努力移植到 VitePress!", 11 | favicon: '/res/favicon.png', 12 | cover: { 13 | avatar: '/res/avatar.png', 14 | signature: '心有所向,日复一日,必有精进', 15 | background: { 16 | random: true, 17 | desktop: 'https://t.alcy.cc/fj/', 18 | mobile: 'https://t.alcy.cc/mp/', 19 | } 20 | }, 21 | nav: { 22 | icon: '/res/icon.png', 23 | links: [ 24 | { title: '首页', url: '/' }, 25 | { title: '演示页面', url: '/example' }, 26 | { title: '文章演示', url: '/posts/helloworld' }, 27 | { title: '自述文件', url: '/readme' }, 28 | { title: '404 页面演示', url: '/404' }, 29 | { title: '使用文档', url: 'https://docs.keqing.moe/iro/' }, 30 | { title: '源码', url: 'https://github.com/KeqingMoe/sakurairo' }, 31 | ] 32 | }, 33 | search: { 34 | path: '/', 35 | param: 's', 36 | }, 37 | social: { 38 | links: [ 39 | { 40 | icon: 'github', 41 | link: 'https://github.com/KeqingMoe', 42 | name: 'GitHub' 43 | }, 44 | { 45 | icon: 'tg', 46 | link: 'https://t.me/keqingmoe', 47 | name: 'Telegram' 48 | }, 49 | { 50 | icon: 'mail', 51 | link: 'mailto:me@keqing.moe', 52 | name: 'E-mail' 53 | }, 54 | ] 55 | }, 56 | footer: { 57 | content: '感谢您的使用!' 58 | }, 59 | style: { 60 | themeSkin: '#8e78c6', 61 | themeSkinMatching: '#5892eb', 62 | themeSkinDark: '#211a39', 63 | 64 | menuRadius: '10px', 65 | menuSelectionRadius: '10px', 66 | }, 67 | posts: posts 68 | } satisfies Iro.Config; 69 | -------------------------------------------------------------------------------- /.vitepress/theme/config/example.ts: -------------------------------------------------------------------------------- 1 | import { Iro } from "./types.mts"; 2 | 3 | /** 4 | * VitePress 主题 Sakurairo 的配置文件示例 5 | */ 6 | export default { 7 | title: "Sakurairo", 8 | titleTemplate: "Sakurairo 主题演示站点", 9 | description: "Hello world!", 10 | favicon: '/favicon.png', 11 | cover: { 12 | avatar: '/avatar.png', 13 | signature: '正在努力移植到 VitePress!', 14 | background: { 15 | random: true, 16 | desktop: 'https://t.alcy.cc/fj/', 17 | mobile: 'https://t.alcy.cc/mp/', 18 | } 19 | }, 20 | nav: { 21 | icon: '/icon.png', 22 | links: [ 23 | { title: '首页', url: '/' }, 24 | { title: '404 页面演示', url: '/404' }, 25 | { title: '源码', url: 'https://github.com/keqingmoe/sakurairo' }, 26 | ] 27 | }, 28 | search: { 29 | path: '/', 30 | param: 's', 31 | }, 32 | social: { 33 | links: [ 34 | { 35 | icon: 'github', 36 | link: 'https://github.com/KeqingMoe', 37 | name: 'GitHub', 38 | }, 39 | { 40 | icon: 'tg', 41 | link: 'https://t.me/keqingmoe', 42 | name: 'Telegram', 43 | }, 44 | { 45 | icon: 'mail', 46 | link: 'mailto:me@keqing.moe', 47 | name: 'E-mail', 48 | }, 49 | ] 50 | }, 51 | footer: { 52 | content: 'Hello world!', 53 | beforeSlot: false, 54 | }, 55 | error404: { 56 | title: '404 Not Found', 57 | text: '这里什么都没有...', 58 | }, 59 | style: { 60 | themeSkin: '#8e78c6', 61 | themeSkinMatching: '#5892eb', 62 | themeSkinDark: '#211a39', 63 | 64 | menuRadius: '10px', 65 | menuSelectionRadius: '10px', 66 | }, 67 | posts:[ 68 | { 69 | title:'这不是一篇文章', 70 | url:'/404', 71 | date:'2024-10-16', 72 | description:'点进去是 404 页面。' 73 | } 74 | ] 75 | } satisfies Iro.Config; 76 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Home/PostList.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 44 | 45 | 46 | 93 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Footer.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 29 | 30 | 116 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Header/Nav.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 34 | 35 | 125 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Post/Post.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 42 | 43 | 44 | 143 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Header/NavSearch.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 29 | 30 | 152 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 已归档,死了,我没空继续维护它 2 | 3 | # Sakurairo 4 | 5 | 将 [WordPress 主题 Sakurairo](https://github.com/mirai-mamori/Sakurairo) 移植到 VitePress。 6 | 7 | 演示站点:[iro.keqing.moe](https://iro.keqing.moe) 和 [iro.pages.dev](https://iro.pages.dev)。 8 | 9 | 使用文档:[docs.keqing.moe/iro](https://docs.keqing.moe/iro/)。 10 | 11 | ## 特性 12 | 13 | - 适用于 VitePress 的静态站点,响应速度远快于 WordPress,可以部署于静态站点托管平台 14 | - 内部使用 Vue3,二次开发效率高、难度低,结构清晰,可复用性高 15 | 16 | ## 快速开始 17 | 18 | 先基于本模板存储库创建一个自己的存储库。 19 | 20 | 安装依赖: 21 | 22 | ```shell 23 | npm install 24 | ``` 25 | 26 | 以开发模式运行: 27 | ```shell 28 | npm run dev 29 | ``` 30 | 31 | 构建: 32 | ```shell 33 | npm run build 34 | ``` 35 | 36 | 本地部署: 37 | ```shell 38 | npm run preview 39 | ``` 40 | 41 | 部署于静态站点托管平台(如 GitHub Pages 或 Cloudflare Pages)的流程与其他 VitePress 项目相同。 42 | 43 | ## 自定义 44 | 45 | ### 基本自定义 46 | 47 | 基本配置存放在 `iro.ts` 中,您可以自由修改。在 `types.mts` 中可以看到 `IroConfig` 的各种属性及其用法。`iro-example.ts` 中把每一个属性都写出来了,可以用作参考,或是直接复制后修改。 48 | 49 | 在 `config.ts` 中添加 `markdown-it` 插件,默认自带注音符号振假名插件 (@mdit/plugin-ruby),使用的方式请自行参考该插件的文档。 50 | 51 | 直接在根目录下创建 `.md` 文件撰写文章,将图片等资源文件放在 `public/` 目录下,如同本存储库演示的一样。 52 | 53 | 使用了 Font Awesome Icons,并注册了全局组件 ``,使用方式请参考 [官方文档](https://docs.fontawesome.com/web/use-with/vue/style)。 54 | 55 | ### 高级自定义 56 | 57 | 可以像扩展 VitePress 默认主题一样扩展 Sakurairo,具体包括: 58 | 59 | - 使用插槽: 60 | - 使用 `iro-home-page` 以自定义首页的封面之后的部分 61 | - 使用 `iro-signature` 以自定义签名组件 62 | - 使用 `iro-not-found` 以自定义 404 页面 63 | - 使用 `iro-page` 以自定义 **自定义页面**(与 VitePress 默认主题的 `layout` 为 `page` 的页面行为类似)。 64 | - 使用 `iro-home` 以自定义首页 65 | - 使用 `iro-post-list` 以自定义首页文章展示部分 66 | - 使用 `iro-post` 以自定义文章页面 67 | - 使用 `iro-other` 以自定义其他页面 68 | - 使用 `iro-footer` 以在页脚添加自定义组件 69 | - 以上的插槽都被转发到 `Iro.vue` ,可以在其中找到 70 | - 重写内部组件: 71 | - 重写 `Home.vue` 以自定义首页 72 | - 重写 `Panel.vue` 以自定义右下角小工具面板 73 | - 重写 `Footer.vue` 以自定义整个页脚 74 | - 重写 `Cover.vue` 以自定义首页封面 75 | - 重写 `CoverSocialButton.vue` 以自定义首页社交链接 76 | - 重写 `NavMo.vue` 以自定义移动端侧边栏 77 | - 重写 `NavSearch.vue` 以自定义桌面端搜索框 78 | - 重写 `NavHeader.vue` 以自定义导航栏 79 | - 重写 `NotFound.vue` 以自定义 404 页面 80 | - 重写 `Post.vue` 以自定义文章页面 81 | - 其他组件不建议重写,但如有重写的需求,可以在源代码中查找 82 | 83 | 不过,并不建议您采用重写组件的方式,因为内部组件的名字在未来可能会频繁变动。 84 | 85 | 由于本项目刚刚立项没多久,目前功能性还差很多没有实现,请耐心等待,或参与贡献。 86 | 87 | ### 自己编写组件 88 | 89 | 您可以以 `template.vue` 为模板,它已经预设了处理浅色、深色模式的逻辑,导入 `iro.data.ts` 等功能。也可适当参考我的源代码。 90 | 91 | 很抱歉,由于能力问题,我暂时没有做任何 SSR 兼容,这是通过 `Iro.vue` 来封装 `Layout.vue` 并套上一层 `` 实现的。因此,当您自己编写组件并放入插槽或者用于重写时,暂时也可以不做 SSR 兼容,但在未来的版本,您可能需要进行修改以适应 SSR 兼容的 Sakurairo。 92 | 93 | ### 站内搜索功能 94 | 95 | 该功能会在未来的版本中得到支持,但如果您要自己实现该功能,可以按如下的方式实现: 96 | 97 | 1. 配置 `iro.ts` ,填写 `iro.search` 字段。 98 | 2. 自己实现一个位于 ``` `http(s)://您的域名/`${iro.search.path}?${iro.search.param}=搜索内容 ``` (这是一个模板字符串)的搜索页面,例如 `https://keqing.moe/?s=114514` ,您需要自己处理参数实现站内搜索功能。 99 | 100 | ## 发展规划 101 | 102 | - 实现更多原版 Sakurairo 的样式。 103 | - 增强可拓展性。 104 | - 优化项目结构和代码组织。 105 | - 发布 npm 包。 106 | - 评论系统。 107 | - 统计功能。 108 | - 辅助配置主题的控制面板或脚本。 109 | - 站内搜索功能。 110 | - 字体自定义。 111 | - SSR 兼容 112 | 113 | ## 开源信息 114 | 115 | 本项目受 [WordPress 主题 Sakurairo](https://github.com/mirai-mamori/Sakurairo)。因不满于 WordPress 的高占用,又舍不得 Sakurairo 主题,我决定将其移植到 VitePress 上。 116 | 117 | 本项目是 [原项目](https://github.com/mirai-mamori/Sakurairo) 的衍生项目,最终目标是在外观和功能上还原原主题,并实现一些特色功能。因原项目使用的是 GPLv2 开源协议,所以本项目也使用 GPLv2 开源协议,如果您要基于本项目进行二次开发,或(模仿我)基于原 Sakurairo 进行二次开发,也应当使用 GPLv2 开源协议并遵守协议的要求。 118 | 119 | 本衍生项目使用了原项目的部分资源(例如图片等),我暂未获得原项目的授权,也未与其联系,如有任何侵权,请联系我。 120 | 121 | 项目的开发是困难的事情,如果你喜欢(原) Sakurairo 主题,或有参与本项目的打算,请发起 Issues 或 PR,或在我的个人主页找到我的联系方式并联系我。 122 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Header/NavMo.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 29 | 30 | 123 | -------------------------------------------------------------------------------- /.vitepress/theme/style.scss: -------------------------------------------------------------------------------- 1 | :root { 2 | // --iro-global-font-weight: 300; 3 | // --iro-font-color: #505050; 4 | // --iro-dm-bg-transparency: 0.8; 5 | } 6 | 7 | * { 8 | box-sizing: border-box; 9 | } 10 | 11 | html { 12 | font-family: Arial, Helvetica; 13 | overflow-x: hidden; 14 | background-color: unset; 15 | 16 | &.iro-open-nav { 17 | overflow: hidden; 18 | } 19 | 20 | &::-webkit-scrollbar { 21 | width: 6px; 22 | height: 6px; 23 | } 24 | 25 | &::-webkit-scrollbar-track, 26 | &.dark::-webkit-scrollbar-thumb { 27 | background-color: #eee; 28 | } 29 | 30 | &::-webkit-scrollbar-thumb { 31 | background-color: var(--iro-theme-skin); 32 | border-radius: 25px; 33 | } 34 | 35 | &.dark::-webkit-scrollbar-track { 36 | background-color: var(--iro-theme-skin); 37 | } 38 | 39 | } 40 | 41 | body { 42 | margin: 0; 43 | font-size: 17px; 44 | text-shadow: 0 0 1px rgba(0, 0, 0, .1); 45 | font-size: 15px; 46 | line-height: 1.5; 47 | background-attachment: fixed; 48 | background-position: center; 49 | scrollbar-width: 6px; 50 | font-weight: var(--iro-global-font-weight); 51 | 52 | font-family: Noto Serif SC !important; 53 | } 54 | 55 | ::before, 56 | ::after { 57 | box-sizing: inherit; 58 | } 59 | 60 | a { 61 | background-color: transparent; 62 | text-decoration: none; 63 | outline: 0; 64 | transition: color .2s ease-out, border .2s ease-out, opacity .2s ease-out; 65 | word-break: break-word; 66 | } 67 | 68 | input { 69 | color: var(--iro-theme-skin); 70 | font: inherit; 71 | margin: 0; 72 | line-height: 1.5; 73 | font-size: 15px; 74 | font-weight: var(--iro-global-font-weight); 75 | } 76 | 77 | input[type=search] { 78 | color: #666; 79 | border: 1px solid var(--iro-theme-skin, #505050); 80 | border-radius: 10px; 81 | padding: 3px; 82 | } 83 | 84 | ul { 85 | margin: 5px; 86 | padding-left: 0px; 87 | list-style: disc; 88 | } 89 | 90 | p { 91 | margin-bottom: 1.5em; 92 | } 93 | 94 | button { 95 | color: var(--iro-btn-bg-color); 96 | font: inherit; 97 | margin: 0; 98 | overflow: visible; 99 | text-transform: none; 100 | appearance: button; 101 | cursor: pointer; 102 | font-size: .75rem; 103 | line-height: 1; 104 | border: 1px solid; 105 | border-color: #ccc #ccc #bbb; 106 | border-radius: 3px; 107 | background: #e6e6e6; 108 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 15px 17px rgba(255, 255, 255, .5), inset 0 -5px 12px rgba(0, 0, 0, .05); 109 | padding: .6em 1em .4em; 110 | font-weight: var(--iro-global-font-weight); 111 | } 112 | 113 | rt { 114 | font-size: 75%; 115 | } 116 | 117 | .iro-no-select { 118 | user-select: none; 119 | } 120 | 121 | .iro-blank { 122 | padding-top: 80px; 123 | background-color: rgba(0, 0, 0, 0); 124 | transition: background-color 0.8s; 125 | } 126 | 127 | h1 { 128 | font-size: 2em; 129 | margin: .67em 0; 130 | clear: both; 131 | font-weight: var(--iro-global-font-weight); 132 | 133 | &::before { 134 | display: block; 135 | content: " "; 136 | height: 80px; 137 | margin-top: -80px; 138 | visibility: hidden; 139 | } 140 | } 141 | 142 | h1, 143 | h2, 144 | h3, 145 | h4, 146 | h5, 147 | h6 { 148 | border-top: none !important; 149 | } 150 | 151 | hr { 152 | box-sizing: content-box; 153 | height: 1px; 154 | background-color: #ccc; 155 | border: 0; 156 | margin-bottom: 1.5em; 157 | } 158 | 159 | @keyframes iro-fade-in-down { 160 | 0% { 161 | -moz-transform: translateY(-100%); 162 | -ms-transform: translateY(-100%); 163 | -webkit-transform: translateY(-100%); 164 | transform: translateY(-100%); 165 | opacity: 0 166 | } 167 | 168 | 50% { 169 | -moz-transform: translateY(-100%); 170 | -ms-transform: translateY(-100%); 171 | -webkit-transform: translateY(-100%); 172 | transform: translateY(-100%); 173 | opacity: 0 174 | } 175 | 176 | 100% { 177 | -moz-transform: translateY(0%); 178 | -ms-transform: translateY(0%); 179 | -webkit-transform: translateY(0%); 180 | transform: translateY(0%); 181 | opacity: 1 182 | } 183 | } -------------------------------------------------------------------------------- /.vitepress/theme/components/Panel.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 62 | 63 | 216 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Home/Cover.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 58 | 59 | 187 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Home/PostListItem.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 49 | 50 | 51 | 240 | -------------------------------------------------------------------------------- /.vitepress/theme/config/types.mts: -------------------------------------------------------------------------------- 1 | export namespace Iro { 2 | /** 3 | * 封面设置 4 | */ 5 | export interface Cover { 6 | /** 7 | * 封面的签名,纯文本,html 不起作用 8 | */ 9 | signature: string; 10 | /** 11 | * 网站拥有者的头像的 url,直接作为 img 元素的 src 属性值,会在主页展示 12 | */ 13 | avatar: string; 14 | /** 15 | * 首页封面图片,固定图片或随机图片 16 | */ 17 | background: { 18 | /** 19 | * 为 true 时使用随机图片 20 | */ 21 | random?: boolean; 22 | /** 23 | * 桌面端图片 URL,直接填入 CSS url(...)中 24 | */ 25 | desktop: string; 26 | /** 27 | * 移动端图片 URL,直接填入 CSS url(...)中 28 | */ 29 | mobile: string; 30 | }; 31 | }; 32 | 33 | /** 34 | * 导航栏相关设置 35 | */ 36 | export interface Nav { 37 | /** 38 | * 导航菜单图标的 url,直接作为 img 元素的 src 属性值 39 | */ 40 | icon: string; 41 | /** 42 | * 导航栏显示的链接 43 | */ 44 | links?: { 45 | /** 46 | * 链接的提示文本 47 | */ 48 | title: string; 49 | /** 50 | * 链接的 url,直接作为 a 元素的 href 属性值 51 | */ 52 | url: string; 53 | }[]; 54 | }; 55 | 56 | /** 57 | * 拼接出用于搜索的 url,例如 `https://example.com/search?s=keyword` ,请看各属性的注释。没有该属性则不会显示搜索框 58 | */ 59 | export interface Search { 60 | /** 61 | * 搜索 url 的 pathname 部分,默认为 `search` 62 | * 不要带前面的斜杠,除非搜索 url 的 pathname 是根目录 63 | */ 64 | path?: string; 65 | /** 66 | * 搜索 url 的 param 部分,默认为 `s` 67 | */ 68 | param?: string; 69 | }; 70 | 71 | /** 72 | * 社交网络链接 73 | */ 74 | export interface SocialLink { 75 | /** 76 | * 图标的名字,对于 WordPress 主题 Sakurairo 的图标包集中的图标包,可能的值可以是: 77 | * @enum `mail`: E-mail 图标 78 | * @enum `github`: GitHub 图标 79 | * @enum `tg`: Telegram 图标 80 | * @enum `zhihu`: 知乎图标 81 | * @enum `book`: 简书图标 82 | * @enum `st`: Steam 图标 83 | * @enum `lofter`: Lofter 图标 84 | * @enum `ncm`: 网易云音乐图标 85 | * @enum `bilibili`: 哔哩哔哩图标 86 | * @enum `lk`: 领英图标 87 | * @enum `tw`: 原 Twitter 图标 88 | * @enum `fb`: Facebook 图标 89 | * @enum `qq`: QQ 图标 90 | * @enum `qz`: QQ 空间图标 91 | * @enum `wechat`: 微信图标 92 | * @enum `youku`: 优酷图标 93 | * @enum `weibo`: 微博图标 94 | * @enum `csdn` 95 | * @enum `custom`: 使用 `iconUrl` 提供的图标 96 | */ 97 | icon: string; 98 | /** 99 | * 自定义图标的 url,直接作为 img 的 src 属性值 100 | */ 101 | iconUrl?: string; 102 | /** 103 | * 社交网络链接的 url 104 | */ 105 | link: string; 106 | /** 107 | * 提示文本 108 | */ 109 | name: string; 110 | } 111 | 112 | /** 113 | * 社交网络链接的集合及对应图标包集/图标包 114 | */ 115 | export interface Social { 116 | /** 117 | * 图标包集引用链接,不填默认为 WordPress 主题 Sakurairo 的图标包集 `https://s.nmxc.ltd/sakurairo_vision/@2.6/display_icon/` 118 | */ 119 | iconUrl?: string; 120 | /** 121 | * 图标包,不填默认为 `sakura` 。可能的值可以是: 122 | * @enum `sakura`: 樱花配色 123 | * @enum `fluent_design`: 流畅设计 124 | * @enum `muh2`: 沐氢图标 125 | * @enum `flat_colorful`: 扁平多彩 126 | * @enum `macaronblue`: 马卡龙蓝 127 | * @enum `macarongreen`: 马卡龙绿 128 | * @enum `macaronpurple`: 马卡龙紫 129 | * @enum `pink`: 初始粉色 130 | * @enum `orange`: 阳光橙色 131 | * @enum `sangosyu`: 珊瑚朱色 132 | * @enum `sora`: 传统空色 133 | * @enum `nae:` 新生苗色 134 | */ 135 | iconPkg?: string; 136 | /** 137 | * 一系列社交网络链接 138 | */ 139 | links?: SocialLink[]; 140 | }; 141 | 142 | /** 143 | * 页脚相关配置 144 | */ 145 | export interface Footer { 146 | /** 147 | * 页脚内容,可以填 html 148 | */ 149 | content?: string; 150 | /** 151 | * 在设置了 iro-footer 插槽后,用来决定 content 是否放在插槽前面 152 | */ 153 | beforeSlot?: boolean; 154 | }; 155 | 156 | /** 157 | * 404 页面相关配置 158 | */ 159 | export interface Error404 { 160 | /** 161 | * 404 页面标题,可以填 html 162 | */ 163 | title?: string; 164 | /** 165 | * 404 页面文本,可以填 html 166 | */ 167 | text?: string; 168 | }; 169 | 170 | /** 171 | * 主题样式的 CSS 变量,属性值将直接作为 CSS 变量的值,请按 CSS 的写法来填写各个属性 172 | */ 173 | export interface Style { 174 | /** 主题色 */ 175 | themeSkin: string; 176 | /** 主题搭配色 */ 177 | themeSkinMatching: string; 178 | /** 深色模式主题色 */ 179 | themeSkinDark: string; 180 | /** 小组件面板按钮圆角 */ 181 | menuRadius: string; 182 | /** 小组件面板组件圆角 */ 183 | menuSelectionRadius: string; 184 | }; 185 | 186 | /** 187 | * 文章信息 188 | */ 189 | export interface Post { 190 | /** 191 | * 文章标题 192 | */ 193 | title: string; 194 | /** 195 | * 文章链接 196 | */ 197 | url: string; 198 | /** 199 | * 文章缩略图,可选,不填则默认为 PC 端的封面图 200 | */ 201 | thumb?: string; 202 | /** 203 | * 文章发布日期 204 | */ 205 | date: any; 206 | /** 207 | * 文章描述或摘要 208 | */ 209 | description: string; 210 | }; 211 | 212 | /** 213 | * VitePress 主题 Sakurairo 的配置类型 214 | */ 215 | export interface Config { 216 | /** 217 | * 网站标题 218 | */ 219 | title: string; 220 | /** 221 | * 网站标题后缀 222 | */ 223 | titleTemplate?: string; 224 | /** 225 | * 网站描述 226 | */ 227 | description: string; 228 | /** 229 | * 网页图标的 url,直接作为 img 元素的 src 属性值 230 | */ 231 | favicon: string; 232 | /** 233 | * 封面设置 234 | */ 235 | cover: Cover; 236 | /** 237 | * 导航栏相关设置 238 | */ 239 | nav?: Nav; 240 | /** 241 | * 拼接出用于搜索的 url,例如 `https://example.com/search?s=keyword` ,请看各属性的注释。没有该属性则不会显示搜索框 242 | */ 243 | search?: Search; 244 | /** 245 | * 社交网络链接 246 | */ 247 | social?: Social; 248 | /** 249 | * 页脚相关配置 250 | */ 251 | footer?: Footer; 252 | /** 253 | * 404 页面相关配置 254 | */ 255 | error404?: Error404; 256 | /** 257 | * 主题样式的 CSS 变量,属性值将直接作为 CSS 变量的值,请按 CSS 的写法来填写各个属性 258 | */ 259 | style?: Style; 260 | /** 261 | * 文章信息列表 262 | */ 263 | posts?: Post[]; 264 | }; 265 | } -------------------------------------------------------------------------------- /.vitepress/theme/Layout.vue: -------------------------------------------------------------------------------- 1 | 61 | 62 | 104 | 105 | 106 | 213 | -------------------------------------------------------------------------------- /.vitepress/theme/components/Header/NavHeader.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 41 | 42 | 295 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. --------------------------------------------------------------------------------