2

What I want to accomplish

In docusaurus I want to have a single file where I can declare all the links in my docs, preferably using links to the md file that are processed by docusaurus.

Description of my issue

This is my first time working with docusaurus and with anything react.js

I've been building an user manual with pictures, videos tutorials and text. To improve readability for my non-tech users, I´ve been adding links to related pages in my docs.

For example:

enter image description here

If we looked at my .md file I would have something like this:

Para que un [operador][concepto__OperadorUrl] pueda acceder al sistema deberá 
solicitar un [**usuario nuevo**][auth__UsuarioNuevoUrl]

and the links would be declared like this:

[concepto__OperadorUrl]: /docs/conceptos.md#operador
[auth__UsuarioNuevoUrl]: /docs/auth/users.md#newUser

I´m going to be using these links many times all over the documentation. I would like to keep the docs as DRY (Don´t Repeat Yourself) as possible. It would be awesome if I could declare these links in a single md file, json or js file, and use them all over.

What I´ve tried


version 1

Using a template as _CommonSharedUrl.mdx

import ConceptoOperadorUrl from '/';

and importing it into one of my .md files

import SharedUrls from '/docs/shared/_CommonSharedUrl.mdx'

<SharedUrls /> 

and using it like this

[shared url]({ConceptoOperadorUrl})

or like this

[shared url](ConceptoOperadorUrl)

but i always get an error saying

Module not found: Error: Can't resolve '/'


version 2

Using a template as _CommonSharedUrl.mdx

[shared_url]: /ConceptosBasicos#operador

and importing it into one of my .md files

import SharedUrls from '/docs/shared/_CommonSharedUrl.mdx'

<SharedUrls /> 

and using it like this

[shared url][shared_url]

still doesn´t work an i get the result

enter image description here

Omar Yafer
  • 823
  • 6
  • 17

0 Answers0