Skip to content

feat(layer): add PageHero, PageSection, PageCard components and enhance ButtonA#5

Merged
amondnet merged 4 commits intomainfrom
docs-index
Dec 3, 2025
Merged

feat(layer): add PageHero, PageSection, PageCard components and enhance ButtonA#5
amondnet merged 4 commits intomainfrom
docs-index

Conversation

@amondnet
Copy link
Copy Markdown
Contributor

@amondnet amondnet commented Dec 3, 2025

Summary

This PR adds three new MDC (Markdown Components) for the documentation layer and enhances the existing ButtonA component with more flexible styling options.

Changes

  • New PageHero Component: Hero section component for landing pages with headline, title, description, and action links
  • New PageSection Component: Flexible section component for structured content with customizable layout
  • New PageCard Component: Card component for displaying card-based content
  • Enhanced ButtonA Component: Added size and variant props for better customization (supports 'lg' size and 'outline' variant)
  • Updated index.md: Uses new MDC components with improved semantic structure and SEO frontmatter
  • Updated index.vue: Proper 404 error handling, comprehensive SEO meta tags, and cleaner layout

Implementation Details

The new components are inspired by Nuxt UI and Docus design patterns, providing reusable building blocks for documentation sites. The ButtonA enhancements maintain backward compatibility while allowing more design flexibility.

Test plan

  • Visual inspection of landing page in development mode (bun dev)
  • Verify responsive design on mobile and desktop
  • Test dark mode theme switching
  • Verify all links in hero section work correctly
  • Check SEO meta tags in page source
  • Verify 404 handling when index.md is missing

Related Issue

This work implements the component architecture for the docs-please landing page.

…ce ButtonA

- Add new PageHero MDC component for landing page hero section with headline, title, description, and links
- Add new PageSection MDC component for structured content sections with customizable layout
- Add new PageCard MDC component for displaying card-based content
- Enhance ButtonA component to support size and variant props (lg, outline, etc.)
- Update index.md to use new MDC components with improved semantic structure
- Update index.vue with proper 404 error handling and comprehensive SEO meta tags
- Improve page layout by removing unnecessary prose styling from landing page

Closes #docs-index
Copilot AI review requested due to automatic review settings December 3, 2025 07:26
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @amondnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the documentation layer by introducing a suite of new Markdown-compatible (MDC) components, PageHero, PageSection, and PageCard, designed to streamline the creation of structured and visually appealing content. It also refines the existing ButtonA component with expanded styling options. These changes collectively aim to improve the overall flexibility, maintainability, and search engine optimization of documentation sites built with this layer.

Highlights

  • New MDC Components: Introduced PageHero, PageSection, and PageCard components to provide reusable building blocks for documentation sites, inspired by Nuxt UI and Docus.
  • Enhanced ButtonA Component: Added size and variant props to the ButtonA component, allowing for more flexible styling and customization while maintaining backward compatibility.
  • Improved Landing Page Structure: The index.md content file was refactored to utilize the new PageHero, PageSection, and PageCard components, resulting in a more semantic and structured layout.
  • Advanced SEO and Error Handling: The index.vue page now includes comprehensive SEO meta tag generation based on page frontmatter and robust 404 error handling for missing content.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Dec 3, 2025

Deploying docs-please with  Cloudflare Pages  Cloudflare Pages

Latest commit: f14b62a
Status:🚫  Deploy failed.

View logs

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several new and useful MDC components (PageHero, PageSection, PageCard) for building documentation pages and enhances the existing ButtonA component. The changes are well-structured and improve the content layer significantly. My review focuses on ensuring the correct usage of MDC syntax, preventing a functional regression in the ButtonA component, and improving the design and clarity of the new code. I've identified a few high-priority issues related to MDC syntax and component props that should be addressed.

Comment on lines +8 to +39
::PageHero
#headline
docs-please

# Write beautiful docs with Markdown.
#title
Write beautiful docs with Markdown.

Ship fast, flexible, and SEO-optimized documentation with beautiful design out of the box.
#description
Ship fast, flexible, and SEO-optimized documentation with beautiful design out of the box. Built with **shadcn-vue** and **Nuxt Content**.

Built with **shadcn-vue** and **Nuxt Content**.
#links
:::ButtonA{to="/docs/getting-started/introduction" size="lg"}
Get Started
:::

::div{.flex.flex-wrap.justify-center.gap-4.mt-8}
::ButtonA{to="/docs"}
Get Started
::

::ButtonA{to="https://github.com/pleaseai/docs" target="\_blank" external}
GitHub
::
:::ButtonA{to="https://github.com/pleaseai/docs" target="_blank" variant="outline" size="lg"}
GitHub
:::
::

::PageSection{headline="Features"}
#title
Everything you need for documentation

#description
A complete documentation solution with modern tooling and beautiful design.

:::div{.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-3.gap-6.mt-8}
::::PageCard{title="shadcn-vue Components" icon="lucide:component"}
#description
Beautiful, accessible UI components built with Reka UI primitives and styled with Tailwind CSS.
::::
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There are several issues with the MDC (Markdown Components) syntax regarding the number of colons used, which will likely cause rendering errors.

  1. Components with slots: Components that use named slots (like #headline, #title, etc.) must be wrapped with three colons (:::), not two (::). This applies to PageHero (line 8) and all PageSection components (lines 28, 68, 97). Their closing tags must also be :::.

  2. Nested components: When nesting components, each level of nesting should add a colon. The current implementation is inconsistent. Based on Nuxt Content's documentation, if PageSection is ::: (3 colons), a component inside its default slot like the div on line 35 should be :::: (4 colons), and PageCards inside that div (e.g., line 36) should be ::::: (5 colons). Similarly, ButtonA inside PageHero's #links slot should be ::::.

This needs to be corrected throughout the file for the components to render correctly.

Comment on lines +24 to 32
<NuxtLink
:to="to"
:href="href"
:target="target"
:rel="rel"
:external="external"
>
<slot />
</NuxtLink>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

By explicitly binding only a few props to NuxtLink, you are losing support for all other NuxtLinkProps that were previously supported with v-bind="props". This is a regression, as props like activeClass or replace will no longer work.

To fix this while still separating the Button props, you can create a computed property that contains only the NuxtLinkProps and then use v-bind on the NuxtLink component.

First, add this to your <script> section:

import { computed } from 'vue'

// ... after props definition

const nuxtLinkProps = computed(() => {
  const { variant, size, ...rest } = props
  return rest
})

Then, you can use it in the template with this suggestion.

    <NuxtLink v-bind="nuxtLinkProps">
      <slot />
    </NuxtLink>

Comment on lines +6 to +14
const props = defineProps<{
title?: string
description?: string
icon?: string
to?: NuxtLinkProps['to']
target?: string
orientation?: 'vertical' | 'horizontal'
class?: HTMLAttributes['class']
}>()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The component is designed to act as a link when the to prop is provided. However, it only accepts to and target props for linking, limiting its capabilities. It would be more flexible if it accepted all NuxtLinkProps, similar to how the ButtonA component is being refactored. This would allow using props like external, rel, activeClass, etc.

You could change the props definition to extend NuxtLinkProps and then separate the props to be passed to NuxtLink.

Example of updated script:

import type { HTMLAttributes } from 'vue'
import type { NuxtLinkProps } from '#app'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '~/components/ui/card'

interface Props extends NuxtLinkProps {
  title?: string
  description?: string
  icon?: string
  orientation?: 'vertical' | 'horizontal'
  class?: HTMLAttributes['class']
}

const props = defineProps<Props>()

const isLink = computed(() => !!props.to)

const linkProps = computed(() => {
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  const { title, description, icon, orientation, class: klass, ...rest } = props
  return rest
})

And in the template, you would bind these props to the NuxtLink component:

<component
  :is="isLink ? 'NuxtLink' : 'div'"
  v-bind="isLink ? linkProps : {}"
  ...
>

This would make the component much more versatile.

</div>
</div>
<ContentRenderer
v-if="page"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The v-if="page" directive is redundant here. The if (!page.value) check on line 9 ensures that page.value is defined. If it's not, an error is thrown, and this part of the component will not be rendered. You can safely remove the v-if for cleaner code.

- Rename ButtonA to UButton
- Rename PageHero to UPageHero
- Rename PageSection to UPageSection
- Rename PageCard to UPageCard
- Update index.md to use kebab-case component names (u-button, u-page-hero, etc.)
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces three new MDC components (PageHero, PageSection, PageCard) for building documentation landing pages and enhances the ButtonA component with flexible styling options. The changes modernize the documentation layer with reusable, well-structured components while improving SEO and error handling.

Key changes:

  • New MDC components for hero sections, page sections, and cards with flexible layout options
  • Enhanced ButtonA with configurable size and variant props
  • Improved index.vue with proper 404 handling and comprehensive SEO meta tags

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/layer/app/pages/index.vue Added 404 error handling and SEO meta tags with fallback values
packages/layer/app/components/content/PageSection.vue New flexible section component with horizontal/vertical orientation and slot-based content
packages/layer/app/components/content/PageHero.vue New hero component for landing pages with customizable layout and content slots
packages/layer/app/components/content/PageCard.vue New card component with optional link functionality and flexible content structure
packages/layer/app/components/content/ButtonA.vue Enhanced with size and variant props; removed hardcoded margin class
apps/docs/content/index.md Refactored to use new PageHero, PageSection, and PageCard components with improved semantic structure
Comments suppressed due to low confidence (2)

packages/layer/app/components/content/ButtonA.vue:22

  • The removal of the mt-6 class could be a breaking change for existing usage. Components that previously relied on this margin will now need to add it manually. Consider documenting this breaking change in the PR description or migration guide.
    packages/layer/app/components/content/ButtonA.vue:30
  • [nitpick] Explicitly spreading individual props instead of using v-bind="props" reduces flexibility. This approach requires updating the component whenever new NuxtLinkProps are needed. Consider keeping v-bind="props" or using v-bind="$attrs" with proper inheritAttrs: false configuration to maintain better extensibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Start writing your documentation in Markdown.
```
::

Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The horizontal rule syntax ---- (4 dashes) is non-standard. Standard Markdown uses either --- (3 dashes), *** (3 asterisks), or ___ (3 underscores) for horizontal rules. Using 4 dashes may not render correctly in all Markdown parsers.

Copilot uses AI. Check for mistakes.
::::
:::
::

Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The horizontal rule syntax ---- (4 dashes) is non-standard. Standard Markdown uses either --- (3 dashes), *** (3 asterisks), or ___ (3 underscores) for horizontal rules. Using 4 dashes may not render correctly in all Markdown parsers.

Copilot uses AI. Check for mistakes.
::ButtonA{to="https://github.com/pleaseai/docs" target="\_blank" external}
GitHub
::
:::u-button{to="https://github.com/pleaseai/docs" target="_blank" variant="outline" size="lg"}
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using target="_blank" without rel="noopener noreferrer" on external links enables reverse tabnabbing, allowing the opened page to access window.opener and potentially navigate the original tab to a malicious site. An attacker controlling https://github.com/pleaseai/docs (or any external URL opened in a new tab) could exploit this to phish users or hijack the session context. Fix by adding rel="noopener noreferrer" to the link via the ButtonA component or directly in MDC, e.g., :::ButtonA{to="https://..." target="_blank" rel="noopener noreferrer"} or by enforcing rel on all external target="_blank" links inside ButtonA.

Suggested change
:::u-button{to="https://github.com/pleaseai/docs" target="_blank" variant="outline" size="lg"}
:::u-button{to="https://github.com/pleaseai/docs" target="_blank" rel="noopener noreferrer" variant="outline" size="lg"}

Copilot uses AI. Check for mistakes.
- Update index.md with improved hero section and feature cards grid
- Add UPageGrid component for responsive grid layouts
- Add FloatingNuxt component with hover animation effect
- Add spotlight prop to UPageCard for group hover effects
- Reorder UPageCard slots to show content above media (Docus pattern)
- Install and configure @nuxt/icon module for icon support
- Add shadcn-vue dependency for CLI tooling
- Add info, warning, success, error variants to Alert component
- Enhance Callout with type support (note, tip, warning, caution)
- Create shortcut components (Note, Tip, Warning, Caution)
- Add default padding to TabsContent component
- Update landing page to showcase new callout types
@amondnet amondnet merged commit 220164d into main Dec 3, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants