Jerry's Blog

Back

更新主题

将 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-official/transformers.ts
  • 改进了配置文件,调整了顺序并添加了注释。这将同时影响 src/site.config.tsastro.config.ts (09dc44d)。
  • 默认添加了代码折叠功能 (7281077, 22b8847)
  • 重构了调色板和边框半径样式。如果你使用了类似 --primary-foreground 的颜色,请将其更新为 --card

v4.1.0#

v4.0.9#

  • 支持缓存链接头像 (Arthals)

v4.0.8#

无破坏性变更。

v4.0.7#

  • Button 组件改为使用 variant 属性替代 style 属性。这可以帮助你在不冲突的情况下添加自定义样式。你需要像这样修改代码:
<Button title='我的按钮' style='primary' /> 
<Button title='我的按钮' variant='primary' /> 
jsx
  • 更改了 src/site.config.ts 中的 ExternalLinks 配置。你需要像这样修改配置:
  • 将 Waline 文件移出了包!查看 Commit 5119694 了解如何修改你现有的页面和布局。不要忘记将 src/components/waline 下的文件复制到你的项目中。

v4.0.6#

  • 将项目卡片变量名从 project 改为 projects

v4.0.5#

  • 将 UnoCSS 预设从 Wind3 改为 Mini。一些功能被移除了,比如 gradientanimationcontainer 等。

v4.0.3#

  • 将底部注册配置改为 links。这将为你提供更大的灵活性来添加更多链接或其他信息:

v4.0.2-beta#

  • 考虑将工具图标移动到新路径,例如 src/assets/tools/;这可能有助于用户知道哪些图标与工具有关。
  • 将链接 applyTip 改为自定义数组样式:
src/site.config.ts
export const integ: IntegrationUserConfig = {
  links: {
    applyTip: [
      { name: '名称', val: theme.title }, 
      { name: '描述', val: theme.description || '空' },
      { name: '链接', val: 'https://astro-pure.js.org/' },
      { name: '头像', val: 'https://astro-pure.js.org/favicon/favicon.ico' }
      // 你也可以添加更多字段
    ]
  }
}
ts
  • 添加环境变量 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
<ToolSection
  tools={[
    {
      name: 'Arch Linux',
      description: 'Linux 发行版',
      href: 'https://archlinux.org/',
      iconPath: 'archlinux'
      icon: import('@/assets/icons/archlinux.svg?raw') 
    }
  ]},
/>
ts

v4.0.0-alpha#

  • 将所有复用的组件、类型和工具函数移至新的 npm 包 astro-pure。受影响的组件包含在 . 中。导入方式也发生了变化:
import { Button } from '@/components/user'
import { Button } from 'astro-pure/user'
ts
  • 新的配置文件格式 src/site.config.ts。将使用 zod 模式来验证配置文件,并且配置的使用方式将更改为:
import { siteConfig } from '@/site-config'
import config from '@/site-config'
// 或者如果你想使用处理或转换后的配置
import config from 'virtual:config'
ts
  • 支持内置的 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 移至 integrationConfig.typography.class,位于 src/site.config.ts
  • 将高级组件移至 src/components/advanced。受影响的组件包含在 高级组件 中。导入方式也发生了变化:
import LinkPreview from '@/components/LinkPreview.astro'
import { LinkPreview } from 'astro-pure/advanced'

<LinkPreview href='https://www.cloudflare.com/' />
ts
  • Substats 配置移至相关页面 src/pages/about/index.astro
  • 将 Github Card 组件更改为 GithubCard,位于 src/components/advanced。使用方法请参见 高级组件 #Github Card
  • 将链接日志簿移至 src/site.config.ts。请参见 友情链接 #基本配置

v3.1.3#

  • 将用户组件移至 src/components/user。受影响的组件包含在 用户组件 中。导入方式也发生了变化:
import Button from '@/components/Button'
import { Button } from 'astro-pure/user'
ts
  • remark-github-blockquote-alert 插件替换为组件 Aside。查看 用户组件 #Aside 了解如何迁移。

v3.1.2 (预发布)#

  • 将一些配置项(如 telegramwalineServerURL)移至 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 (预发布)#

  • 将常见内容 markdown 格式化器 coverImage 更改为 heroImage。你需要修改所有的 markdown 文件,将 coverImage 替换为 heroImage

v3.0.9#

一个稳定版本。

待更新…

更新方法#

Rebase#

如果你是通过 fork 创建的新项目,可以直接将主题仓库变基到最新版本。

手动合并#

由于 Git 历史不同,你可能需要手动将主题仓库合并到你的项目中。

对于 Windows 用户,一个实用的工具是 WinMerge

以下过滤列表可能对你有帮助: