Skip to content

v2.0.18

Latest

Choose a tag to compare

@SoonIter SoonIter released this 17 Jul 18:05
8978dd9

Highlights

🤖 Customize llms.txt and Guide LLMs to Markdown

Enable llms to generate llms.txt, llms-full.txt, and a Markdown copy of every page. You can now use llms.llmsTxt to control the complete llms.txt output with site metadata and navigation-ordered pages. Rspress also injects the following hidden hint into generated HTML pages so LLMs can discover these files:

<div style="display:none" hidden="" aria-hidden="true">Are you an LLM? View https://example.com/llms.txt for optimized Markdown documentation, or https://example.com/llms-full.txt for full documentation bundle. This page is also available as Markdown at https://example.com/guide/index.md</div>

The hint is enabled by default. Use injectLlmsHint: false to disable it independently; the configuration below also shows how to customize llms.txt:

import { defineConfig } from '@rspress/core';

export default defineConfig({
  llms: {
    llmsTxt: ({ title = 'Documentation', sections }) => {
      const pages = sections
        .flatMap(section => section.pages)
        .map(page => `- [${page.title}](${page.link})`)
        .join('\n');

      return `# ${title}\n\n${pages}`;
    },
  },
  themeConfig: {
    llmsUI: {
      injectLlmsHint: false,
    },
  },
});

Documentation: SSG-MD · injectLlmsHint

Related PRs: #3527 · #3526

🌍 Add Language Alternatives Automatically

For pages with existing translations, Rspress now adds reciprocal language links to <head>, helping search engines send readers to the right language:

<link rel="alternate" hreflang="en" href="https://example.com/docs/guide.html">
<link rel="alternate" hreflang="zh" href="https://example.com/docs/zh/guide.html">

Only translations that actually exist are included. Generated URLs automatically respect base, siteOrigin, and route.cleanUrls.

Documentation: Customizing head tags

Related PR: #3524

⚡ Start Loading Page Code Before Hydration

Each generated page now preloads its own async route chunk:

<link rel="preload" href="/static/js/async/route-<hash>.js" as="script">

This lets the browser fetch the page code before the client runtime starts hydration, removing an extra network waterfall. Preload URLs support base, CDN asset prefixes, and assetPrefix: 'auto'.

Documentation: Customizing head tags

Related PR: #3518

What's Changed

New Features 🎉

  • feat(plugin-algolia): Integrate startTransition for navigation and refactor preconnect logic 🔍 by @sanjaiyan-dev in #3508
  • feat(plugin-algolia): Add Tamil (தமிழ்) translations for Algolia search interface 📜 by @sanjaiyan-dev in #3509
  • feat(SEO/i18n): add alternate links for multilingual pages by @SoonIter in #3524
  • feat(ssg-md): support custom llms.txt rendering by @SoonIter in #3527
  • feat(theme/Llms): add injectLlmsHint option to guide LLMs to Markdown by @SoonIter in #3526

Performance 🚀

  • perf(runtime): preload current route chunks with link tag by @SoonIter in #3518

Bug Fixes 🐞

  • fix(theme/Nav): add :hover as onMouseEnter fallback before hydration by @SoonIter in #3515
  • fix(create-rspress): preserve skill names in prompts by @SoonIter in #3522
  • fix(theme/HomeFeature): fix shine not rotating with card causing gap by @HenryZ119 in #3511
  • fix(theme/Llms): hide "Open in chat" row when no chat-openable option… by @cloudmoonocus in #3517
  • fix(create-rspress): add TypeScript dependency to templates by @SoonIter in #3525
  • fix(theme/Llms): align view options behavior by @SoonIter in #3523

Refactor 🔨

  • refactor(create-rspress): improve custom theme home gradient by @SoonIter in #3519

Other Changes

New Contributors

Full Changelog: v2.0.17...v2.0.18