Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deploy custom assets? #182

Open
moyner opened this issue Sep 24, 2024 · 4 comments
Open

How to deploy custom assets? #182

moyner opened this issue Sep 24, 2024 · 4 comments

Comments

@moyner
Copy link

moyner commented Sep 24, 2024

Hi, thanks for the great work on this project!

I migrated from standard Documenter output and I have a small issue. I generate a bunch of notebooks using Literate during my make.jl script. Previously, these were written to joinpath(@__DIR__, "src", "examples") and then automatically copied over during gh-pages deployment and I could link to them in my documentation. This does not seem to work with DocumenterVitepress. I tried placing the files in assets, build and in a subfolder of joinpath(@__DIR__, "build", "final_site") but neither seems to work. Any tips? I don't particularly care about folder structures or anything like that, I just want them copied over when my docs are built.

@lazarusA
Copy link
Collaborator

everything that is in docs/src/ should be copied. You could test this by looking at the .documenter generated folder, after you run your make.jl file. And if that one is not working for whatever reason. Then also, the same should happened if you have additional assets at docs/src/assets/. Any link? maybe taking a look will be faster.

@asinghvi17
Copy link
Collaborator

I'm presuming that they were written before makedocs if that's the case. What happens if you write the example files after makedocs but before deploydocs?

@moyner
Copy link
Author

moyner commented Sep 26, 2024

Thanks for the input!

I tried to make the files after makedocs in a branch:

sintefmath/JutulDarcy.jl@19ff664

I cannot see the files in the preview of the docs in gh-pages, though.

https://github.com/sintefmath/JutulDarcy.jl/tree/gh-pages/previews/PR64

Beware that the build time on this repo is quite large, but the setup is pretty straightforward.

@moyner
Copy link
Author

moyner commented Sep 27, 2024

I experimented a bit. By doing the file generation after makedocs but before deploydocs I managed to get the files copied over:
https://github.com/sintefmath/JutulDarcy.jl/tree/gh-pages/previews/PR64/final_site

What did not work:

notebook_dir = joinpath(@__DIR__, "src", "notebooks_build") # Custom folder that does not exist already
notebook_dir = joinpath(@__DIR__, "src", "assets")                  # Standard assets

What did work was to use final_site. I also tested with a folder placed there and that did work too.

 notebook_dir = joinpath(@__DIR__, "build", "final_site")
 notebook_dir = joinpath(@__DIR__, "build", "final_site", "notebooks")

This more or less solves my problem, but it sounds like the first two options also should have worked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants