shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.

Home Page:https://nextra.site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

new feature: yml include

crguezl opened this issue · comments

Thanks for nextra ❤️ !

It will be nice to extend nextra yaml parser so that in the page frontmatter we can use an include directive like the one provided by the package yaml-include

With such feature we can avoid repetition and factorize yaml that is common to several pages.

---
title: "Wednesday 2024/04/03"
videos: !!inc/file videos.yml
---

import Videos from '@/components/videos'

<Videos ids={ [frontmatter().video20240403.id] }></Videos>

Where videos.yml has something like:

video20240403:
  url: "https://youtu.be/twroW5voFEo"
  id: "twroW5voFEo"
  date: "2024/04/03"
  comment: "Clase del 03/04/2024. Doubts and queries about lexer-generator. The FunctionObject class. Callable instances. First steps on the assign function"