catalog icon indicating copy to clipboard operation
catalog copied to clipboard

How to configure public url?

Open equinusocio opened this issue 6 years ago • 7 comments

Hi, i have an issue publishing the build folder content under a gh-page.

My gh-page is set to serve all files from the root of the master branch. My gh-page url is:

https://contactlab.github.io/repo-name/

I have an issue with the static js files because they have a path starting with /static/... and i need to make them start with /repo-name/static since using /static return 404. Setting the basePath does not change the generated paths. Any suggestion?

equinusocio avatar Dec 21 '17 13:12 equinusocio

catalog build --public-url=/repo-name/ should do the trick. Note that the files in catalog/static will end up at /repo-name/, not /repo-name/static/

jstcki avatar Dec 21 '17 14:12 jstcki

@herrstucki Thank you. The catalog now just run fine, but as you said, static content files now return 404. There is a way to fix this?

The static content is served from https://contactlab.github.io/pages/folder/INTRODUCTION.md instead of https://contactlab.github.io/repo-name/pages/design_system/INTRODUCTION.md.

equinusocio avatar Dec 21 '17 14:12 equinusocio

For example: catalog/static/foo.jpg should be referenced like /foo.jpg in your Markdown documents, then it should work.

jstcki avatar Dec 21 '17 14:12 jstcki

mmm i'm just importing some static .md content with the pageLoader()

content: pageLoader("/pages/design_system/INTRODUCTION.md")

Inside the source files the /pages folder is inside /static. When builded, it get moved at the root (as you said). I'm missing something or i'm using it the wrong way?

equinusocio avatar Dec 21 '17 14:12 equinusocio

@herrstucki Just fixed by removing the / at the begin -> pageLoader("pages/design_system/INTRODUCTION.md")

equinusocio avatar Dec 21 '17 14:12 equinusocio

Ok, cool. Sorry for the confusion. I'll have to check if that can be improved or documented better.

jstcki avatar Dec 21 '17 14:12 jstcki

@herrstucki Setting --public-url in the build command works, but it is not intuitive. I first followed the docs and added basePath and useBrowserHistory to my config. basePath should be ignored when running catalog-start and only used for catalog-build. Either way, it would be helpful if the docs mentioned this.

maiertech avatar Apr 11 '18 21:04 maiertech