Skip to content

Commit a6fbc74

Browse files
authored
Merge pull request #14 from signalwire/Devon/Update-theme
llms txt theme styling update
2 parents 219c81f + afcc300 commit a6fbc74

File tree

73 files changed

+3916
-2422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3916
-2422
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@signalwire/docusaurus-plugin-llms-txt': patch
3+
'@signalwire/docusaurus-theme-llms-txt': patch
4+
---
5+
6+
Code cleanup and cache optimization:
7+
8+
- Remove dead code (className prop, normalizePathname export, CopyContentData export)
9+
- Optimize cache implementation (replace over-engineered promise cache with minimal in-memory cache)
10+
- Fix resize re-fetch bug (component no longer re-fetches data when switching between mobile/desktop
11+
views)
12+
- Reduce code size by 47% in useCopyContentData hook
13+
- Changed the location of the CopyButtonContent component. The theme now swizzles DocItem/Layout and
14+
conditionally puts the Copy button content component after it or below it

.changeset/eight-vans-sleep.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@signalwire/docusaurus-plugin-llms-txt': patch
3+
'@signalwire/docusaurus-theme-llms-txt': patch
4+
---
5+
6+
Organize links by path now in llms-txt

.changeset/fast-lands-sit.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@signalwire/docusaurus-plugin-llms-txt': patch
3+
'@signalwire/docusaurus-theme-llms-txt': patch
4+
---
5+
6+
Fixed attachments filename bug
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
'@signalwire/docusaurus-plugin-llms-txt': patch
3+
'@signalwire/docusaurus-theme-llms-txt': patch
4+
---
5+
6+
Major architecture improvements for better plugin compatibility:
7+
8+
**Component Changes:**
9+
10+
- Switched from ejecting `DocItem/Layout` to wrapping `DocBreadcrumbs`
11+
- This prevents conflicts with other plugins that customize the layout
12+
- Uses WRAP pattern instead of EJECT for better compatibility
13+
- Changed internal import from `@theme-original` to `@theme-init` following Docusaurus best
14+
practices for theme enhancers
15+
16+
**Improvements:**
17+
18+
- Fixed type declarations to accurately reflect component props
19+
- Removed unused `className` prop from `CopyPageContent`
20+
- Fixed `DocBreadcrumbs` type declaration for proper wrapping support
21+
- Added `margin-left: auto` to ensure copy button always aligns right in desktop view
22+
- Fixed package publishing configuration
23+
- Added `src/theme` directory to published files for TypeScript swizzling support
24+
- Updated devDependencies for proper type resolution
25+
- Changed `react-icons` from exact version to version range
26+
27+
**Documentation:**
28+
29+
- Updated README with correct swizzle examples for `DocBreadcrumbs`
30+
- Added explanation of `@theme-init` vs `@theme-original` usage
31+
- Updated swizzle configuration to reflect new safe wrapping pattern
32+
33+
**Compatibility:**
34+
35+
- Now compatible with plugins like `docusaurus-plugin-openapi-docs` that also customize layouts
36+
- Follows official Docusaurus theme enhancer pattern (similar to `@docusaurus/theme-live-codeblock`)
37+
- Users can now safely wrap our enhanced breadcrumbs with `@theme-original/DocBreadcrumbs`

README.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,26 @@ structure.
88
| Package | Version | Description |
99
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
1010
| [`@signalwire/docusaurus-plugin-llms-txt`](./packages/docusaurus-plugin-llms-txt) | ![npm](https://img.shields.io/npm/v/@signalwire/docusaurus-plugin-llms-txt) | Generate Markdown versions of Docusaurus pages and an llms.txt index file |
11+
| [`@signalwire/docusaurus-theme-llms-txt`](./packages/docusaurus-theme-llms-txt) | ![npm](https://img.shields.io/npm/v/@signalwire/docusaurus-theme-llms-txt) | Theme components for llms.txt plugin with copy-to-clipboard functionality |
1112

1213
## 🚀 Quick Start
1314

1415
### Installation
1516

1617
```bash
17-
npm install @signalwire/docusaurus-plugin-llms-txt
18+
npm install @signalwire/docusaurus-plugin-llms-txt @signalwire/docusaurus-theme-llms-txt
1819
# or
19-
yarn add @signalwire/docusaurus-plugin-llms-txt
20+
yarn add @signalwire/docusaurus-plugin-llms-txt @signalwire/docusaurus-theme-llms-txt
2021
```
2122

2223
### Usage
2324

24-
Add to your `docusaurus.config.js`:
25+
Add to your `docusaurus.config.ts`:
2526

26-
```javascript
27-
module.exports = {
27+
```typescript
28+
import type { Config } from '@docusaurus/types';
29+
30+
const config: Config = {
2831
plugins: [
2932
[
3033
'@signalwire/docusaurus-plugin-llms-txt',
@@ -33,7 +36,10 @@ module.exports = {
3336
},
3437
],
3538
],
39+
themes: ['@signalwire/docusaurus-theme-llms-txt'],
3640
};
41+
42+
export default config;
3743
```
3844

3945
## 🏗 Development
@@ -121,7 +127,8 @@ For detailed publishing instructions, see [PUBLISHING.md](./PUBLISHING.md).
121127
```
122128
docusaurus-plugins/
123129
├── packages/ # Published packages
124-
│ └── docusaurus-plugin-llms-txt/
130+
│ ├── docusaurus-plugin-llms-txt/
131+
│ └── docusaurus-theme-llms-txt/
125132
├── website/ # Demo/documentation site
126133
├── .changeset/ # Changeset configuration
127134
├── lerna.json # Lerna configuration
@@ -194,3 +201,24 @@ consumption.
194201
- 🎯 Content filtering
195202

196203
[View Package →](./packages/docusaurus-plugin-llms-txt)
204+
205+
### [@signalwire/docusaurus-theme-llms-txt](./packages/docusaurus-theme-llms-txt)
206+
207+
Theme package providing UI components for the llms.txt plugin, including a copy-to-clipboard button
208+
for page content.
209+
210+
**Key Features:**
211+
212+
- 📋 Copy page content as Markdown
213+
- 🤖 Format for ChatGPT and Claude
214+
- 🎯 Smart detection of page title
215+
- 📱 Responsive mobile/desktop layouts
216+
- 🔧 Fully swizzlable components
217+
218+
**Architecture:**
219+
220+
- Uses DOM-based detection to identify page titles (H1 in `<header>` tags)
221+
- Global data fetching with shared cache for performance
222+
- Integrates seamlessly with Docusaurus theme system
223+
224+
[View Package →](./packages/docusaurus-theme-llms-txt)
Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,118 @@
11
# @signalwire/docusaurus-plugin-llms-txt
22

3-
## 2.0.0-alpha.0
3+
## 2.0.0-alpha.5
4+
5+
### Patch Changes
6+
7+
- Organize links by path now in llms-txt
8+
- 85c2631: Fixed attachments filename bug
9+
10+
## 2.0.0-alpha.3
411

512
### Major Changes
613

7-
- Alpha Release
14+
- 75c2b75: Alpha Release
15+
16+
### Patch Changes
17+
18+
- Fix `contentStrategy` bug where dropdown menu displayed incorrect content type. When
19+
`contentStrategy: 'html-only'` is set, the dropdown now correctly shows "Copy Raw HTML" instead of
20+
"Copy Raw Markdown". The "View Markdown" option remains available when markdown exists,
21+
independent of `contentStrategy` setting.
22+
23+
- Updated ambient type declarations to remove unused `hasMarkdown` prop from CopyButton component.
24+
25+
- Updated README documentation to clarify `contentStrategy` behavior and `viewMarkdown`
26+
independence.
27+
28+
- ec2e25b: Code cleanup and cache optimization:
29+
- Remove dead code (className prop, normalizePathname export, CopyContentData export)
30+
- Optimize cache implementation (replace over-engineered promise cache with minimal in-memory
31+
cache)
32+
- Fix resize re-fetch bug (component no longer re-fetches data when switching between
33+
mobile/desktop views)
34+
- Reduce code size by 47% in useCopyContentData hook
35+
- Changed the location of the CopyButtonContent component. The theme now swizzles DocItem/Layout
36+
and conditionally puts the Copy button content component after it or below it
37+
38+
- e1246b2: Major architecture improvements for better plugin compatibility:
39+
40+
**Component Changes:**
41+
- Switched from ejecting `DocItem/Layout` to wrapping `DocBreadcrumbs`
42+
- This prevents conflicts with other plugins that customize the layout
43+
- Uses WRAP pattern instead of EJECT for better compatibility
44+
- Changed internal import from `@theme-original` to `@theme-init` following Docusaurus best
45+
practices for theme enhancers
46+
47+
**Improvements:**
48+
- Fixed type declarations to accurately reflect component props
49+
- Removed unused `className` prop from `CopyPageContent`
50+
- Fixed `DocBreadcrumbs` type declaration for proper wrapping support
51+
- Added `margin-left: auto` to ensure copy button always aligns right in desktop view
52+
- Fixed package publishing configuration
53+
- Added `src/theme` directory to published files for TypeScript swizzling support
54+
- Updated devDependencies for proper type resolution
55+
- Changed `react-icons` from exact version to version range
56+
57+
**Documentation:**
58+
- Updated README with correct swizzle examples for `DocBreadcrumbs`
59+
- Added explanation of `@theme-init` vs `@theme-original` usage
60+
- Updated swizzle configuration to reflect new safe wrapping pattern
61+
62+
**Compatibility:**
63+
- Now compatible with plugins like `docusaurus-plugin-openapi-docs` that also customize layouts
64+
- Follows official Docusaurus theme enhancer pattern (similar to
65+
`@docusaurus/theme-live-codeblock`)
66+
- Users can now safely wrap our enhanced breadcrumbs with `@theme-original/DocBreadcrumbs`
867

68+
## 2.0.0-alpha.2
969

70+
### Patch Changes
71+
72+
- Major architecture improvements for better plugin compatibility:
73+
74+
**Breaking Changes:**
75+
- Switched from ejecting `DocItem/Layout` to wrapping `DocBreadcrumbs`
76+
- This prevents conflicts with other plugins that customize the layout
77+
- Uses WRAP pattern instead of EJECT for better compatibility
78+
- Changed internal import from `@theme-original` to `@theme-init` following Docusaurus best
79+
practices for theme enhancers
80+
81+
**Improvements:**
82+
- Fixed type declarations to accurately reflect component props
83+
- Removed unused `className` prop from `CopyPageContent`
84+
- Fixed `DocBreadcrumbs` type declaration for proper wrapping support
85+
- Added `margin-left: auto` to ensure copy button always aligns right in desktop view
86+
- Fixed package publishing configuration
87+
- Added `src/theme` directory to published files for TypeScript swizzling support
88+
- Updated devDependencies for proper type resolution
89+
- Changed `react-icons` from exact version to version range
90+
91+
**Documentation:**
92+
- Updated README with correct swizzle examples for `DocBreadcrumbs`
93+
- Added explanation of `@theme-init` vs `@theme-original` usage
94+
- Updated swizzle configuration to reflect new safe wrapping pattern
95+
96+
**Compatibility:**
97+
- Now compatible with plugins like `docusaurus-plugin-openapi-docs` that also customize layouts
98+
- Follows official Docusaurus theme enhancer pattern (similar to
99+
`@docusaurus/theme-live-codeblock`)
100+
- Users can now safely wrap our enhanced breadcrumbs with `@theme-original/DocBreadcrumbs`
101+
102+
## 2.0.0-alpha.1
103+
104+
### Patch Changes
105+
106+
- Code cleanup and cache optimization:
107+
- Remove dead code (className prop, normalizePathname export, CopyContentData export)
108+
- Optimize cache implementation (replace over-engineered promise cache with minimal in-memory
109+
cache)
110+
- Fix resize re-fetch bug (component no longer re-fetches data when switching between
111+
mobile/desktop views)
112+
- Reduce code size by 47% in useCopyContentData hook
113+
114+
## 2.0.0-alpha.0
115+
116+
### Major Changes
117+
118+
- Alpha Release

0 commit comments

Comments
 (0)