0

Github pages (https://docs.github.com/en/pages) is an amazing tool for documenting your git hub project.

However, I am having a little trouble trying to use http-server (https://www.npmjs.com/package/http-server) to preview/debug my pages.

I'm trying to use the myproject/docs folder as my Github docs web page. My file structure looks something like "myproject/docs/pages/sometopic/somepage.html".

I can reference other pages in the project with something like "/myproject/pages/sometopic/somepage.html"

Note the leading "/" and the absence of the "docs" folder in the path.

If I try to use something like html-server to preview/debug my pages all of the links are broken as html-server does not strip out the "/docs" part of the url.

Is there a way I can configure either html-server and/or Github pages so that they use the same references?

I've tried using relative references (e.g. pages/sometopic/somepage.html and ../../../index.html but either Github pages and/or the frameworks I'm using do not consistently recognize them).


EDIT:

I can't use relative links because that seems to break jquery (version 1.11.3).

John
  • 3,458
  • 4
  • 33
  • 54

1 Answers1

0

This was quite easily done by adding a logical link and then launching the http-server from the appropriate location relative to the logical link.

Link was created like this:

mklink /D fhir-to-omop ..\..\docs
John
  • 3,458
  • 4
  • 33
  • 54