Astro Theme Pure

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-offical/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 组件的 style 属性更改为 variant 属性。这可以帮助您添加自定义样式而不会产生冲突。您应该将代码修改如下:

    <Button title='My Button' style='primary' /> 
    <Button title='My Button' 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: '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
        ]
      }
    }
    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 Distribution',
          href: 'https://archlinux.org/',
          iconPath: 'archlinux'
          icon: import('@/assets/icons/archlinux.svg?raw') 
        }
      ]},
    />
    ts
  • 此更改导入了一个新组件 Svg。有关用法,请参阅 用户组件 #Svg 加载器

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'
    // Or if you want to use the config that is after processed or transformed
    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 移动到 src/site.config.ts 中的 integrationConfig.typography.class

  • 将高级组件移动到 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 卡片组件更改为 src/components/advanced 中的 GithubCard。有关用法,请参阅 高级组件 #Github 卡片

  • 将 Links Logbook 移动到 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 (pre-release)#

  • 将一些配置项如 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 (pre-release)#

  • 将通用内容 markdown 格式化器 coverImage 更改为 heroImage。您需要修改所有 markdown 文件,将 coverImage 替换为 heroImage

v3.0.9#

一个稳定版本。

待更新…

更新方法#

变基 (Rebase)#

如果您使用 fork 创建了一个新项目,您可以直接将主题仓库变基到最新版本。

手动合并#

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

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

过滤列表可能会有所帮助: