facebook / facebook/docusaurus

Dynamic Routes and Data Fetching

Abierto
#4,710 8 comentarios 2 reacciones 0 asignados Ver en GitHub
proposal
Lenguaje dominante
TypeScript
Estrellas
66.2k
Forks
10k
Merge medio
1 d 3 h
PR fusionados (30 d)
52

Descripción

## 🚀 Feature

Support "nextjs-like" dynamic routes so that N pages may be generated from pages with templated filenames (`[thingid].tsx`).

### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#reporting-new-issues)?

yes

## Motivation

Project I'm working on has a bunch of static json data from which we'd like to seed multiple pages. People on the project are super torn because Docusaurus offers so much ease and flexibility for everything we need, but skeptical of doing pre-build generation ourselves via a plugin, etc.

## Pitch

Support Dynamic Routes and Data Fetching ala NextJS:

- https://nextjs.org/docs/basic-features/data-fetching
- https://nextjs.org/docs/routing/dynamic-routes

In NextJS, you just make a file with a templated filename, slap a `getStaticProps` and `getStaticPaths` functions in the module and you're good to go. If Docusaurus had this feature, when you would ever need to actually reach for NextJS?! :)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.