更新主题
将 astro theme pure 更新到最新版本
破坏性变更#
v4.1.2#
- 将
src/pages/terms/list.astro移动到src/pages/terms/index.astro。
v4.1.1#
- 将 shiki 自定义转换器移动到
src/plugins/shiki-custom-transformers.ts。 - 将 shiki 官方转换器移动到
src/plugins/shiki-offical/transformers.ts。 - 改进了配置文件,添加了新的顺序和注释。这将影响
src/site.config.ts和astro.config.ts两个文件 (09dc44d ↗)。 - 添加了默认的代码折叠功能 (7281077 ↗, 22b8847 ↗)
- 重构了调色板和边框半径样式。如果您使用了
--primary-foreground这样的颜色,请将其更新为--card。
v4.1.0#
- 将自定义 CSS 文件
global.css移动到src/assets/styles/global.css。 - 将字体加载器更改为 Astro 内置字体加载器 ↗。
v4.0.9#
- 支持缓存链接头像 (Arthals)
v4.0.8#
无破坏性变更。
v4.0.7#
-
将
Button组件的style属性更改为variant属性。这可以帮助您添加自定义样式而不会产生冲突。您应该将代码修改如下:
jsx<Button title='My Button' style='primary' /> <Button title='My Button' variant='primary' /> -
更改了
src/site.config.ts中的ExternalLinks配置。您应该将配置修改如下:src/site.config.ts
tsexport const theme: ThemeUserConfig = { content: { externalLinksContent: ' ↗', /** External links configuration */ externalLinks: { content: ' ↗', /** Properties for the external links element */ properties: { style: 'user-select:none' } }, /** Blog page size for pagination (optional) */ blogPageSize: 8, externalLinkArrow: true // show external link arrow } }- 将 Waline 文件移出了包!查看 Commit 5119694 ↗ 了解如何更改您现有的页面和布局。不要忘记将
src/components/waline目录下的文件复制到您的项目中。
- 将 Waline 文件移出了包!查看 Commit 5119694 ↗ 了解如何更改您现有的页面和布局。不要忘记将
v4.0.6#
- 将项目卡片变量名从
project更改为projects。
v4.0.5#
- 将 UnoCSS 预设从
Wind3更改为Mini。移除了一些功能,如gradient、animation、container等。
v4.0.3#
-
将页脚注册配置更改为
links。这将为您提供更大的灵活性,可以添加更多链接或其他信息:src/site.config.ts
tsexport const theme: ThemeUserConfig = { footer: { links: [ { title: 'Moe ICP 114514', link: 'https://icp.gov.moe/?keyword=114514', style: 'text-sm' // Uno/TW CSS class }, { title: 'Site Policy', link: '/terms/list', pos: 2 // position set to 2 will be appended to copyright line } ] } }
v4.0.2-beta#
-
考虑将工具图标移动到新路径,如
src/assets/tools/;这可以帮助用户了解哪些图标与工具有关。 -
将链接的
applyTip更改为自定义数组样式:src/site.config.ts
tsexport const integ: IntegrationUserConfig = { links: { applyTip: [ { name: 'Name', val: theme.title }, { name: 'Desc', val: theme.description || 'Null' }, { name: 'Link', val: 'https://astro-pure.js.org/' }, { name: 'Avatar', val: 'https://astro-pure.js.org/favicon/favicon.ico' } // You can also add more fields ] } } -
添加了环境变量
BUN_LINK_PKG。将其设置为true会自动引用packages/pure路径中的astro-pure包,而不是node_modules/astro-pure。这可以帮助用户开发主题或自行修改代码(不建议用于生产环境)。 -
将 CSS 框架更改为 UnoCSS。这将影响
unocss.config.ts和排版类名设置。
v4.0.1-beta#
-
将 SVG 交付导入更改为自定义导入 SVG 元素。这将影响
ToolSelection组件的使用。您应该进行如下更改:(可选)将图标移动到新路径,如
src/assets/icons/然后更改使用代码(默认为
src/pages/about/index.astro)src/pages/about/index.astro
ts<ToolSection tools={[ { name: 'Arch Linux', description: 'Linux Distribution', href: 'https://archlinux.org/', iconPath: 'archlinux' icon: import('@/assets/icons/archlinux.svg?raw') } ]}, /> -
此更改导入了一个新组件
Svg。有关用法,请参阅 用户组件 #Svg 加载器。
v4.0.0-alpha#
-
将所有可重用的组件、类型和工具函数移动到新的 npm 包
astro-pure中。受影响的组件包括在其中。导入方法也已更改:
tsimport { Button } from '@/components/user' import { Button } from 'astro-pure/user' -
新格式的配置文件
src/site.config.ts。将有 zod 模式来验证配置文件,配置的使用方式也将更改为:
tsimport { siteConfig } from '@/site-config' import config from '@/site-config' // Or if you want to use the config that is after processed or transformed import config from 'virtual:config' -
支持内置的 astro 配置。
astro-pure包将自动配置一些集成,如unocss/astro、@astrojs/mdx、@astrojs/sitemap,以及一些 rehypePlugins 和 remarkPlugins。 -
将搜索引擎更改为 pagefind ↗,主要是因为 Astro v5 不允许直接从客户端获取集合数据(这是 Fuse.js 搜索引擎的核心工作模式)。
-
将一些
BaseHead标签配置更改为src/site.config.ts。
v3.1.4#
-
将配置
siteConfig.content.typographyProse移动到src/site.config.ts中的integrationConfig.typography.class。 -
将高级组件移动到
src/components/advanced。受影响的组件包含在 高级组件 中。导入方法也已更改:
tsimport LinkPreview from '@/components/LinkPreview.astro' import { LinkPreview } from 'astro-pure/advanced' <LinkPreview href='https://www.cloudflare.com/' /> -
将
Substats配置移动到相关页面src/pages/about/index.astro。 -
将 Github 卡片组件更改为
src/components/advanced中的GithubCard。有关用法,请参阅 高级组件 #Github 卡片。 -
将 Links Logbook 移动到
src/site.config.ts。有关详细信息,请参阅 友链 #基本配置。
v3.1.3#
-
将用户组件移动到
src/components/user。受影响的组件包含在 用户组件 中。导入方法也已更改:
tsimport Button from '@/components/Button' import { Button } from 'astro-pure/user' -
将
remark-github-blockquote-alert插件替换为组件Aside。有关如何迁移,请查看 用户组件 #Aside。
v3.1.2 (pre-release)#
- 将一些配置项如
telegram、walineServerURL移动到src/site.config.ts中的新结构。
v3.1.1#
- 将
src/utils中的内部部分移动到src/plugins。 - 将配置文件
astro.config.ts修改为astro.config.mjs。 - 将 ESLint 更新到最新版本,并将配置文件
.eslintrc.js迁移到eslint.config.mjs。 - 将
prettier.config.js修改为prettier.config.mjs。
v3.1.0 (pre-release)#
- 将通用内容 markdown 格式化器
coverImage更改为heroImage。您需要修改所有 markdown 文件,将coverImage替换为heroImage。
v3.0.9#
一个稳定版本。
待更新…
更新方法#
变基 (Rebase)#
如果您使用 fork 创建了一个新项目,您可以直接将主题仓库变基到最新版本。
手动合并#
由于 git 历史不同,您可能需要手动将主题仓库合并到您的项目中。
对于 Windows 用户,一个实用的方法是使用工具 WinMerge ↗。
过滤列表可能会有所帮助:
## 这是 WinMerge 的目录/文件过滤模板
name: Astro Theme Pure
desc: 博客与 Astro Theme Pure 的差异比较
## 选择过滤器是包含性还是排除性
## 包含性(宽松)过滤器允许通过所有不匹配规则的项目
## 排除性过滤器仅允许通过匹配规则的项目
## include 或 exclude
def: include
## 文件名过滤器以 f: 开头
## 目录过滤器以 d: 开头
## 要排除一些匹配 f: 模式的文件,请指定 f!:
## 要排除一些匹配 d: 模式的文件夹,请指定 d!:
## (内联注释以 " ##" 开头,并延伸到行尾)
### Front-end files ###
d: \\\.git$
d: \\node_modules$
# Astro cache
d: \\\.vercel
d: \\\.astro
### Theme dev ###
d: ^\\packages$
d: ^\\preset$
d: ^\\test$
f: ^LICENSE$
f: ^README\.md$
f: ^README-zh-CN\.md$
f: ^CODE_OF_CONDUCT\.md$
# Project
f: ^bun\.lockb$
f: \.code-workspace$
f: ^ignore\.md$
### Astro theme pure ###
# Static
d: ^\\public\\favicon$
f: ^public\\links\.json$
f: ^public\\images\\social-card\.png$
# Assets
f: ^src\\assets\\avatar\.png$
d: ^\\src\\assets\\projects$
d: ^\\src\\assets\\tools$
# Content
d: ^\\src\\content\\blog$
d: ^\\src\\content\\docs$
d: ^\\src\\pages\\docs$
f: ^src\\pages\\terms\\.*\.md$
### Blog ###
# Your own filesdiff