Home / Function/ getInternalContentPaths() — supabase Function Reference

getInternalContentPaths() — supabase Function Reference

Architecture documentation for the getInternalContentPaths() function in get-internal-content.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  c3042c55_4cbc_2562_70d4_b640b483b9c8["getInternalContentPaths()"]
  e3b6625d_ab45_5da8_b98b_f308b8dcbe9c["Sidebar()"]
  e3b6625d_ab45_5da8_b98b_f308b8dcbe9c -->|calls| c3042c55_4cbc_2562_70d4_b640b483b9c8
  style c3042c55_4cbc_2562_70d4_b640b483b9c8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/learn/lib/get-internal-content.ts lines 8–37

export function getInternalContentPaths(): Set<string> {
  const internalDir = path.join(process.cwd(), 'content/internal')
  const paths = new Set<string>()

  if (!existsSync(internalDir)) {
    return paths
  }

  function scanDirectory(dir: string, prefix: string = '') {
    const entries = readdirSync(dir)

    for (const entry of entries) {
      const fullPath = path.join(dir, entry)
      const stat = statSync(fullPath)

      if (stat.isDirectory()) {
        // Recursively scan subdirectories
        scanDirectory(fullPath, prefix ? `${prefix}/${entry}` : entry)
      } else if (entry.endsWith('.mdx') || entry.endsWith('.md')) {
        // Remove file extension to get the path
        const filename = entry.replace(/\.(mdx|md)$/, '')
        const contentPath = prefix ? `/${prefix}/${filename}` : `/${filename}`
        paths.add(contentPath)
      }
    }
  }

  scanDirectory(internalDir)
  return paths
}

Subdomains

Called By

Frequently Asked Questions

What does getInternalContentPaths() do?
getInternalContentPaths() is a function in the supabase codebase.
What calls getInternalContentPaths()?
getInternalContentPaths() is called by 1 function(s): Sidebar.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free