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

Is there a way to copy raw static files into the generated site? #1901

Closed
mikehearn opened this issue Nov 3, 2019 · 3 comments
Closed

Is there a way to copy raw static files into the generated site? #1901

mikehearn opened this issue Nov 3, 2019 · 3 comments

Comments

@mikehearn
Copy link

I'd like to include non-mkdocs generated HTML into my static site, so I can include JavaDocs and the like. There doesn't appear to be any way to do this as far as I can tell so far, other than editing the site dir after generation. But the gh-deploy command is indeed, so useful, that I'd really like to have mkdocs understand this pattern so I don't have to do the deploy manually.

@waylan
Copy link
Member

waylan commented Nov 3, 2019

Any non-Markdown files included in the docs_dir are copied as-is. Simply include the files in your docs_dir and they will be copied over.

If you would like to do anything outside of that, a plugin would address those needs. Personally, I'm surprised I don't see one listed on the wiki that does this already.

@mikehearn
Copy link
Author

Ah, I'm an idiot. It does work. Sorry. I think I was getting confused because I expected mkdocs serve to rebuild the site in the site directory, as it talks about cleaning the site directory and building the docs when it starts up. I looked inside it and didn't see my files being copied across, and I'd made a mistake in the URL I was opening so got a 404. Together these two things confused me. But experimenting more, I see that mkdocs serve must be using an in-memory site build or putting it somewhere else, as the site directory doesn't actually get created at all.

@waylan
Copy link
Member

waylan commented Nov 4, 2019

Yes, the serve command creates a temporary directory and does not use the site dir.

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

2 participants