Skip to content
Discussion options

You must be logged in to vote
import type { DocAttributes } from './docs.model'
import { injectContent, injectContentFiles, MarkdownComponent } from '@analogjs/content'
import { Location } from '@angular/common'
import { Component, inject } from '@angular/core'
import { toSignal } from '@angular/core/rxjs-interop'
import { map, of } from 'rxjs'

export function injectDocs<Attributes extends Record<string, any>>(folder: string, slug: string) {
  const contentFiles = injectContentFiles<Attributes>(contentFile => contentFile.filename.includes(`/src/content/${folder}`))

  const contentFile = contentFiles.find((contentFile) => {
    return contentFile.filename.includes(`${folder}/${slug}`)
  })

  if (!contentFile) {
    r…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ajitzero
Comment options

@ajitzero
Comment options

@adrian-ub
Comment options

@brandonroberts
Comment options

Answer selected by adrian-ub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants