1

This is my documentation files structure

|__docs/
| |__config-docsify.js
| |__index.html
| |__README.md
|__README.md

As you can see, the Docsify files are in docs/ directory and I would like to link the /docs/README.md file to root the README file (/README.md). I.e., when I click on a link in the /docs/README.md file, I get redirected to /README.md file, or at least I get its content somehow.

However, when I try to add a link like this

<!-- projectfolder/docs/README.md file -->
See the [README](../README.md) file in the root directory.

I get redirected to localhost:3000/../README.md which does not exist.

Does anyone know a way to link a file that is not in the same folder (or subfolder) of the docsify files?


EDIT

I am serving the docs folder using

docsify serve docs/
Wesley Gonçalves
  • 1,985
  • 2
  • 19
  • 22
  • Have a look at this, it might help: https://docsify.now.sh/configuration?id=relativepath – alcaprar May 21 '20 at 09:13
  • 1
    @alcaprar I tried your suggestion, but it still doesn't work. I tried to combine with `basePath` but nothing. Maybe the file is out of reach because docsify is serving the folder that is in the same level as the file I am trying to open. What do you think about it? – Wesley Gonçalves May 21 '20 at 14:32
  • 1
    Yes I think you are right. Docsify should serve everything is inside the docs folder (everything is at the same level of index.html) – alcaprar May 22 '20 at 09:24

1 Answers1

1

You can embed external files (or raw.github...) using embed files: https://docsify.js.org/#/embed-files

Blizzard
  • 1,117
  • 2
  • 11
  • 28
  • I tried your suggestion, but it still doesn't work. I updated the question to say that I am serving the `docs` directory. Maybe that is the reason it can't get the README file. They are both in the same level. – Wesley Gonçalves May 21 '20 at 14:14
  • If this is hosted on guthub, you could get the raw instead of including using the file path. So, your path may look something like: `https://raw.githubusercontent.com///master/README.md` – Blizzard May 22 '20 at 12:53
  • 1
    @Blizzard This works and it even gets mentioned in the docs, however it only works once the documentation is hosted online. You cannot test it with live preview on your local system. – Lukas Körfer Jun 14 '20 at 01:33
  • I am able to test this just fine with `docsify serve /path/to/site` and then navigating to the local address. – Blizzard Jun 15 '20 at 02:06