--- name: internal-links description: Connect all buttons and links to pages or same-page sections. Ensures every CTA has a valid href, uses Next.js Link component, and adds section IDs for anchor links. --- # Internal Links Ensure all buttons and links in a page connect to valid destinations - either other pages or sections on the same page. ## Workflow 1. **Read Page File** - Identify all section components 2. **For Each Section:** - Find all ` // CORRECT: Button with anchor link // WRONG: Button without link // WRONG: Button with onClick only ``` ## Link Types ### 1. Page Links Link to other pages in the site: ```tsx Contact Services Portfolio About ``` ### 2. Anchor Links (Same Page) Link to sections on the same page: ```tsx View Pricing FAQ Get in Touch ``` **Requires:** Target section must have matching `id`: ```tsx
``` ### 3. Page + Anchor Links Link to a section on another page: ```tsx Web Design Services Contact Form ``` ## Common CTA Destinations | Section | Primary CTA | Secondary CTA | |---------|-------------|---------------| | Hero | `/kontakt` | `/projekte` or `#features` | | Features | `/leistungen` | `#pricing` | | Pricing | `/kontakt` | - | | CTA | `/kontakt` | - | | Projects | `/projekte` | `/kontakt` | | FAQ | `/kontakt` | - | ## Section IDs Add `id` to sections that are anchor link targets: ```tsx // Homepage sections
``` ### ID Naming Convention Use lowercase, hyphenated names matching the section purpose: | Section Component | ID | |-------------------|-----| | Feature56 | `features` | | Feature207 | `process` | | Pricing8 | `pricing` | | Projects5 | `projects` | | Testimonial4 | `testimonials` | | Faq9 | `faq` | | Cta21 | `contact` | ## Checklist Per Section For each section, verify: - [ ] All ` ``` **After:** ```tsx ``` ### Fix 2: Add Section ID for Anchor **Before (button):** ```tsx ``` **Before (section - missing id):** ```tsx
``` **After (section - with id):** ```tsx
``` ### Fix 3: Scroll Hint Button **Before:** ```tsx ``` **After:** ```tsx ``` ## Import Requirements Ensure sections have the Link import: ```tsx import Link from "next/link"; ``` ## Output After running this skill, report: - Number of buttons linked - Section IDs added - List of link destinations used