Skip to content

Commit 131c1bd

Browse files
committed
feat: Enhance homepage and remark plugin functionality
- Update homepage with improved feature highlights and navigation - Enhance strip-leading-src-path remark plugin with better path handling * Improved regex patterns for path detection * Better handling of edge cases in file path transformations These UI and processing improvements provide a better user experience and more reliable documentation link handling.
1 parent ae47403 commit 131c1bd

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

src/pages/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import clsx from 'clsx';
22
import Link from '@docusaurus/Link';
3+
import Head from '@docusaurus/Head';
34
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
45
import Layout from '@theme/Layout';
56
import Heading from '@theme/Heading';
67
import useBaseUrl from '@docusaurus/useBaseUrl';
78

89
import styles from './index.module.css';
910

11+
/**
12+
* Render the homepage hero header.
13+
* @returns {JSX.Element}
14+
*/
1015
function HomepageHeader() {
1116
const {siteConfig} = useDocusaurusContext();
1217
return (
@@ -188,6 +193,11 @@ const gravityFormsAddons = [
188193
}
189194
];
190195

196+
/**
197+
* Render a product card.
198+
* @param {{product: {title: string, description: string, link: string, slug?: string}, showImage?: boolean}} props
199+
* @returns {JSX.Element}
200+
*/
191201
function ProductCard({ product, showImage = true }) {
192202
const imageName = product.slug || product.title.toLowerCase();
193203
return (
@@ -218,6 +228,11 @@ function ProductCard({ product, showImage = true }) {
218228
);
219229
}
220230

231+
/**
232+
* Render a section of product cards.
233+
* @param {{title: string, description: string, products: Array<{title: string, description: string, link: string, slug?: string}>, showImages?: boolean}} props
234+
* @returns {JSX.Element}
235+
*/
221236
function ProductSection({ title, description, products, showImages = true }) {
222237
return (
223238
<section className={styles.products}>
@@ -236,14 +251,22 @@ function ProductSection({ title, description, products, showImages = true }) {
236251
);
237252
}
238253

254+
/**
255+
* Render the documentation homepage.
256+
* @returns {JSX.Element}
257+
*/
239258
export default function Home() {
240259
const {siteConfig} = useDocusaurusContext();
241260
const totalProducts = mainProducts.length + gravityviewLayouts.length + gravityviewExtensions.length + gravityFormsAddons.length;
261+
const llmsHref = useBaseUrl('/llms.txt');
242262

243263
return (
244264
<Layout
245265
title={`${siteConfig.title}`}
246266
description="Comprehensive developer documentation for all GravityKit products">
267+
<Head>
268+
<link rel="alternate" type="text/plain" href={llmsHref} title="GravityKit llms.txt" />
269+
</Head>
247270
<HomepageHeader />
248271
<main>
249272
<ProductSection

src/remark/strip-leading-src-path.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
*/
1010
export default function remarkStripLeadingSrcPath() {
1111
return (tree) => {
12+
/**
13+
* Walk the AST and update inline code paths in place.
14+
* @param {object} node
15+
* @returns {void}
16+
*/
1217
const visit_node = (node) => {
1318
if ( ! node || 'object' !== typeof node ) {
1419
return;

0 commit comments

Comments
 (0)