huggingface/doc-builder

_redirects.yml is not kept when building documentation

regisss opened this issue · 0 comments

I'm trying to use the new redirection feature with _redirects.yml in this PR: huggingface/optimum#441
The issue is that _redirects.yml does not appear anywhere in the generated documentation: https://github.com/huggingface/doc-build-dev/tree/main/optimum/pr_441/en

After taking a quick look, it seems to happen here:

subprocess.run(
["npm", "run", "build"],
stdout=subprocess.PIPE,
check=True,
encoding="utf-8",
cwd=working_dir,
env=env,
)
# Copy result back in the build_dir.
shutil.rmtree(output_path)
shutil.copytree(tmp_dir / "kit" / "build", output_path)

The kit/build directory does not contain _redirects.yml, which is why it is not in the output directory when kit/build is copied there.

If the fix is simply to copy _redirects.yml to the output directory, I'm happy to open a PR. However, if we need to modify the configuration of npm I'm not sure I can help much.

@mishig25