Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

99
Vistas
Get a list of all pages from `docs` directory?

I am trying to implement a "Get random page" link in Docusaurus. For that I would like to get a list of all available pages/page ids+path from the docs/ directory.

Does Docusaurus have a way to do this programmatically?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I did not find any native or plugin way to achieve this... Here is how I you do it:


PART 1

Once you built you docusaurus website, will be generated a sitemap.xml file. This file is locate at the root directory of your site and contains all of the url of the doc pages.

Create a js function that read this file and parse it. Then get a random url open it.

TIP 1: https://www.w3schools.com/xml/xml_parser.asp

TIP 2: https://www.w3schools.com/jsref/met_win_open.asp


PART 2

Then, you can embed your JavaScript using the mdx function of docusaurus.

TIP: How can I add custom scripts in index.html's head part in Docusaurus V2?

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda