pomber / code-surfer

Rad code slides <🏄/>
https://codesurfer.pomb.us/
MIT License
6.36k stars 174 forks source link

Choosing output path for build #79

Open roddds opened 4 years ago

roddds commented 4 years ago

Right now, by running yarn build a static version of the presentation is generated in the /public directory, but I can't seem to figure out a way to change the relative path for static files. For example, if I'm uploading to a /presentation directory on my server, all static files 404 because index.html and other files have paths relative to the root.

In create-react-app this is solved by changing the path in the configuration file, but I can't seem to find how to do that with code-surfer.

roddds commented 4 years ago

Upon further research, I realized Code Surfer is built on mdx-deck, which is built on gatsby, and according to https://github.com/gatsbyjs/gatsby/issues/1878 this will probably never be possible.

Damn.

roddds commented 4 years ago

So it turns out I was barking at the wrong tree here - that gatsby issue is related to renaming the public directory itself, not any subdirectories. I also found this help page. So now the only step left was to figure out how to change mdx-deck's gatsby settings. As far as I could tell there was no way to do it directly, but as a workaround you could:

As far as workarounds go this is a pretty terrible one, but since I won't be running builds that often, this is acceptable to me.

Would love to hear from other people that had similar problems.

pomber commented 4 years ago

Hi @roddds, I haven't tried changing the output path. But the build command is from mdx-deck not code-surfer. Maybe you should create the issue there.