Deploying with css style files in another top directory

I’m trying to deploy Dokka docs to Netlify following this guide, but the css files are in another directory


The guy has created a new Gradle task to move them inside the same directory, updating all the references

I’d like to avoid polluting my build.gradle.kts if possible and address the problem from another point of view: is it possible to deploy multiple directories at the same level?

Something like

netlify deploy -d ".\build\dokka\html\kotlin-unsigned\;.\build\dokka\html\styles\" --prod

We can only deploy a single directory. You’ll need to ensure that all files are in that directory SOMEHOW. Definitely doesn’t need anything to do with gradle; you can copy around using whatever commands you want, such as command line or other programmatic methods.

Perhaps you can put BOTH of them into some other top level directory that you can tell netlify is your publish directory?

Hi fool,

I kind of solved this by pushing the top directory and insert a redirect to the one containing index.html

now what remains is just aesthetics: I’d like to have a clean url, but using status 200 breaks the css path…

Yup, if you proxy your html, you will need either to adjust the paths you use to load the css (if you use relative paths anyway - if you use absolute paths like /html/styles/styles.css, this shouldn’t matter)… or let us do that for you. To accomplish the latter, I might make a redirect to handle it. From your example, perhaps this would work?

/index.html /html/kotlin-unsigned/index.html 200!
/styles/* /html/styles/:splat 200!

Just tried, this doesnt work anymore

But if I type manually it works…

What am I doing wrong?

Ps: why the exclamation point at the end of the status?

oh, my instructions assumed your site started from /html not /build/dokka/html. Try this instead?

/index.html /build/dokka/html/kotlin-unsigned/index.html 200!
/styles/* /build/dokka/html/styles/:splat 200!

Yeah, I fixed that, but still

from = "/index.html"
to = "/build/dokka/html/kotlin-unsigned/index.html"
status = 200

from = "/images/*"
to = "/build/dokka/html/images/:splat"
status = 200
#  force = true

from = "/scripts/*"
to = "/build/dokka/html/scripts/:splat"
status = 200
#  force = true

from = "/styles/*"
to = "/build/dokka/html/styles/:splat"
status = 200
#  force = true

This works fine

  from = "/"
  to = "/build/dokka/html/kotlin-unsigned"

I really cant get why "/index.html" isn’t working…

Hi, @elect86, the index.html. I do see the 301 redirect working currently and I replied about this as well here:

Since we are talking about the same site and same set of redirect rules, I’m recommend we only do so there for now to keep all comments in one place. Please follow-up there if there are other questions about this.