Skip to content

Add support for loading symbolic links to md files #3579

Closed

Description

@charlax

🚀 Feature

This is for docusaurus v2.

Allow having symbolic links in docs/. Currently, using links (e.g. docs/index.md -> ../index.md) raises the following:

 @ ./.docusaurus/registry.js 1:2654-2705 1:2524-2622
 @ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js
 @ ./.docusaurus/routes.js
 @ ./node_modules/@docusaurus/core/lib/client/clientEntry.js
 @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js../index.md 1:2
Module parse failed: Assigning to rvalue (1:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

Have you read the Contributing Guidelines on issues?

Yes.

Motivation

I have the current setup:

package.json
package-lock.json
babel.config.js
...
docs/  # the docs
├── index.md
├── how-to-send-emails.md
doc-website/  # docusaurus
├── README.md
├── babel.config.js
├── build
├── docs -> ../docs
├── docusaurus.config.js
├── node_modules
├── package-lock.json
├── package.json
├── prettier.config.js
├── sidebars.js
├── src
├── static

I would like to have this setup because it involves less changes and keeps a fairly flat structure.

Other folder layouts considered:

  • Put docusaurus in the first level folder. This is not ideal because this is where my production app lives, with a custom babel.config.js that I'd like to avoid modifying.
  • Put the docs/ inside doc-website/docs. This is not ideal the extra subfolder is awkward for users who want to read the doc via Github for instance.

The current docusaurus webpack setup does not seem to support symbolic files. I could create a plugin with configureWebpack(config, isServer, utils) to do that, but that seems overkill.

Pitch

Supporting symbolic links seems fairly innocuous and should be simple to implement?

Currently researching https://github.com/facebook/docusaurus/tree/master/packages/docusaurus/src/webpack about the best way to achieve that.

Activity

  1. added
    feature
    status: needs triage
    on Oct 13, 2020
  2. slorber commented on Oct 14, 2020

    @slorber
    Collaborator

    Hi @charlax

    That seems related to an existing issue and there is a potential user-land solution, so I'm closing in favor of the other issue:

    #3272 (comment)

  3. charlax commented on Oct 21, 2020

    @charlax
    Author

    Thanks, creating local plugins is exactly what I was looking for.

  4. slorber commented on Oct 21, 2020

    @slorber
    Collaborator

    Great.

    I'm thinking of a solution to make this more idiomatic.
    Perhaps allow to pass configureWebpack directly in siteConfig, or add an empty local plugin to all newly initialized Docusaurus sites

  5. added
    closed: duplicate
    and removed
    status: needs triage
    on Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed: duplicatefeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions